basic support for auxiliary label maps

can be created with labelmap via mapID keyword
referenced like mymapID::C
where C is an atom type, for example
This commit is contained in:
Jacob Gissinger
2021-01-29 22:38:33 -05:00
parent 8e255f619b
commit f6fe554b47
3 changed files with 45 additions and 6 deletions

View File

@ -1592,10 +1592,26 @@ void Input::kspace_style()
void Input::labelmap()
{
if (narg < 2 || (narg % 2 == 0)) error->all(FLERR,"Illegal labelmap command");
if (domain->box_exist == 0)
error->all(FLERR,"Labelmap command before simulation box is defined");
if (!atom->labelmapflag) atom->add_label_map();
atom->lmaps[0]->modify_lmap(narg,arg);
int ilmap = 0;
std::string mapid;
for (int i = 1; i < narg; i++) {
if (strcmp(arg[i],"mapID") == 0) {
mapid = arg[i+1];
ilmap = atom->find_labelmap(mapid);
if (ilmap == -1) ilmap = atom->add_label_map(mapid);
if (narg > i+2) error->all(FLERR,"Illegal labelmap command");
narg = i - 2;
break;
}
i++;
}
atom->lmaps[ilmap]->modify_lmap(narg,arg);
}
/* ---------------------------------------------------------------------- */