From c115cdb18da5bfb632cd6f17566f808ee72c17b4 Mon Sep 17 00:00:00 2001 From: Sieds Lykles <93992551+S-Lykles@users.noreply.github.com> Date: Tue, 20 Feb 2024 00:55:15 +0100 Subject: [PATCH] Move check to be with other checks --- src/create_atoms.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();