implement fix wall/morse based on fix wall/region and fix wall/harmonic

This commit is contained in:
Axel Kohlmeyer
2019-08-20 13:29:09 -04:00
parent 82b3fad152
commit 6a584672e8
5 changed files with 172 additions and 6 deletions

View File

@ -23,6 +23,7 @@
#include "respa.h"
#include "error.h"
#include "force.h"
#include "utils.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -99,6 +100,19 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
estyle[nwall] = CONSTANT;
}
if (utils::strmatch(style,"^wall/morse")) {
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
astr[nwall] = new char[n];
strcpy(astr[nwall],&arg[iarg+3][2]);
astyle[nwall] = VARIABLE;
} else {
alpha[nwall] = force->numeric(FLERR,arg[iarg+3]);
astyle[nwall] = CONSTANT;
}
++iarg;
}
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
sstr[nwall] = new char[n];