Merge branch 'master' into thermo-energy
# Conflicts: # doc/src/fix_ti_spring.rst # src/RIGID/fix_rigid_small.cpp # src/fix_langevin.cpp # src/fix_temp_berendsen.cpp # src/fix_temp_csld.cpp # src/fix_temp_csvr.cpp # src/fix_temp_rescale.cpp # src/thermo.cpp
This commit is contained in:
@ -55,26 +55,20 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
xstr = ystr = zstr = nullptr;
|
||||
|
||||
if (strstr(arg[3],"v_") == arg[3]) {
|
||||
int n = strlen(&arg[3][2]) + 1;
|
||||
xstr = new char[n];
|
||||
strcpy(xstr,&arg[3][2]);
|
||||
if (utils::strmatch(arg[3],"^v_")) {
|
||||
xstr = utils::strdup(arg[3]+2);
|
||||
} else {
|
||||
xvalue = utils::numeric(FLERR,arg[3],false,lmp);
|
||||
xstyle = CONSTANT;
|
||||
}
|
||||
if (strstr(arg[4],"v_") == arg[4]) {
|
||||
int n = strlen(&arg[4][2]) + 1;
|
||||
ystr = new char[n];
|
||||
strcpy(ystr,&arg[4][2]);
|
||||
if (utils::strmatch(arg[4],"^v_")) {
|
||||
ystr = utils::strdup(arg[4]+2);
|
||||
} else {
|
||||
yvalue = utils::numeric(FLERR,arg[4],false,lmp);
|
||||
ystyle = CONSTANT;
|
||||
}
|
||||
if (strstr(arg[5],"v_") == arg[5]) {
|
||||
int n = strlen(&arg[5][2]) + 1;
|
||||
zstr = new char[n];
|
||||
strcpy(zstr,&arg[5][2]);
|
||||
if (utils::strmatch(arg[5],"^v_")) {
|
||||
zstr = utils::strdup(arg[5]+2);
|
||||
} else {
|
||||
zvalue = utils::numeric(FLERR,arg[5],false,lmp);
|
||||
zstyle = CONSTANT;
|
||||
@ -97,16 +91,12 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
|
||||
iregion = domain->find_region(arg[iarg+1]);
|
||||
if (iregion == -1)
|
||||
error->all(FLERR,"Region ID for fix addforce does not exist");
|
||||
int n = strlen(arg[iarg+1]) + 1;
|
||||
idregion = new char[n];
|
||||
strcpy(idregion,arg[iarg+1]);
|
||||
idregion = utils::strdup(arg[iarg+1]);
|
||||
iarg += 2;
|
||||
} else if (strcmp(arg[iarg],"energy") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce command");
|
||||
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
|
||||
int n = strlen(&arg[iarg+1][2]) + 1;
|
||||
estr = new char[n];
|
||||
strcpy(estr,&arg[iarg+1][2]);
|
||||
if (utils::strmatch(arg[iarg+1],"^v_")) {
|
||||
estr = utils::strdup(arg[iarg+1]+2);
|
||||
} else error->all(FLERR,"Illegal fix addforce command");
|
||||
iarg += 2;
|
||||
} else error->all(FLERR,"Illegal fix addforce command");
|
||||
|
||||
Reference in New Issue
Block a user