From d5d8887eb9c0e29ad9fdb7eecd5f9229fe84efc3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 23 Jun 2025 22:49:17 -0400 Subject: [PATCH] improve error messages --- src/REAXFF/fix_reaxff_bonds.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/REAXFF/fix_reaxff_bonds.cpp b/src/REAXFF/fix_reaxff_bonds.cpp index 955d5a1bd7..86443da43b 100644 --- a/src/REAXFF/fix_reaxff_bonds.cpp +++ b/src/REAXFF/fix_reaxff_bonds.cpp @@ -85,6 +85,9 @@ int FixReaxFFBonds::setmask() void FixReaxFFBonds::setup(int /*vflag*/) { + if (atom->natoms > MAXSMALLINT) + error->all(FLERR, Error::NOLASTLINE, "Too many atoms for fix {}", style); + // only print output during setup() at the very beginning // to avoid duplicate outputs when using multiple run statements if (first_flag) end_of_step(); @@ -96,8 +99,9 @@ void FixReaxFFBonds::setup(int /*vflag*/) void FixReaxFFBonds::init() { reaxff = dynamic_cast(force->pair_match("^reax..",0)); - if (reaxff == nullptr) error->all(FLERR,"Cannot use fix reaxff/bonds without " - "pair_style reaxff, reaxff/kk, or reaxff/omp"); + if (reaxff == nullptr) + error->all(FLERR, Error::NOLASTLINE, "Cannot use fix reaxff/bonds without " + "pair_style reaxff, reaxff/kk, or reaxff/omp"); } /* ---------------------------------------------------------------------- */ @@ -118,7 +122,7 @@ void FixReaxFFBonds::Output_ReaxFF_Bonds() double *buf; int nlocal = atom->nlocal; - int nlocal_tot = static_cast (atom->natoms); + int nlocal_tot = static_cast(atom->natoms); if (atom->nmax > nmax) { destroy();