fix bug with pair_modify <style> compute not triggering the correct global change
This commit is contained in:
@ -75,7 +75,7 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp)
|
||||
ewaldflag = pppmflag = msmflag = dispersionflag = tip4pflag = dipoleflag = 0;
|
||||
reinitflag = 1;
|
||||
|
||||
// pair_modify settingsx
|
||||
// pair_modify settings
|
||||
|
||||
compute_flag = 1;
|
||||
manybody_flag = 0;
|
||||
|
||||
@ -36,7 +36,7 @@ PairHybrid::PairHybrid(LAMMPS *lmp) : Pair(lmp),
|
||||
map(NULL), special_lj(NULL), special_coul(NULL), compute_tally(NULL)
|
||||
{
|
||||
nstyles = 0;
|
||||
|
||||
|
||||
outerflag = 0;
|
||||
respaflag = 0;
|
||||
|
||||
@ -490,7 +490,7 @@ void PairHybrid::init_style()
|
||||
if (((force->special_lj[i] == 0.0) || (force->special_lj[i] == 1.0))
|
||||
&& (force->special_lj[i] != special_lj[istyle][i]))
|
||||
error->all(FLERR,"Pair_modify special setting for pair hybrid "
|
||||
"incompatible with global special_bonds setting");
|
||||
"incompatible with global special_bonds setting");
|
||||
}
|
||||
}
|
||||
|
||||
@ -500,7 +500,7 @@ void PairHybrid::init_style()
|
||||
|| (force->special_coul[i] == 1.0))
|
||||
&& (force->special_coul[i] != special_coul[istyle][i]))
|
||||
error->all(FLERR,"Pair_modify special setting for pair hybrid "
|
||||
"incompatible with global special_bonds setting");
|
||||
"incompatible with global special_bonds setting");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -832,6 +832,12 @@ void PairHybrid::modify_params(int narg, char **arg)
|
||||
Pair::modify_params(narg,arg);
|
||||
for (int m = 0; m < nstyles; m++) styles[m]->modify_params(narg,arg);
|
||||
}
|
||||
|
||||
// reset global compute_flag since there may have been changes
|
||||
// to any of the substyles
|
||||
compute_flag = 0;
|
||||
for (int m = 0; m < nstyles; m++)
|
||||
if (styles[m]->compute_flag) compute_flag = 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user