From 0b5acdca51fe8f1de48914ee0a6fd6831ff49fe4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 26 Feb 2023 13:47:11 -0500 Subject: [PATCH] convert hard error about invalid atom masses from EAM potentials to warning --- src/atom.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/atom.cpp b/src/atom.cpp index 32285758c0..610ac809fe 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1914,11 +1914,15 @@ void Atom::set_mass(const char *file, int line, const char *str, int type_offset void Atom::set_mass(const char *file, int line, int itype, double value) { - if (mass == nullptr) error->all(file,line, "Cannot set mass for atom style {}", atom_style); + if (mass == nullptr) + error->all(file,line, "Cannot set per-type mass for atom style {}", atom_style); if (itype < 1 || itype > ntypes) error->all(file,line,"Invalid type {} for atom mass {}", itype, value); - if (value <= 0.0) error->all(file,line,"Invalid atom mass value {}", value); - + if (value <= 0.0) { + if (comm->me == 0) + error->warning(file,line,"Ignoring invalid mass value {} for atom type {}", value, itype); + return; + } mass[itype] = value; mass_setflag[itype] = 1; }