move precomputation for factor_sqrt to individual Pair::compute() functions
the special_lj values may be changed for individual hybrid sub-styles with pair_modify pair special. thus the factor_sqrt[] array may have incorrect values when computed during Pair::init_style().
This commit is contained in:
@ -74,6 +74,10 @@ void PairDPD::compute(int eflag, int vflag)
|
|||||||
evdwl = 0.0;
|
evdwl = 0.0;
|
||||||
ev_init(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
|
// precompute random force scaling factors
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **v = atom->v;
|
double **v = atom->v;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
@ -266,10 +270,6 @@ void PairDPD::init_style()
|
|||||||
error->warning(FLERR, "Pair dpd needs newton pair on for momentum conservation");
|
error->warning(FLERR, "Pair dpd needs newton pair on for momentum conservation");
|
||||||
|
|
||||||
neighbor->add_request(this);
|
neighbor->add_request(this);
|
||||||
|
|
||||||
// precompute random force scaling factors
|
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -90,6 +90,10 @@ void PairDPDCoulSlaterLong::compute(int eflag, int vflag)
|
|||||||
evdwl = ecoul = 0.0;
|
evdwl = ecoul = 0.0;
|
||||||
ev_init(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
|
// precompute random force scaling factors
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **v = atom->v;
|
double **v = atom->v;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
@ -334,11 +338,6 @@ void PairDPDCoulSlaterLong::init_style()
|
|||||||
|
|
||||||
neighbor->add_request(this);
|
neighbor->add_request(this);
|
||||||
|
|
||||||
// precompute random force scaling factors
|
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
|
||||||
|
|
||||||
|
|
||||||
// ensure use of KSpace long-range solver, set g_ewald
|
// ensure use of KSpace long-range solver, set g_ewald
|
||||||
|
|
||||||
if (force->kspace == nullptr)
|
if (force->kspace == nullptr)
|
||||||
|
|||||||
@ -81,6 +81,10 @@ void PairDPDExt::compute(int eflag, int vflag)
|
|||||||
evdwl = 0.0;
|
evdwl = 0.0;
|
||||||
ev_init(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
|
// precompute random force scaling factors
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **v = atom->v;
|
double **v = atom->v;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
@ -325,10 +329,6 @@ void PairDPDExt::init_style()
|
|||||||
error->warning(FLERR, "Pair dpd needs newton pair on for momentum conservation");
|
error->warning(FLERR, "Pair dpd needs newton pair on for momentum conservation");
|
||||||
|
|
||||||
neighbor->add_request(this);
|
neighbor->add_request(this);
|
||||||
|
|
||||||
// precompute random force scaling factors
|
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -54,6 +54,10 @@ void PairDPDExtTstat::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
ev_init(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
|
// precompute random force scaling factors
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
||||||
|
|
||||||
// adjust sigma if target T is changing
|
// adjust sigma if target T is changing
|
||||||
|
|
||||||
if (t_start != t_stop) {
|
if (t_start != t_stop) {
|
||||||
|
|||||||
@ -48,6 +48,10 @@ void PairDPDTstat::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
ev_init(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
|
// precompute random force scaling factors
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
||||||
|
|
||||||
// adjust sigma if target T is changing
|
// adjust sigma if target T is changing
|
||||||
|
|
||||||
if (t_start != t_stop) {
|
if (t_start != t_stop) {
|
||||||
|
|||||||
@ -60,6 +60,10 @@ void PairDPDExtOMP::compute(int eflag, int vflag)
|
|||||||
{
|
{
|
||||||
ev_init(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
|
// precompute random force scaling factors
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int inum = list->inum;
|
const int inum = list->inum;
|
||||||
|
|
||||||
|
|||||||
@ -60,6 +60,10 @@ void PairDPDExtTstatOMP::compute(int eflag, int vflag)
|
|||||||
{
|
{
|
||||||
ev_init(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
|
// precompute random force scaling factors
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int inum = list->inum;
|
const int inum = list->inum;
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,10 @@ void PairDPDOMP::compute(int eflag, int vflag)
|
|||||||
{
|
{
|
||||||
ev_init(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
|
// precompute random force scaling factors
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int inum = list->inum;
|
const int inum = list->inum;
|
||||||
|
|
||||||
|
|||||||
@ -60,6 +60,10 @@ void PairDPDTstatOMP::compute(int eflag, int vflag)
|
|||||||
{
|
{
|
||||||
ev_init(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
|
// precompute random force scaling factors
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i) special_sqrt[i] = sqrt(force->special_lj[i]);
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int inum = list->inum;
|
const int inum = list->inum;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user