From 3a4b68a46413ce391e7f3f8bc50659f660a523a7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 9 Oct 2021 11:18:33 -0400 Subject: [PATCH] modernize code --- src/EXTRA-MOLECULE/bond_fene_nm_split.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/EXTRA-MOLECULE/bond_fene_nm_split.cpp b/src/EXTRA-MOLECULE/bond_fene_nm_split.cpp index ff4d4190b3..c3ce5d71f8 100644 --- a/src/EXTRA-MOLECULE/bond_fene_nm_split.cpp +++ b/src/EXTRA-MOLECULE/bond_fene_nm_split.cpp @@ -83,9 +83,8 @@ void BondFENEnmSplit::compute(int eflag, int vflag) // and crash the run if rlogarg < -.21 rather than < -3 // Don't print out warnings, only errors if (rlogarg < .02) { - char str[128]; - sprintf(str, "FENE bond too long: " BIGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " %g", - update->ntimestep, atom->tag[i1], atom->tag[i2], sqrt(rsq)); + error->warning(FLERR, "fene/nm/split bond too long: {} {} {} {}", update->ntimestep, + atom->tag[i1], atom->tag[i2], sqrt(rsq)); if (rlogarg <= -.21) error->one(FLERR, "Bad FENE bond"); rlogarg = 0.02; } @@ -253,9 +252,7 @@ double BondFENEnmSplit::single(int type, double rsq, int /*i*/, int /*j*/, doubl // and crash the run if rlogarg < -.21 rather than < -3 // Don't print out warnings, only errors if (rlogarg < 0.02) { - char str[128]; - sprintf(str, "FENE bond too long: " BIGINT_FORMAT " %g", update->ntimestep, sqrt(rsq)); - + error->warning(FLERR, "FENE bond too long: {} {:.8}", update->ntimestep, sqrt(rsq)); if (rlogarg <= -.21) error->one(FLERR, "Bad FENE bond"); rlogarg = 0.02; }