From 0677c1c3f598f4adf88a805b8f8b47a0a49b75f3 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Fri, 27 Jan 2023 14:29:00 -0700 Subject: [PATCH] Fix logic for neigh/trim yes and multiple runs --- src/pair_hybrid.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index efc22dbf4e..b6ce87a6de 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -304,8 +304,6 @@ void PairHybrid::settings(int narg, char **arg) // allocate list of sub-styles as big as possibly needed if no extra args styles = new Pair *[narg]; - cutmax_style = new double[narg]; - memset(cutmax_style, 0.0, narg*sizeof(double)); keywords = new char *[narg]; multiple = new int[narg]; @@ -347,6 +345,9 @@ void PairHybrid::settings(int narg, char **arg) nstyles++; } + cutmax_style = new double[nstyles]; + memset(cutmax_style, 0.0, nstyles*sizeof(double)); + // multiple[i] = 1 to M if sub-style used multiple times, else 0 int num_tip4p = 0, num_coul = 0; // count sub-styles with tip4p and coulomb @@ -582,6 +583,8 @@ void PairHybrid::init_style() { int i,m,itype,jtype,used,istyle,skip; + memset(cutmax_style, 0.0, nstyles*sizeof(double)); + // error if a sub-style is not used int ntypes = atom->ntypes; @@ -750,7 +753,7 @@ double PairHybrid::init_one(int i, int j) cutmax_style[istyle] = cut; for (auto &request : neighbor->get_pair_requests()) { - if (styles[istyle] == request->get_requestor() && styles[istyle]->trim_flag) { + if (styles[istyle] == request->get_requestor()) { request->set_cutoff(cutmax_style[istyle]); break; }