Fix logic for neigh/trim yes and multiple runs

This commit is contained in:
Stan Gerald Moore
2023-01-27 14:29:00 -07:00
parent 69e7dd9fd6
commit 0677c1c3f5

View File

@ -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;
}