diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 3af497ca15..368e6d938b 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -41,7 +41,6 @@ PairHybrid::PairHybrid(LAMMPS *lmp) : Pair(lmp), outerflag = 0; respaflag = 0; - style_cutoff_flag = 1; } /* ---------------------------------------------------------------------- */ @@ -57,8 +56,7 @@ PairHybrid::~PairHybrid() } } delete[] styles; - if (style_cutoff_flag) - delete[] cutmax_style; + delete[] cutmax_style; delete[] keywords; delete[] multiple; @@ -301,10 +299,8 @@ 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]; - if (style_cutoff_flag) { - cutmax_style = new double[narg]; - memset(cutmax_style, 0.0, narg*sizeof(double)); - } + cutmax_style = new double[narg]; + memset(cutmax_style, 0.0, narg*sizeof(double)); keywords = new char *[narg]; multiple = new int[narg]; @@ -724,10 +720,11 @@ double PairHybrid::init_one(int i, int j) } cutmax = MAX(cutmax,cut); - if (style_cutoff_flag) { - int istyle; - for (istyle = 0; istyle < nstyles; istyle++) - if (styles[istyle] == styles[map[i][j][k]]) break; + int istyle; + for (istyle = 0; istyle < nstyles; istyle++) + if (styles[istyle] == styles[map[i][j][k]]) break; + + if (styles[istyle]->trim_flag) { if (cut > cutmax_style[istyle]) { cutmax_style[istyle] = cut; @@ -802,10 +799,8 @@ void PairHybrid::read_restart(FILE *fp) delete[] compute_tally; styles = new Pair*[nstyles]; - if (style_cutoff_flag) { - cutmax_style = new double[nstyles]; - memset(cutmax_style, 0.0, nstyles*sizeof(double)); - } + cutmax_style = new double[nstyles]; + memset(cutmax_style, 0.0, nstyles*sizeof(double)); keywords = new char*[nstyles]; multiple = new int[nstyles]; diff --git a/src/pair_hybrid.h b/src/pair_hybrid.h index 97bb01d8e7..4247354d5e 100644 --- a/src/pair_hybrid.h +++ b/src/pair_hybrid.h @@ -70,7 +70,6 @@ class PairHybrid : public Pair { protected: int nstyles; // # of sub-styles Pair **styles; // list of Pair style classes - int style_cutoff_flag; // 1 if build a separate neigh list for each style double *cutmax_style; // max cutoff for each style char **keywords; // style name of each Pair style int *multiple; // 0 if style used once, else Mth instance