From c68ea4fe1e8c409daf26d8b99c2359cea0e8dbfa Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Thu, 15 Aug 2024 19:09:16 -0400 Subject: [PATCH] better place for error check --- src/REACTION/fix_bond_react.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/REACTION/fix_bond_react.cpp b/src/REACTION/fix_bond_react.cpp index f2968a2001..ab9f734a8d 100644 --- a/src/REACTION/fix_bond_react.cpp +++ b/src/REACTION/fix_bond_react.cpp @@ -486,10 +486,6 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : get_molxspecials(); read_map_file(i); fclose(fp); - if (ncreate == 0 && onemol->natoms != twomol->natoms) - error->all(FLERR,"Fix bond/react: Reaction templates must contain the same number of atoms"); - else if (ncreate > 0 && onemol->natoms + ncreate != twomol->natoms) - error->all(FLERR,"Fix bond/react: Incorrect number of created atoms"); iatomtype[i] = onemol->type[ibonding[i]-1]; jatomtype[i] = onemol->type[jbonding[i]-1]; find_landlocked_atoms(i); @@ -3967,6 +3963,11 @@ void FixBondReact::read_map_file(int myrxn) } else break; } + if (ncreate == 0 && onemol->natoms != twomol->natoms) + error->all(FLERR,"Fix bond/react: Reaction templates must contain the same number of atoms"); + else if (ncreate > 0 && onemol->natoms + ncreate != twomol->natoms) + error->all(FLERR,"Fix bond/react: Incorrect number of created atoms"); + // grab keyword and skip next line parse_keyword(0,line,keyword);