finish rolling back multiple maps feature
This commit is contained in:
@ -2060,14 +2060,13 @@ void Atom::add_molecule_atom(Molecule *onemol, int iatom, int ilocal, tagint off
|
|||||||
allocate space for type label map
|
allocate space for type label map
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void Atom::add_label_map(const std::string &mapID)
|
void Atom::add_label_map()
|
||||||
{
|
{
|
||||||
labelmapflag = 1;
|
labelmapflag = 1;
|
||||||
lmap = (LabelMap *)
|
lmap = (LabelMap *)
|
||||||
memory->srealloc(lmap,sizeof(LabelMap *),
|
memory->srealloc(lmap,sizeof(LabelMap *),
|
||||||
"atom::lmap");
|
"atom::lmap");
|
||||||
lmap = new LabelMap(lmp);
|
lmap = new LabelMap(lmp);
|
||||||
if (mapID != "") lmap->id = mapID;
|
|
||||||
lmap->natomtypes = ntypes;
|
lmap->natomtypes = ntypes;
|
||||||
lmap->nbondtypes = nbondtypes;
|
lmap->nbondtypes = nbondtypes;
|
||||||
lmap->nangletypes = nangletypes;
|
lmap->nangletypes = nangletypes;
|
||||||
|
|||||||
@ -355,7 +355,7 @@ class Atom : protected Pointers {
|
|||||||
int find_molecule(char *);
|
int find_molecule(char *);
|
||||||
void add_molecule_atom(class Molecule *, int, int, tagint);
|
void add_molecule_atom(class Molecule *, int, int, tagint);
|
||||||
|
|
||||||
void add_label_map(const std::string &mapID = "");
|
void add_label_map();
|
||||||
|
|
||||||
void first_reorder();
|
void first_reorder();
|
||||||
virtual void sort();
|
virtual void sort();
|
||||||
|
|||||||
@ -1631,20 +1631,6 @@ void Input::labelmap()
|
|||||||
error->all(FLERR,"Labelmap command before simulation box is defined");
|
error->all(FLERR,"Labelmap command before simulation box is defined");
|
||||||
|
|
||||||
if (!atom->labelmapflag) atom->add_label_map();
|
if (!atom->labelmapflag) atom->add_label_map();
|
||||||
|
|
||||||
std::string mapid;
|
|
||||||
for (int i = 1; i < narg; i++) {
|
|
||||||
if (strcmp(arg[i],"mapID") == 0) {
|
|
||||||
mapid = arg[i+1];
|
|
||||||
if (narg > i+2) error->all(FLERR,"Illegal labelmap command");
|
|
||||||
if (atom->lmap->id == "") atom->lmap->id == mapid;
|
|
||||||
else if (atom->lmap->id != mapid)
|
|
||||||
error->all(FLERR,"Labelmap ID {} does not match existing ID {}",mapid,atom->lmap->id);
|
|
||||||
narg = narg - 2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
atom->lmap->modify_lmap(narg,arg);
|
atom->lmap->modify_lmap(narg,arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,6 @@ namespace LAMMPS_NS {
|
|||||||
class LabelMap : protected Pointers {
|
class LabelMap : protected Pointers {
|
||||||
public:
|
public:
|
||||||
int natomtypes,nbondtypes,nangletypes,ndihedraltypes,nimpropertypes;
|
int natomtypes,nbondtypes,nangletypes,ndihedraltypes,nimpropertypes;
|
||||||
std::string id;
|
|
||||||
std::vector<std::string> typelabel,btypelabel,atypelabel;
|
std::vector<std::string> typelabel,btypelabel,atypelabel;
|
||||||
std::vector<std::string> dtypelabel,itypelabel;
|
std::vector<std::string> dtypelabel,itypelabel;
|
||||||
std::unordered_map<std::string, int> typelabel_map;
|
std::unordered_map<std::string, int> typelabel_map;
|
||||||
|
|||||||
Reference in New Issue
Block a user