diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index b8c2146d7b..578ce999f5 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -183,8 +183,6 @@ void CreateAtoms::command(int narg, char **arg) "Only the first set will be used."); mode = MOLECULE; onemol = atom->molecules[imol]; - if (atom->molecular == Atom::TEMPLATE && onemol != atom->avec->onemols[0]) - error->all(FLERR, "create_atoms molecule template ID must be same as atom style template ID"); molseed = utils::inumeric(FLERR, arg[iarg + 2], false, lmp); iarg += 3; } else if (strcmp(arg[iarg], "units") == 0) { @@ -303,6 +301,8 @@ void CreateAtoms::command(int narg, char **arg) error->all(FLERR, "Invalid atom type in create_atoms mol command"); if (onemol->tag_require && !atom->tag_enable) error->all(FLERR, "Create_atoms molecule has atom IDs, but system does not"); + if (atom->molecular == Atom::TEMPLATE && onemol != atom->avec->onemols[0]) + error->all(FLERR, "Create_atoms molecule template ID must be same as atom style template ID"); onemol->check_attributes();