Merge conflicts

This commit is contained in:
jtclemm
2024-06-24 14:09:33 -06:00
2229 changed files with 152287 additions and 82970 deletions

View File

@ -52,8 +52,6 @@ enum{TYPE,TYPE_FRACTION,TYPE_RATIO,TYPE_SUBSET,
RHEO_STATUS,SPH_E,SPH_CV,SPH_RHO,EDPD_TEMP,EDPD_CV,CC,SMD_MASS_DENSITY,
SMD_CONTACT_RADIUS,DPDTHETA,EPSILON,IVEC,DVEC,IARRAY,DARRAY};
#define BIG INT_MAX
/* ---------------------------------------------------------------------- */
void Set::command(int narg, char **arg)
@ -92,22 +90,16 @@ void Set::command(int narg, char **arg)
if (strcmp(arg[iarg],"type") == 0) {
if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "set type", error);
if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1);
else {
char *typestr = utils::expand_type(FLERR,arg[iarg+1],Atom::ATOM,lmp);
ivalue = utils::inumeric(FLERR,typestr?typestr:arg[iarg+1],false,lmp);
delete[] typestr;
}
if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1], 1);
else ivalue = utils::expand_type_int(FLERR, arg[iarg+1], Atom::ATOM, lmp);
set(TYPE);
iarg += 2;
} else if (strcmp(arg[iarg],"type/fraction") == 0) {
if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "set type/fraction", error);
char *typestr = utils::expand_type(FLERR,arg[iarg+1],Atom::ATOM,lmp);
newtype = utils::inumeric(FLERR,typestr?typestr:arg[iarg+1],false,lmp);
delete[] typestr;
fraction = utils::numeric(FLERR,arg[iarg+2],false,lmp);
ivalue = utils::inumeric(FLERR,arg[iarg+3],false,lmp);
newtype = utils::expand_type_int(FLERR, arg[iarg+1], Atom::ATOM, lmp);
fraction = utils::numeric(FLERR, arg[iarg+2], false, lmp);
ivalue = utils::inumeric(FLERR, arg[iarg+3], false, lmp);
if (newtype <= 0 || newtype > atom->ntypes)
error->all(FLERR,"Invalid type value {} in set type/fraction command", newtype);
if (fraction < 0.0 || fraction > 1.0)
@ -119,11 +111,9 @@ void Set::command(int narg, char **arg)
} else if (strcmp(arg[iarg],"type/ratio") == 0) {
if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "set type/ratio", error);
char *typestr = utils::expand_type(FLERR,arg[iarg+1],Atom::ATOM,lmp);
newtype = utils::inumeric(FLERR,typestr?typestr:arg[iarg+1],false,lmp);
delete[] typestr;
fraction = utils::numeric(FLERR,arg[iarg+2],false,lmp);
ivalue = utils::inumeric(FLERR,arg[iarg+3],false,lmp);
newtype = utils::expand_type_int(FLERR, arg[iarg+1], Atom::ATOM, lmp);
fraction = utils::numeric(FLERR, arg[iarg+2], false, lmp);
ivalue = utils::inumeric(FLERR, arg[iarg+3], false, lmp);
if (newtype <= 0 || newtype > atom->ntypes)
error->all(FLERR,"Invalid type value {} in set type/ratio command", newtype);
if (fraction < 0.0 || fraction > 1.0)
@ -135,11 +125,9 @@ void Set::command(int narg, char **arg)
} else if (strcmp(arg[iarg],"type/subset") == 0) {
if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "set type/subset", error);
char *typestr = utils::expand_type(FLERR,arg[iarg+1],Atom::ATOM,lmp);
newtype = utils::inumeric(FLERR,typestr?typestr:arg[iarg+1],false,lmp);
delete[] typestr;
nsubset = utils::bnumeric(FLERR,arg[iarg+2],false,lmp);
ivalue = utils::inumeric(FLERR,arg[iarg+3],false,lmp);
newtype = utils::expand_type_int(FLERR, arg[iarg+1], Atom::ATOM, lmp);
nsubset = utils::bnumeric(FLERR, arg[iarg+2], false, lmp);
ivalue = utils::inumeric(FLERR, arg[iarg+3], false, lmp);
if (newtype <= 0 || newtype > atom->ntypes)
error->all(FLERR,"Invalid type value {} in set type/subset command", newtype);
if (nsubset < 0)
@ -487,9 +475,7 @@ void Set::command(int narg, char **arg)
} else if (strcmp(arg[iarg],"bond") == 0) {
if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "set bond", error);
char *typestr = utils::expand_type(FLERR,arg[iarg+1],Atom::BOND,lmp);
ivalue = utils::inumeric(FLERR,typestr?typestr:arg[iarg+1],false,lmp);
delete[] typestr;
ivalue = utils::expand_type_int(FLERR, arg[iarg+1], Atom::BOND, lmp);
if (atom->avec->bonds_allow == 0)
error->all(FLERR,"Cannot set attribute {} for atom style {}", arg[iarg], atom->get_style());
if (ivalue <= 0 || ivalue > atom->nbondtypes)
@ -499,9 +485,7 @@ void Set::command(int narg, char **arg)
} else if (strcmp(arg[iarg],"angle") == 0) {
if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "set angle", error);
char *typestr = utils::expand_type(FLERR,arg[iarg+1],Atom::ANGLE,lmp);
ivalue = utils::inumeric(FLERR,typestr?typestr:arg[iarg+1],false,lmp);
delete[] typestr;
ivalue = utils::expand_type_int(FLERR, arg[iarg+1], Atom::ANGLE, lmp);
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Cannot set attribute {} for atom style {}", arg[iarg], atom->get_style());
if (ivalue <= 0 || ivalue > atom->nangletypes)
@ -511,9 +495,7 @@ void Set::command(int narg, char **arg)
} else if (strcmp(arg[iarg],"dihedral") == 0) {
if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "set dihedral", error);
char *typestr = utils::expand_type(FLERR,arg[iarg+1],Atom::DIHEDRAL,lmp);
ivalue = utils::inumeric(FLERR,typestr?typestr:arg[iarg+1],false,lmp);
delete[] typestr;
ivalue = utils::expand_type_int(FLERR, arg[iarg+1], Atom::DIHEDRAL, lmp);
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Cannot set attribute {} for atom style {}", arg[iarg], atom->get_style());
if (ivalue <= 0 || ivalue > atom->ndihedraltypes)
@ -523,9 +505,7 @@ void Set::command(int narg, char **arg)
} else if (strcmp(arg[iarg],"improper") == 0) {
if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "set improper", error);
char *typestr = utils::expand_type(FLERR,arg[iarg+1],Atom::IMPROPER,lmp);
ivalue = utils::inumeric(FLERR,typestr?typestr:arg[iarg+1],false,lmp);
delete[] typestr;
ivalue = utils::expand_type_int(FLERR, arg[iarg+1], Atom::IMPROPER, lmp);
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Cannot set attribute {} for atom style {}", arg[iarg], atom->get_style());
if (ivalue <= 0 || ivalue > atom->nimpropertypes)
@ -778,11 +758,7 @@ void Set::selection(int n)
else select[i] = 0;
} else if (style == TYPE_SELECT) {
if (char *typestr = utils::expand_type(FLERR,id,Atom::ATOM,lmp)) {
delete[] id;
id = typestr;
}
utils::bounds(FLERR,id,1,atom->ntypes,nlo,nhi,error);
utils::bounds_typelabel(FLERR,id,1,atom->ntypes,nlo,nhi,error,lmp,Atom::ATOM);
int *type = atom->type;
for (int i = 0; i < n; i++)