create_atoms: direct type label support
This commit is contained in:
@ -89,7 +89,9 @@ void CreateAtoms::command(int narg, char **arg)
|
||||
// parse arguments
|
||||
|
||||
if (narg < 2) utils::missing_cmd_args(FLERR, "create_atoms", error);
|
||||
ntype = utils::inumeric(FLERR, arg[0], false, lmp);
|
||||
char *typestr = utils::expand_type(FLERR, arg[0], Atom::ATOM, lmp);
|
||||
ntype = utils::inumeric(FLERR, typestr?typestr:arg[0], false, lmp);
|
||||
delete[] typestr;
|
||||
|
||||
const char *meshfile;
|
||||
int iarg;
|
||||
@ -163,7 +165,9 @@ void CreateAtoms::command(int narg, char **arg)
|
||||
if (strcmp(arg[iarg], "basis") == 0) {
|
||||
if (iarg + 3 > narg) utils::missing_cmd_args(FLERR, "create_atoms basis", error);
|
||||
int ibasis = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
||||
int itype = utils::inumeric(FLERR, arg[iarg + 2], false, lmp);
|
||||
char *typestr = utils::expand_type(FLERR, arg[iarg + 2], Atom::ATOM, lmp);
|
||||
int itype = utils::inumeric(FLERR, typestr?typestr:arg[iarg + 2], false, lmp);
|
||||
delete[] typestr;
|
||||
if (ibasis <= 0 || ibasis > nbasis || itype <= 0 || itype > atom->ntypes)
|
||||
error->all(FLERR, "Out of range basis setting '{} {}' in create_atoms command", ibasis,
|
||||
itype);
|
||||
|
||||
Reference in New Issue
Block a user