simplify using utils::strdup()
This commit is contained in:
14
src/fix.cpp
14
src/fix.cpp
@ -42,21 +42,15 @@ Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) :
|
|||||||
// fix ID, group, and style
|
// fix ID, group, and style
|
||||||
// ID must be all alphanumeric chars or underscores
|
// ID must be all alphanumeric chars or underscores
|
||||||
|
|
||||||
int n = strlen(arg[0]) + 1;
|
id = utils::strdup(arg[0]);
|
||||||
id = new char[n];
|
if (!utils::is_id(id))
|
||||||
strcpy(id,arg[0]);
|
error->all(FLERR,"Fix ID must be alphanumeric or underscore characters");
|
||||||
|
|
||||||
for (int i = 0; i < n-1; i++)
|
|
||||||
if (!isalnum(id[i]) && id[i] != '_')
|
|
||||||
error->all(FLERR,"Fix ID must be alphanumeric or underscore characters");
|
|
||||||
|
|
||||||
igroup = group->find(arg[1]);
|
igroup = group->find(arg[1]);
|
||||||
if (igroup == -1) error->all(FLERR,"Could not find fix group ID");
|
if (igroup == -1) error->all(FLERR,"Could not find fix group ID");
|
||||||
groupbit = group->bitmask[igroup];
|
groupbit = group->bitmask[igroup];
|
||||||
|
|
||||||
n = strlen(arg[2]) + 1;
|
style = utils::strdup(arg[2]);
|
||||||
style = new char[n];
|
|
||||||
strcpy(style,arg[2]);
|
|
||||||
|
|
||||||
restart_global = restart_peratom = restart_file = 0;
|
restart_global = restart_peratom = restart_file = 0;
|
||||||
force_reneighbor = 0;
|
force_reneighbor = 0;
|
||||||
|
|||||||
@ -57,9 +57,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
nrepeat = utils::inumeric(FLERR,arg[4],false,lmp);
|
nrepeat = utils::inumeric(FLERR,arg[4],false,lmp);
|
||||||
nfreq = utils::inumeric(FLERR,arg[5],false,lmp);
|
nfreq = utils::inumeric(FLERR,arg[5],false,lmp);
|
||||||
|
|
||||||
int n = strlen(arg[6]) + 1;
|
idchunk = utils::strdup(arg[6]);
|
||||||
idchunk = new char[n];
|
|
||||||
strcpy(idchunk,arg[6]);
|
|
||||||
|
|
||||||
global_freq = nfreq;
|
global_freq = nfreq;
|
||||||
no_change_box = 1;
|
no_change_box = 1;
|
||||||
@ -190,9 +188,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (iarg+2 > narg)
|
if (iarg+2 > narg)
|
||||||
error->all(FLERR,"Illegal fix ave/chunk command");
|
error->all(FLERR,"Illegal fix ave/chunk command");
|
||||||
biasflag = 1;
|
biasflag = 1;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
id_bias = utils::strdup(arg[iarg+1]);
|
||||||
id_bias = new char[n];
|
|
||||||
strcpy(id_bias,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"adof") == 0) {
|
} else if (strcmp(arg[iarg],"adof") == 0) {
|
||||||
if (iarg+2 > narg)
|
if (iarg+2 > narg)
|
||||||
@ -220,31 +216,23 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
} else if (strcmp(arg[iarg],"format") == 0) {
|
} else if (strcmp(arg[iarg],"format") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command");
|
||||||
delete [] format_user;
|
delete [] format_user;
|
||||||
int n = strlen(arg[iarg+1]) + 2;
|
format_user = utils::strdup(arg[iarg+1]);
|
||||||
format_user = new char[n];
|
|
||||||
sprintf(format_user," %s",arg[iarg+1]);
|
|
||||||
format = format_user;
|
format = format_user;
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"title1") == 0) {
|
} else if (strcmp(arg[iarg],"title1") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command");
|
||||||
delete [] title1;
|
delete [] title1;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title1 = utils::strdup(arg[iarg+1]);
|
||||||
title1 = new char[n];
|
|
||||||
strcpy(title1,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"title2") == 0) {
|
} else if (strcmp(arg[iarg],"title2") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command");
|
||||||
delete [] title2;
|
delete [] title2;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title2 = utils::strdup(arg[iarg+1]);
|
||||||
title2 = new char[n];
|
|
||||||
strcpy(title2,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"title3") == 0) {
|
} else if (strcmp(arg[iarg],"title3") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command");
|
||||||
delete [] title3;
|
delete [] title3;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title3 = utils::strdup(arg[iarg+1]);
|
||||||
title3 = new char[n];
|
|
||||||
strcpy(title3,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal fix ave/chunk command");
|
} else error->all(FLERR,"Illegal fix ave/chunk command");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,23 +139,17 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
|
|||||||
} else if (strcmp(arg[iarg],"title1") == 0) {
|
} else if (strcmp(arg[iarg],"title1") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
|
||||||
delete [] title1;
|
delete [] title1;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title1 = utils::strdup(arg[iarg+1]);
|
||||||
title1 = new char[n];
|
|
||||||
strcpy(title1,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"title2") == 0) {
|
} else if (strcmp(arg[iarg],"title2") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
|
||||||
delete [] title2;
|
delete [] title2;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title2 = utils::strdup(arg[iarg+1]);
|
||||||
title2 = new char[n];
|
|
||||||
strcpy(title2,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"title3") == 0) {
|
} else if (strcmp(arg[iarg],"title3") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
|
||||||
delete [] title3;
|
delete [] title3;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title3 = utils::strdup(arg[iarg+1]);
|
||||||
title3 = new char[n];
|
|
||||||
strcpy(title3,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal fix ave/correlate command");
|
} else error->all(FLERR,"Illegal fix ave/correlate command");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -993,23 +993,17 @@ void FixAveHisto::options(int iarg, int narg, char **arg)
|
|||||||
} else if (strcmp(arg[iarg],"title1") == 0) {
|
} else if (strcmp(arg[iarg],"title1") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
|
||||||
delete [] title1;
|
delete [] title1;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title1 = utils::strdup(arg[iarg+1]);
|
||||||
title1 = new char[n];
|
|
||||||
strcpy(title1,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"title2") == 0) {
|
} else if (strcmp(arg[iarg],"title2") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
|
||||||
delete [] title2;
|
delete [] title2;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title2 = utils::strdup(arg[iarg+1]);
|
||||||
title2 = new char[n];
|
|
||||||
strcpy(title2,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"title3") == 0) {
|
} else if (strcmp(arg[iarg],"title3") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
|
||||||
delete [] title3;
|
delete [] title3;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title3 = utils::strdup(arg[iarg+1]);
|
||||||
title3 = new char[n];
|
|
||||||
strcpy(title3,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal fix ave/histo command");
|
} else error->all(FLERR,"Illegal fix ave/histo command");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1067,31 +1067,23 @@ void FixAveTime::options(int iarg, int narg, char **arg)
|
|||||||
} else if (strcmp(arg[iarg],"format") == 0) {
|
} else if (strcmp(arg[iarg],"format") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
|
||||||
delete [] format_user;
|
delete [] format_user;
|
||||||
int n = strlen(arg[iarg+1]) + 2;
|
format_user = utils::strdup(arg[iarg+1]);
|
||||||
format_user = new char[n];
|
|
||||||
sprintf(format_user," %s",arg[iarg+1]);
|
|
||||||
format = format_user;
|
format = format_user;
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"title1") == 0) {
|
} else if (strcmp(arg[iarg],"title1") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
|
||||||
delete [] title1;
|
delete [] title1;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title1 = utils::strdup(arg[iarg+1]);
|
||||||
title1 = new char[n];
|
|
||||||
strcpy(title1,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"title2") == 0) {
|
} else if (strcmp(arg[iarg],"title2") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
|
||||||
delete [] title2;
|
delete [] title2;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title2 = utils::strdup(arg[iarg+1]);
|
||||||
title2 = new char[n];
|
|
||||||
strcpy(title2,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"title3") == 0) {
|
} else if (strcmp(arg[iarg],"title3") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
|
||||||
delete [] title3;
|
delete [] title3;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
title3 = utils::strdup(arg[iarg+1]);
|
||||||
title3 = new char[n];
|
|
||||||
strcpy(title3,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal fix ave/time command");
|
} else error->all(FLERR,"Illegal fix ave/time command");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -761,9 +761,7 @@ int FixBoxRelax::modify_param(int narg, char **arg)
|
|||||||
tflag = 0;
|
tflag = 0;
|
||||||
}
|
}
|
||||||
delete [] id_temp;
|
delete [] id_temp;
|
||||||
int n = strlen(arg[1]) + 1;
|
id_temp = utils::strdup(arg[1]);
|
||||||
id_temp = new char[n];
|
|
||||||
strcpy(id_temp,arg[1]);
|
|
||||||
|
|
||||||
int icompute = modify->find_compute(arg[1]);
|
int icompute = modify->find_compute(arg[1]);
|
||||||
if (icompute < 0)
|
if (icompute < 0)
|
||||||
@ -792,9 +790,7 @@ int FixBoxRelax::modify_param(int narg, char **arg)
|
|||||||
pflag = 0;
|
pflag = 0;
|
||||||
}
|
}
|
||||||
delete [] id_press;
|
delete [] id_press;
|
||||||
int n = strlen(arg[1]) + 1;
|
id_press = utils::strdup(arg[1]);
|
||||||
id_press = new char[n];
|
|
||||||
strcpy(id_press,arg[1]);
|
|
||||||
|
|
||||||
int icompute = modify->find_compute(arg[1]);
|
int icompute = modify->find_compute(arg[1]);
|
||||||
if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
|
if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
|
||||||
|
|||||||
@ -67,9 +67,7 @@ FixController::FixController(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
// control variable arg
|
// control variable arg
|
||||||
|
|
||||||
int n = strlen(arg[iarg]) + 1;
|
cvID = utils::strdup(arg[iarg]);
|
||||||
cvID = new char[n];
|
|
||||||
strcpy(cvID,arg[iarg]);
|
|
||||||
|
|
||||||
// error check
|
// error check
|
||||||
|
|
||||||
|
|||||||
@ -126,12 +126,8 @@ rfix(nullptr), irregular(nullptr), set(nullptr)
|
|||||||
error->all(FLERR,"Illegal fix deform command");
|
error->all(FLERR,"Illegal fix deform command");
|
||||||
delete [] set[index].hstr;
|
delete [] set[index].hstr;
|
||||||
delete [] set[index].hratestr;
|
delete [] set[index].hratestr;
|
||||||
int n = strlen(&arg[iarg+2][2]) + 1;
|
set[index].hstr = utils::strdup(&arg[iarg+2][2]);
|
||||||
set[index].hstr = new char[n];
|
set[index].hratestr = utils::strdup(&arg[iarg+3][2]);
|
||||||
strcpy(set[index].hstr,&arg[iarg+2][2]);
|
|
||||||
n = strlen(&arg[iarg+3][2]) + 1;
|
|
||||||
set[index].hratestr = new char[n];
|
|
||||||
strcpy(set[index].hratestr,&arg[iarg+3][2]);
|
|
||||||
iarg += 4;
|
iarg += 4;
|
||||||
} else error->all(FLERR,"Illegal fix deform command");
|
} else error->all(FLERR,"Illegal fix deform command");
|
||||||
|
|
||||||
@ -188,12 +184,8 @@ rfix(nullptr), irregular(nullptr), set(nullptr)
|
|||||||
error->all(FLERR,"Illegal fix deform command");
|
error->all(FLERR,"Illegal fix deform command");
|
||||||
delete [] set[index].hstr;
|
delete [] set[index].hstr;
|
||||||
delete [] set[index].hratestr;
|
delete [] set[index].hratestr;
|
||||||
int n = strlen(&arg[iarg+2][2]) + 1;
|
set[index].hstr = utils::strdup(&arg[iarg+2][2]);
|
||||||
set[index].hstr = new char[n];
|
set[index].hratestr = utils::strdup(&arg[iarg+3][2]);
|
||||||
strcpy(set[index].hstr,&arg[iarg+2][2]);
|
|
||||||
n = strlen(&arg[iarg+3][2]) + 1;
|
|
||||||
set[index].hratestr = new char[n];
|
|
||||||
strcpy(set[index].hratestr,&arg[iarg+3][2]);
|
|
||||||
iarg += 4;
|
iarg += 4;
|
||||||
} else error->all(FLERR,"Illegal fix deform command");
|
} else error->all(FLERR,"Illegal fix deform command");
|
||||||
|
|
||||||
|
|||||||
@ -39,12 +39,9 @@ idregion(nullptr), idvar(nullptr), idprop(nullptr)
|
|||||||
// dgroupbit = bitmask of dynamic group
|
// dgroupbit = bitmask of dynamic group
|
||||||
// group ID is last part of fix ID
|
// group ID is last part of fix ID
|
||||||
|
|
||||||
int n = strlen(id) - strlen("GROUP_") + 1;
|
auto dgroupid = std::string(id).substr(strlen("GROUP_"));
|
||||||
char *dgroup = new char[n];
|
gbit = group->bitmask[group->find(dgroupid)];
|
||||||
strcpy(dgroup,&id[strlen("GROUP_")]);
|
gbitinverse = group->inversemask[group->find(dgroupid)];
|
||||||
gbit = group->bitmask[group->find(dgroup)];
|
|
||||||
gbitinverse = group->inversemask[group->find(dgroup)];
|
|
||||||
delete [] dgroup;
|
|
||||||
|
|
||||||
// process optional args
|
// process optional args
|
||||||
|
|
||||||
@ -61,9 +58,7 @@ idregion(nullptr), idvar(nullptr), idprop(nullptr)
|
|||||||
error->all(FLERR,"Region ID for group dynamic does not exist");
|
error->all(FLERR,"Region ID for group dynamic does not exist");
|
||||||
regionflag = 1;
|
regionflag = 1;
|
||||||
delete [] idregion;
|
delete [] idregion;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
idregion = utils::strdup(arg[iarg+1]);
|
||||||
idregion = new char[n];
|
|
||||||
strcpy(idregion,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"var") == 0) {
|
} else if (strcmp(arg[iarg],"var") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal group command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal group command");
|
||||||
@ -71,9 +66,7 @@ idregion(nullptr), idvar(nullptr), idprop(nullptr)
|
|||||||
error->all(FLERR,"Variable name for group dynamic does not exist");
|
error->all(FLERR,"Variable name for group dynamic does not exist");
|
||||||
varflag = 1;
|
varflag = 1;
|
||||||
delete [] idvar;
|
delete [] idvar;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
idvar = utils::strdup(arg[iarg+1]);
|
||||||
idvar = new char[n];
|
|
||||||
strcpy(idvar,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"property") == 0) {
|
} else if (strcmp(arg[iarg],"property") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal group command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal group command");
|
||||||
@ -81,9 +74,7 @@ idregion(nullptr), idvar(nullptr), idprop(nullptr)
|
|||||||
error->all(FLERR,"Per atom property for group dynamic does not exist");
|
error->all(FLERR,"Per atom property for group dynamic does not exist");
|
||||||
propflag = 1;
|
propflag = 1;
|
||||||
delete [] idprop;
|
delete [] idprop;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
idprop = utils::strdup(arg[iarg+1]);
|
||||||
idprop = new char[n];
|
|
||||||
strcpy(idprop,arg[iarg+1]);
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"every") == 0) {
|
} else if (strcmp(arg[iarg],"every") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal group command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal group command");
|
||||||
@ -123,7 +114,7 @@ void FixGroup::init()
|
|||||||
if (group->dynamic[igroup])
|
if (group->dynamic[igroup])
|
||||||
error->all(FLERR,"Group dynamic parent group cannot be dynamic");
|
error->all(FLERR,"Group dynamic parent group cannot be dynamic");
|
||||||
|
|
||||||
if (strstr(update->integrate_style,"respa"))
|
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||||
nlevels_respa = ((Respa *) update->integrate)->nlevels;
|
nlevels_respa = ((Respa *) update->integrate)->nlevels;
|
||||||
|
|
||||||
// set current indices for region and variable
|
// set current indices for region and variable
|
||||||
|
|||||||
@ -275,9 +275,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
else {
|
else {
|
||||||
allremap = 0;
|
allremap = 0;
|
||||||
delete [] id_dilate;
|
delete [] id_dilate;
|
||||||
int n = strlen(arg[iarg+1]) + 1;
|
id_dilate = utils::strdup(arg[iarg+1]);
|
||||||
id_dilate = new char[n];
|
|
||||||
strcpy(id_dilate,arg[iarg+1]);
|
|
||||||
int idilate = group->find(id_dilate);
|
int idilate = group->find(id_dilate);
|
||||||
if (idilate == -1)
|
if (idilate == -1)
|
||||||
error->all(FLERR,"Fix nvt/npt/nph dilate group ID does not exist");
|
error->all(FLERR,"Fix nvt/npt/nph dilate group ID does not exist");
|
||||||
@ -1414,9 +1412,7 @@ int FixNH::modify_param(int narg, char **arg)
|
|||||||
tcomputeflag = 0;
|
tcomputeflag = 0;
|
||||||
}
|
}
|
||||||
delete [] id_temp;
|
delete [] id_temp;
|
||||||
int n = strlen(arg[1]) + 1;
|
id_temp = utils::strdup(arg[1]);
|
||||||
id_temp = new char[n];
|
|
||||||
strcpy(id_temp,arg[1]);
|
|
||||||
|
|
||||||
int icompute = modify->find_compute(arg[1]);
|
int icompute = modify->find_compute(arg[1]);
|
||||||
if (icompute < 0)
|
if (icompute < 0)
|
||||||
@ -1448,9 +1444,7 @@ int FixNH::modify_param(int narg, char **arg)
|
|||||||
pcomputeflag = 0;
|
pcomputeflag = 0;
|
||||||
}
|
}
|
||||||
delete [] id_press;
|
delete [] id_press;
|
||||||
int n = strlen(arg[1]) + 1;
|
id_press = utils::strdup(arg[1]);
|
||||||
id_press = new char[n];
|
|
||||||
strcpy(id_press,arg[1]);
|
|
||||||
|
|
||||||
int icompute = modify->find_compute(arg[1]);
|
int icompute = modify->find_compute(arg[1]);
|
||||||
if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
|
if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
|
||||||
|
|||||||
@ -467,9 +467,7 @@ int FixPressBerendsen::modify_param(int narg, char **arg)
|
|||||||
tflag = 0;
|
tflag = 0;
|
||||||
}
|
}
|
||||||
delete [] id_temp;
|
delete [] id_temp;
|
||||||
int n = strlen(arg[1]) + 1;
|
id_temp = utils::strdup(arg[1]);
|
||||||
id_temp = new char[n];
|
|
||||||
strcpy(id_temp,arg[1]);
|
|
||||||
|
|
||||||
int icompute = modify->find_compute(arg[1]);
|
int icompute = modify->find_compute(arg[1]);
|
||||||
if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
|
if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
|
||||||
@ -496,9 +494,7 @@ int FixPressBerendsen::modify_param(int narg, char **arg)
|
|||||||
pflag = 0;
|
pflag = 0;
|
||||||
}
|
}
|
||||||
delete [] id_press;
|
delete [] id_press;
|
||||||
int n = strlen(arg[1]) + 1;
|
id_press = utils::strdup(arg[1]);
|
||||||
id_press = new char[n];
|
|
||||||
strcpy(id_press,arg[1]);
|
|
||||||
|
|
||||||
int icompute = modify->find_compute(arg[1]);
|
int icompute = modify->find_compute(arg[1]);
|
||||||
if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
|
if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
|
||||||
|
|||||||
@ -70,9 +70,7 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (narg != 10) error->all(FLERR,"Illegal fix spring command");
|
if (narg != 10) error->all(FLERR,"Illegal fix spring command");
|
||||||
styleflag = COUPLE;
|
styleflag = COUPLE;
|
||||||
|
|
||||||
int n = strlen(arg[4]) + 1;
|
group2 = utils::strdup(arg[4]);
|
||||||
group2 = new char[n];
|
|
||||||
strcpy(group2,arg[4]);
|
|
||||||
igroup2 = group->find(arg[4]);
|
igroup2 = group->find(arg[4]);
|
||||||
if (igroup2 == -1)
|
if (igroup2 == -1)
|
||||||
error->all(FLERR,"Fix spring couple group ID does not exist");
|
error->all(FLERR,"Fix spring couple group ID does not exist");
|
||||||
|
|||||||
@ -49,13 +49,8 @@ FixSpringChunk::FixSpringChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
k_spring = utils::numeric(FLERR,arg[3],false,lmp);
|
k_spring = utils::numeric(FLERR,arg[3],false,lmp);
|
||||||
|
|
||||||
int n = strlen(arg[4]) + 1;
|
idchunk = utils::strdup(arg[4]);
|
||||||
idchunk = new char[n];
|
idcom = utils::strdup(arg[5]);
|
||||||
strcpy(idchunk,arg[4]);
|
|
||||||
|
|
||||||
n = strlen(arg[5]) + 1;
|
|
||||||
idcom = new char[n];
|
|
||||||
strcpy(idcom,arg[5]);
|
|
||||||
|
|
||||||
esprings = 0.0;
|
esprings = 0.0;
|
||||||
nchunk = 0;
|
nchunk = 0;
|
||||||
|
|||||||
@ -205,9 +205,7 @@ int FixTempBerendsen::modify_param(int narg, char **arg)
|
|||||||
tflag = 0;
|
tflag = 0;
|
||||||
}
|
}
|
||||||
delete [] id_temp;
|
delete [] id_temp;
|
||||||
int n = strlen(arg[1]) + 1;
|
id_temp = utils::strdup(arg[1]);
|
||||||
id_temp = new char[n];
|
|
||||||
strcpy(id_temp,arg[1]);
|
|
||||||
|
|
||||||
int icompute = modify->find_compute(id_temp);
|
int icompute = modify->find_compute(id_temp);
|
||||||
if (icompute < 0)
|
if (icompute < 0)
|
||||||
|
|||||||
@ -261,9 +261,7 @@ int FixTempCSLD::modify_param(int narg, char **arg)
|
|||||||
tflag = 0;
|
tflag = 0;
|
||||||
}
|
}
|
||||||
delete [] id_temp;
|
delete [] id_temp;
|
||||||
int n = strlen(arg[1]) + 1;
|
id_temp = utils::strdup(arg[1]);
|
||||||
id_temp = new char[n];
|
|
||||||
strcpy(id_temp,arg[1]);
|
|
||||||
|
|
||||||
int icompute = modify->find_compute(id_temp);
|
int icompute = modify->find_compute(id_temp);
|
||||||
if (icompute < 0)
|
if (icompute < 0)
|
||||||
|
|||||||
@ -216,9 +216,7 @@ int FixTempCSVR::modify_param(int narg, char **arg)
|
|||||||
tflag = 0;
|
tflag = 0;
|
||||||
}
|
}
|
||||||
delete [] id_temp;
|
delete [] id_temp;
|
||||||
int n = strlen(arg[1]) + 1;
|
id_temp = utils::strdup(arg[1]);
|
||||||
id_temp = new char[n];
|
|
||||||
strcpy(id_temp,arg[1]);
|
|
||||||
|
|
||||||
int icompute = modify->find_compute(id_temp);
|
int icompute = modify->find_compute(id_temp);
|
||||||
if (icompute < 0)
|
if (icompute < 0)
|
||||||
|
|||||||
@ -202,9 +202,7 @@ int FixTempRescale::modify_param(int narg, char **arg)
|
|||||||
tflag = 0;
|
tflag = 0;
|
||||||
}
|
}
|
||||||
delete [] id_temp;
|
delete [] id_temp;
|
||||||
int n = strlen(arg[1]) + 1;
|
id_temp = utils::strdup(arg[1]);
|
||||||
id_temp = new char[n];
|
|
||||||
strcpy(id_temp,arg[1]);
|
|
||||||
|
|
||||||
int icompute = modify->find_compute(id_temp);
|
int icompute = modify->find_compute(id_temp);
|
||||||
if (icompute < 0)
|
if (icompute < 0)
|
||||||
|
|||||||
@ -54,9 +54,7 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
iregion = domain->find_region(arg[3]);
|
iregion = domain->find_region(arg[3]);
|
||||||
if (iregion == -1)
|
if (iregion == -1)
|
||||||
error->all(FLERR,"Region ID for fix wall/region does not exist");
|
error->all(FLERR,"Region ID for fix wall/region does not exist");
|
||||||
int n = strlen(arg[3]) + 1;
|
idregion = utils::strdup(arg[3]);
|
||||||
idregion = new char[n];
|
|
||||||
strcpy(idregion,arg[3]);
|
|
||||||
|
|
||||||
if (strcmp(arg[4],"lj93") == 0) style = LJ93;
|
if (strcmp(arg[4],"lj93") == 0) style = LJ93;
|
||||||
else if (strcmp(arg[4],"lj126") == 0) style = LJ126;
|
else if (strcmp(arg[4],"lj126") == 0) style = LJ126;
|
||||||
|
|||||||
Reference in New Issue
Block a user