From fae96f07d9c3b25342872e7e86d6af59cb9ba252 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 23 Jun 2020 06:51:10 -0400 Subject: [PATCH] single_enable and respa_enable may only be set if *all* styles support it. --- src/pair_hybrid.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 6e2cbf75d7..afecfd93d0 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -369,8 +369,8 @@ void PairHybrid::flags() styles[m]->comm_reverse_off); } - // single_enable = 1 if any sub-style is set - // respa_enable = 1 if any sub-style is set + // single_enable = 1 if all sub-styles are set + // respa_enable = 1 if all sub-styles are set // manybody_flag = 1 if any sub-style is set // no_virial_fdotr_compute = 1 if any sub-style is set // ghostneigh = 1 if any sub-style is set @@ -380,9 +380,10 @@ void PairHybrid::flags() single_enable = 0; compute_flag = 0; + respa_enable = 0; for (m = 0; m < nstyles; m++) { - if (styles[m]->single_enable) single_enable = 1; - if (styles[m]->respa_enable) respa_enable = 1; + if (styles[m]->single_enable) ++single_enable; + if (styles[m]->respa_enable) ++respa_enable; if (styles[m]->manybody_flag) manybody_flag = 1; if (styles[m]->no_virial_fdotr_compute) no_virial_fdotr_compute = 1; if (styles[m]->ghostneigh) ghostneigh = 1; @@ -396,6 +397,8 @@ void PairHybrid::flags() if (styles[m]->compute_flag) compute_flag = 1; if (styles[m]->centroidstressflag & 4) centroidstressflag |= 4; } + single_enable = (single_enable == nstyles) ? 1 : 0; + respa_enable = (respa_enable == nstyles) ? 1 : 0; init_svector(); }