update several pair styles to be compliant with refactored respa lists data structures

This commit is contained in:
Axel Kohlmeyer 2017-10-18 11:24:12 -04:00
parent 0966e14e73
commit 2c7528811d
9 changed files with 32 additions and 76 deletions

View File

@ -263,22 +263,6 @@ void PairLJLongDipoleLong::init_style()
if (force->kspace) g_ewald = force->kspace->g_ewald;
}
/* ----------------------------------------------------------------------
neighbor callback to inform pair style of neighbor list to use
regular or rRESPA
------------------------------------------------------------------------- */
void PairLJLongDipoleLong::init_list(int id, NeighList *ptr)
{
if (id == 0) list = ptr;
else if (id == 1) listinner = ptr;
else if (id == 2) listmiddle = ptr;
else if (id == 3) listouter = ptr;
if (id)
error->all(FLERR,"Pair style lj/long/dipole/long does not currently support respa");
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */

View File

@ -34,7 +34,6 @@ class PairLJLongDipoleLong : public Pair {
virtual void settings(int, char **);
void coeff(int, char **);
void init_style();
void init_list(int, class NeighList *);
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);

View File

@ -726,7 +726,7 @@ void PairLJLongCoulLongOpt::eval_outer()
double cut_in_off_sq = cut_in_off*cut_in_off;
double cut_in_on_sq = cut_in_on*cut_in_on;
ineighn = (ineigh = listouter->ilist)+listouter->inum;
ineighn = (ineigh = list->ilist)+list->inum;
for (; ineigh<ineighn; ++ineigh) { // loop over my atoms
i = *ineigh; fi = f0+3*i;
@ -735,7 +735,7 @@ void PairLJLongCoulLongOpt::eval_outer()
lj1i = lj1[typei]; lj2i = lj2[typei]; lj3i = lj3[typei]; lj4i = lj4[typei];
cutsqi = cutsq[typei]; cut_ljsqi = cut_ljsq[typei];
memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
jneighn = (jneigh = listouter->firstneigh[i])+listouter->numneigh[i];
jneighn = (jneigh = list->firstneigh[i])+list->numneigh[i];
for (; jneigh<jneighn; ++jneigh) { // loop over neighbors
j = *jneigh;

View File

@ -378,19 +378,6 @@ void PairLJCutTholeLong::init_style()
if (ncoultablebits) init_tables(cut_coul,cut_respa);
}
/* ----------------------------------------------------------------------
neighbor callback to inform pair style of neighbor list to use
regular or rRESPA
------------------------------------------------------------------------- */
void PairLJCutTholeLong::init_list(int id, NeighList *ptr)
{
if (id == 0) list = ptr;
else if (id == 1) listinner = ptr;
else if (id == 2) listmiddle = ptr;
else if (id == 3) listouter = ptr;
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */

View File

@ -34,7 +34,6 @@ class PairLJCutTholeLong : public Pair {
virtual void settings(int, char **);
void coeff(int, char **);
virtual void init_style();
void init_list(int, class NeighList *);
virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);

View File

@ -686,19 +686,6 @@ void PairLJCutCoulLongSoft::init_style()
g_ewald = force->kspace->g_ewald;
}
/* ----------------------------------------------------------------------
neighbor callback to inform pair style of neighbor list to use
regular or rRESPA
------------------------------------------------------------------------- */
void PairLJCutCoulLongSoft::init_list(int id, NeighList *ptr)
{
if (id == 0) list = ptr;
else if (id == 1) listinner = ptr;
else if (id == 2) listmiddle = ptr;
else if (id == 3) listouter = ptr;
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */

View File

@ -319,7 +319,7 @@ void PairBuckLongCoulLongOMP::compute_inner()
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = listinner->inum;
const int inum = list->inum_inner;
#if defined(_OPENMP)
#pragma omp parallel default(none)
#endif
@ -343,7 +343,7 @@ void PairBuckLongCoulLongOMP::compute_middle()
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = listmiddle->inum;
const int inum = list->inum_middle;
#if defined(_OPENMP)
#pragma omp parallel default(none)
@ -373,7 +373,7 @@ void PairBuckLongCoulLongOMP::compute_outer(int eflag, int vflag)
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = listouter->inum;
const int inum = list->inum;
#if defined(_OPENMP)
#pragma omp parallel default(none) shared(eflag,vflag)
@ -811,7 +811,7 @@ void PairBuckLongCoulLongOMP::eval_inner(int iifrom, int iito, ThrData * const t
const double *x0 = x[0];
double *f0 = f[0], *fi = 0;
int *ilist = listinner->ilist;
int *ilist = list->ilist_inner;
const int newton_pair = force->newton_pair;
@ -835,7 +835,7 @@ void PairBuckLongCoulLongOMP::eval_inner(int iifrom, int iito, ThrData * const t
memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
cut_bucksqi = cut_bucksq[typei = type[i]];
buck1i = buck1[typei]; buck2i = buck2[typei]; rhoinvi = rhoinv[typei];
jneighn = (jneigh = listinner->firstneigh[i])+listinner->numneigh[i];
jneighn = (jneigh = list->firstneigh_inner[i])+list->numneigh_inner[i];
for (; jneigh<jneighn; ++jneigh) { // loop over neighbors
j = *jneigh;
@ -904,7 +904,7 @@ void PairBuckLongCoulLongOMP::eval_middle(int iifrom, int iito, ThrData * const
const double *x0 = x[0];
double *f0 = f[0], *fi = 0;
int *ilist = listmiddle->ilist;
int *ilist = list->ilist_middle;
const int newton_pair = force->newton_pair;
@ -932,7 +932,7 @@ void PairBuckLongCoulLongOMP::eval_middle(int iifrom, int iito, ThrData * const
memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
cut_bucksqi = cut_bucksq[typei = type[i]];
buck1i = buck1[typei]; buck2i = buck2[typei]; rhoinvi = rhoinv[typei];
jneighn = (jneigh = listmiddle->firstneigh[i])+listmiddle->numneigh[i];
jneighn = (jneigh = list->firstneigh_middle[i])+list->numneigh_middle[i];
for (; jneigh<jneighn; ++jneigh) { // loop over neighbors
j = *jneigh;
@ -1009,7 +1009,7 @@ void PairBuckLongCoulLongOMP::eval_outer(int iiform, int iito, ThrData * const t
const double *x0 = x[0];
double *f0 = f[0], *fi = f0;
int *ilist = listouter->ilist;
int *ilist = list->ilist;
int i, j, ii;
int *jneigh, *jneighn, typei, typej, ni, respa_flag;
@ -1035,7 +1035,7 @@ void PairBuckLongCoulLongOMP::eval_outer(int iiform, int iito, ThrData * const t
buckai = buck_a[typei]; buckci = buck_c[typei]; rhoinvi = rhoinv[typei];
cutsqi = cutsq[typei]; cut_bucksqi = cut_bucksq[typei];
memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
jneighn = (jneigh = listouter->firstneigh[i])+listouter->numneigh[i];
jneighn = (jneigh = list->firstneigh[i])+list->numneigh[i];
for (; jneigh<jneighn; ++jneigh) { // loop over neighbors
j = *jneigh;

View File

@ -317,7 +317,7 @@ void PairLJLongCoulLongOMP::compute_inner()
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = listinner->inum;
const int inum = list->inum_inner;
#if defined(_OPENMP)
#pragma omp parallel default(none)
#endif
@ -341,7 +341,7 @@ void PairLJLongCoulLongOMP::compute_middle()
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = listmiddle->inum;
const int inum = list->inum_middle;
#if defined(_OPENMP)
#pragma omp parallel default(none)
@ -371,7 +371,7 @@ void PairLJLongCoulLongOMP::compute_outer(int eflag, int vflag)
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = listouter->inum;
const int inum = list->inum;
#if defined(_OPENMP)
#pragma omp parallel default(none) shared(eflag,vflag)
@ -805,7 +805,7 @@ void PairLJLongCoulLongOMP::eval_inner(int iifrom, int iito, ThrData * const thr
const double *x0 = x[0];
double *f0 = f[0], *fi = 0;
int *ilist = listinner->ilist;
int *ilist = list->ilist_inner;
const int newton_pair = force->newton_pair;
@ -828,7 +828,7 @@ void PairLJLongCoulLongOMP::eval_inner(int iifrom, int iito, ThrData * const thr
memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
cut_ljsqi = cut_ljsq[typei = type[i]];
lj1i = lj1[typei]; lj2i = lj2[typei];
jneighn = (jneigh = listinner->firstneigh[i])+listinner->numneigh[i];
jneighn = (jneigh = list->firstneigh_inner[i])+list->numneigh_inner[i];
for (; jneigh<jneighn; ++jneigh) { // loop over neighbors
j = *jneigh;
ni = sbmask(j);
@ -896,7 +896,7 @@ void PairLJLongCoulLongOMP::eval_middle(int iifrom, int iito, ThrData * const th
const double *x0 = x[0];
double *f0 = f[0], *fi = 0;
int *ilist = listmiddle->ilist;
int *ilist = list->ilist_middle;
const int newton_pair = force->newton_pair;
@ -925,7 +925,7 @@ void PairLJLongCoulLongOMP::eval_middle(int iifrom, int iito, ThrData * const th
memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
cut_ljsqi = cut_ljsq[typei = type[i]];
lj1i = lj1[typei]; lj2i = lj2[typei];
jneighn = (jneigh = listmiddle->firstneigh[i])+listmiddle->numneigh[i];
jneighn = (jneigh = list->firstneigh_middle[i])+list->numneigh_middle[i];
for (; jneigh<jneighn; ++jneigh) {
j = *jneigh;
@ -1000,7 +1000,7 @@ void PairLJLongCoulLongOMP::eval_outer(int iiform, int iito, ThrData * const thr
const double *x0 = x[0];
double *f0 = f[0], *fi = f0;
int *ilist = listouter->ilist;
int *ilist = list->ilist;
int i, j, ii;
int *jneigh, *jneighn, typei, typej, ni, respa_flag;
@ -1027,7 +1027,7 @@ void PairLJLongCoulLongOMP::eval_outer(int iiform, int iito, ThrData * const thr
lj1i = lj1[typei]; lj2i = lj2[typei]; lj3i = lj3[typei]; lj4i = lj4[typei];
cutsqi = cutsq[typei]; cut_ljsqi = cut_ljsq[typei];
memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
jneighn = (jneigh = listouter->firstneigh[i])+listouter->numneigh[i];
jneighn = (jneigh = list->firstneigh[i])+list->numneigh[i];
for (; jneigh<jneighn; ++jneigh) { // loop over neighbors
j = *jneigh;

View File

@ -379,7 +379,7 @@ void PairLJLongTIP4PLongOMP::compute_inner()
for (i = 0; i < nall; i++) hneigh_thr[i].t = 0;
const int nthreads = comm->nthreads;
const int inum = listinner->inum;
const int inum = list->inum_inner;
#if defined(_OPENMP)
#pragma omp parallel default(none)
#endif
@ -403,7 +403,7 @@ void PairLJLongTIP4PLongOMP::compute_middle()
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = listmiddle->inum;
const int inum = list->inum_middle;
#if defined(_OPENMP)
#pragma omp parallel default(none)
@ -457,7 +457,7 @@ void PairLJLongTIP4PLongOMP::compute_outer(int eflag, int vflag)
}
const int nthreads = comm->nthreads;
const int inum = listouter->inum;
const int inum = list->inum;
#if defined(_OPENMP)
#pragma omp parallel default(none) shared(eflag,vflag)
@ -1126,9 +1126,9 @@ void PairLJLongTIP4PLongOMP::eval_inner(int iifrom, int iito, ThrData * const th
double *lj1i, *lj2i;
ilist = listinner->ilist;
numneigh = listinner->numneigh;
firstneigh = listinner->firstneigh;
ilist = list->ilist_inner;
numneigh = list->numneigh_inner;
firstneigh = list->firstneigh_inner;
// loop over neighbors of my atoms
@ -1388,9 +1388,9 @@ void PairLJLongTIP4PLongOMP::eval_middle(int iifrom, int iito, ThrData * const t
int ni;
double *lj1i, *lj2i;
ilist = listmiddle->ilist;
numneigh = listmiddle->numneigh;
firstneigh = listmiddle->firstneigh;
ilist = list->ilist_middle;
numneigh = list->numneigh_middle;
firstneigh = list->firstneigh_middle;
// loop over neighbors of my atoms
@ -1656,9 +1656,9 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
double fxtmp,fytmp,fztmp;
ilist = listouter->ilist;
numneigh = listouter->numneigh;
firstneigh = listouter->firstneigh;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// loop over neighbors of my atoms