enforce unique labels when using labelmap command

This commit is contained in:
Jacob Gissinger
2021-11-15 23:24:57 -05:00
parent 5bc399c22b
commit c4330298e1
2 changed files with 11 additions and 9 deletions

View File

@ -101,6 +101,8 @@ void LabelMap::modify_lmap(int narg, char **arg)
std::string slabel(arg[iarg++]);
if (isdigit(slabel[0]))
error->all(FLERR,"Type labels cannot start with a number");
if (search(slabel,(*labels),ntypes) != -1)
error->all(FLERR,"Type label already exists: types labels must be unique");
(*labels)[itype-1] = slabel;
}
}