write_data: directly replace types w labels

allow direct replacement of numeric atom types in Atoms sections with type labels, using new keyword
This commit is contained in:
Jacob Gissinger
2021-11-05 23:03:55 -04:00
parent 9952526724
commit a7a8581662
4 changed files with 23 additions and 3 deletions

View File

@ -73,6 +73,7 @@ void WriteData::command(int narg, char **arg)
coeffflag = 1;
fixflag = 1;
lmapflag = 1;
atom->types_style = Atom::NUMERIC;
int noinit = 0;
int iarg = 1;
@ -95,6 +96,12 @@ void WriteData::command(int narg, char **arg)
} else if (strcmp(arg[iarg],"nolabelmap") == 0) {
lmapflag = 0;
iarg++;
} else if (strcmp(arg[iarg],"types_style") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal write_data command");
if (strcmp(arg[iarg+1],"numeric") == 0) atom->types_style = Atom::NUMERIC;
else if (strcmp(arg[iarg+1],"labels") == 0) atom->types_style = Atom::LABELS;
else error->all(FLERR,"Illegal write_data command");
iarg += 2;
} else error->all(FLERR,"Illegal write_data command");
}