From 2e2624d719ebbe4b5ffba0b0dec65deb1b069070 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 18 Jul 2023 11:10:18 -0400 Subject: [PATCH] update loop over adapt fixes logic --- src/BPM/atom_vec_bpm_sphere.cpp | 11 ++++++----- src/atom_vec_sphere.cpp | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/BPM/atom_vec_bpm_sphere.cpp b/src/BPM/atom_vec_bpm_sphere.cpp index d3070383e5..2820a74c8a 100644 --- a/src/BPM/atom_vec_bpm_sphere.cpp +++ b/src/BPM/atom_vec_bpm_sphere.cpp @@ -98,11 +98,12 @@ void AtomVecBPMSphere::init() // check if optional radvary setting should have been set to 1 - for (auto ifix : modify->get_fix_by_style("^adapt")) { - if (ifix->diam_flag && (radvary == 0)) - error->all(FLERR, "Fix {} changes atom radii but atom_style bpm/sphere is not dynamic", - ifix->style); - } + if (radvary == 0) + for (const auto &ifix : modify->get_fix_by_style("^adapt")) { + if (ifix->diam_flag) + error->all(FLERR, "Fix {} changes atom radii but atom_style bpm/sphere is not dynamic", + ifix->style); + } } /* ---------------------------------------------------------------------- diff --git a/src/atom_vec_sphere.cpp b/src/atom_vec_sphere.cpp index 5a98d78abc..8769c316d9 100644 --- a/src/atom_vec_sphere.cpp +++ b/src/atom_vec_sphere.cpp @@ -88,11 +88,12 @@ void AtomVecSphere::init() // check if optional radvary setting should have been set to 1 - for (auto &ifix : modify->get_fix_by_style("^adapt")) { - if (ifix->diam_flag && (radvary == 0)) - error->all(FLERR, "Fix {} changes atom radii but atom_style sphere is not dynamic", - ifix->style); - } + if (radvary == 0) + for (const auto &ifix : modify->get_fix_by_style("^adapt")) { + if (ifix->diam_flag) + error->all(FLERR, "Fix {} changes atom radii but atom_style sphere is not dynamic", + ifix->style); + } } /* ----------------------------------------------------------------------