use ev_init for impropers
This commit is contained in:
@ -90,8 +90,7 @@ void ImproperClass2::compute(int eflag, int vflag)
|
|||||||
double fabcd[4][3];
|
double fabcd[4][3];
|
||||||
|
|
||||||
eimproper = 0.0;
|
eimproper = 0.0;
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
for (j = 0; j < 4; j++)
|
for (j = 0; j < 4; j++)
|
||||||
|
|||||||
@ -71,8 +71,7 @@ void ImproperClass2Kokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||||||
eflag = eflag_in;
|
eflag = eflag_in;
|
||||||
vflag = vflag_in;
|
vflag = vflag_in;
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag,0);
|
ev_init(eflag,vflag,0);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
// reallocate per-atom arrays if necessary
|
// reallocate per-atom arrays if necessary
|
||||||
|
|
||||||
|
|||||||
@ -71,8 +71,7 @@ void ImproperHarmonicKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||||||
eflag = eflag_in;
|
eflag = eflag_in;
|
||||||
vflag = vflag_in;
|
vflag = vflag_in;
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag,0);
|
ev_init(eflag,vflag,0);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
// reallocate per-atom arrays if necessary
|
// reallocate per-atom arrays if necessary
|
||||||
|
|
||||||
|
|||||||
@ -61,8 +61,7 @@ void ImproperCvff::compute(int eflag, int vflag)
|
|||||||
double a33,a12,a13,a23,sx2,sy2,sz2;
|
double a33,a12,a13,a23,sx2,sy2,sz2;
|
||||||
|
|
||||||
eimproper = 0.0;
|
eimproper = 0.0;
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
|
|||||||
@ -61,8 +61,7 @@ void ImproperHarmonic::compute(int eflag, int vflag)
|
|||||||
double sx2,sy2,sz2;
|
double sx2,sy2,sz2;
|
||||||
|
|
||||||
eimproper = 0.0;
|
eimproper = 0.0;
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
|
|||||||
@ -65,8 +65,7 @@ void ImproperUmbrella::compute(int eflag, int vflag)
|
|||||||
double ax,ay,az,ra2,rh2,ra,rh,rar,rhr,arx,ary,arz,hrx,hry,hrz;
|
double ax,ay,az,ra2,rh2,ra,rh,rar,rhr,arx,ary,arz,hrx,hry,hrz;
|
||||||
|
|
||||||
eimproper = 0.0;
|
eimproper = 0.0;
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
|
|||||||
@ -83,8 +83,7 @@ void ImproperCvffIntel::compute(int eflag, int vflag,
|
|||||||
IntelBuffers<flt_t,acc_t> *buffers,
|
IntelBuffers<flt_t,acc_t> *buffers,
|
||||||
const ForceConst<flt_t> &fc)
|
const ForceConst<flt_t> &fc)
|
||||||
{
|
{
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
if (evflag) {
|
if (evflag) {
|
||||||
if (vflag && !eflag) {
|
if (vflag && !eflag) {
|
||||||
|
|||||||
@ -84,8 +84,7 @@ void ImproperHarmonicIntel::compute(int eflag, int vflag,
|
|||||||
IntelBuffers<flt_t,acc_t> *buffers,
|
IntelBuffers<flt_t,acc_t> *buffers,
|
||||||
const ForceConst<flt_t> &fc)
|
const ForceConst<flt_t> &fc)
|
||||||
{
|
{
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
if (evflag) {
|
if (evflag) {
|
||||||
if (vflag && !eflag) {
|
if (vflag && !eflag) {
|
||||||
|
|||||||
@ -63,8 +63,7 @@ void ImproperCossq::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
|
|
||||||
eimproper = 0.0;
|
eimproper = 0.0;
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
|
|||||||
@ -67,8 +67,7 @@ void ImproperDistance::compute(int eflag, int vflag)
|
|||||||
double domega,a;
|
double domega,a;
|
||||||
|
|
||||||
eimproper = 0.0;
|
eimproper = 0.0;
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
|
|||||||
@ -59,8 +59,7 @@ void ImproperFourier::compute(int eflag, int vflag)
|
|||||||
int i1,i2,i3,i4,n,type;
|
int i1,i2,i3,i4,n,type;
|
||||||
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z;
|
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z;
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
int **improperlist = neighbor->improperlist;
|
int **improperlist = neighbor->improperlist;
|
||||||
|
|||||||
@ -95,8 +95,7 @@ void ImproperRing::compute(int eflag, int vflag)
|
|||||||
double cjiji, ckjji, ckjkj, fix, fiy, fiz, fjx, fjy, fjz, fkx, fky, fkz;
|
double cjiji, ckjji, ckjkj, fix, fiy, fiz, fjx, fjy, fjz, fkx, fky, fkz;
|
||||||
|
|
||||||
eimproper = 0.0;
|
eimproper = 0.0;
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
/* References to simulation data. */
|
/* References to simulation data. */
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
|
|||||||
@ -66,8 +66,7 @@ void ImproperInversionHarmonic::compute(int eflag, int vflag)
|
|||||||
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z;
|
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z;
|
||||||
double rrvb1,rrvb2,rrvb3,rr2vb1,rr2vb2,rr2vb3;
|
double rrvb1,rrvb2,rrvb3,rr2vb1,rr2vb2,rr2vb3;
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
int **improperlist = neighbor->improperlist;
|
int **improperlist = neighbor->improperlist;
|
||||||
|
|||||||
@ -43,10 +43,7 @@ ImproperClass2OMP::ImproperClass2OMP(class LAMMPS *lmp)
|
|||||||
|
|
||||||
void ImproperClass2OMP::compute(int eflag, int vflag)
|
void ImproperClass2OMP::compute(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
|
ev_init(eflag,vflag);
|
||||||
if (eflag || vflag) {
|
|
||||||
ev_setup(eflag,vflag);
|
|
||||||
} else evflag = 0;
|
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int nthreads = comm->nthreads;
|
const int nthreads = comm->nthreads;
|
||||||
|
|||||||
@ -43,10 +43,7 @@ ImproperCossqOMP::ImproperCossqOMP(class LAMMPS *lmp)
|
|||||||
|
|
||||||
void ImproperCossqOMP::compute(int eflag, int vflag)
|
void ImproperCossqOMP::compute(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
|
ev_init(eflag,vflag);
|
||||||
if (eflag || vflag) {
|
|
||||||
ev_setup(eflag,vflag);
|
|
||||||
} else evflag = 0;
|
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int nthreads = comm->nthreads;
|
const int nthreads = comm->nthreads;
|
||||||
|
|||||||
@ -43,10 +43,7 @@ ImproperCvffOMP::ImproperCvffOMP(class LAMMPS *lmp)
|
|||||||
|
|
||||||
void ImproperCvffOMP::compute(int eflag, int vflag)
|
void ImproperCvffOMP::compute(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
|
ev_init(eflag,vflag);
|
||||||
if (eflag || vflag) {
|
|
||||||
ev_setup(eflag,vflag);
|
|
||||||
} else evflag = 0;
|
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int nthreads = comm->nthreads;
|
const int nthreads = comm->nthreads;
|
||||||
|
|||||||
@ -43,10 +43,7 @@ ImproperFourierOMP::ImproperFourierOMP(class LAMMPS *lmp)
|
|||||||
|
|
||||||
void ImproperFourierOMP::compute(int eflag, int vflag)
|
void ImproperFourierOMP::compute(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
|
ev_init(eflag,vflag);
|
||||||
if (eflag || vflag) {
|
|
||||||
ev_setup(eflag,vflag);
|
|
||||||
} else evflag = 0;
|
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int nthreads = comm->nthreads;
|
const int nthreads = comm->nthreads;
|
||||||
|
|||||||
@ -43,10 +43,7 @@ ImproperHarmonicOMP::ImproperHarmonicOMP(class LAMMPS *lmp)
|
|||||||
|
|
||||||
void ImproperHarmonicOMP::compute(int eflag, int vflag)
|
void ImproperHarmonicOMP::compute(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
|
ev_init(eflag,vflag);
|
||||||
if (eflag || vflag) {
|
|
||||||
ev_setup(eflag,vflag);
|
|
||||||
} else evflag = 0;
|
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int nthreads = comm->nthreads;
|
const int nthreads = comm->nthreads;
|
||||||
|
|||||||
@ -45,10 +45,7 @@ ImproperRingOMP::ImproperRingOMP(class LAMMPS *lmp)
|
|||||||
|
|
||||||
void ImproperRingOMP::compute(int eflag, int vflag)
|
void ImproperRingOMP::compute(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
|
ev_init(eflag,vflag);
|
||||||
if (eflag || vflag) {
|
|
||||||
ev_setup(eflag,vflag);
|
|
||||||
} else evflag = 0;
|
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int nthreads = comm->nthreads;
|
const int nthreads = comm->nthreads;
|
||||||
|
|||||||
@ -43,10 +43,7 @@ ImproperUmbrellaOMP::ImproperUmbrellaOMP(class LAMMPS *lmp)
|
|||||||
|
|
||||||
void ImproperUmbrellaOMP::compute(int eflag, int vflag)
|
void ImproperUmbrellaOMP::compute(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
|
ev_init(eflag,vflag);
|
||||||
if (eflag || vflag) {
|
|
||||||
ev_setup(eflag,vflag);
|
|
||||||
} else evflag = 0;
|
|
||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
const int nthreads = comm->nthreads;
|
const int nthreads = comm->nthreads;
|
||||||
|
|||||||
@ -67,8 +67,7 @@ void ImproperDistHarm::compute(int eflag, int vflag)
|
|||||||
double domega,a;
|
double domega,a;
|
||||||
|
|
||||||
eimproper = 0.0;
|
eimproper = 0.0;
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
|
|||||||
@ -67,8 +67,7 @@ void ImproperSQDistHarm::compute(int eflag, int vflag)
|
|||||||
double domega,a;
|
double domega,a;
|
||||||
|
|
||||||
eimproper = 0.0;
|
eimproper = 0.0;
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
|
|||||||
@ -57,6 +57,10 @@ class Improper : protected Pointers {
|
|||||||
int maxeatom,maxvatom;
|
int maxeatom,maxvatom;
|
||||||
|
|
||||||
void ev_setup(int, int, int alloc = 1);
|
void ev_setup(int, int, int alloc = 1);
|
||||||
|
void ev_init(int eflag, int vflag, int alloc = 1) {
|
||||||
|
if (eflag||vflag) ev_setup(eflag, vflag, alloc);
|
||||||
|
else evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = 0;
|
||||||
|
}
|
||||||
void ev_tally(int, int, int, int, int, int, double,
|
void ev_tally(int, int, int, int, int, int, double,
|
||||||
double *, double *, double *, double, double, double,
|
double *, double *, double *, double, double, double,
|
||||||
double, double, double, double, double, double);
|
double, double, double, double, double, double);
|
||||||
|
|||||||
@ -104,8 +104,7 @@ void ImproperHybrid::compute(int eflag, int vflag)
|
|||||||
// set neighbor->improperlist to sub-style improperlist before call
|
// set neighbor->improperlist to sub-style improperlist before call
|
||||||
// accumulate sub-style global/peratom energy/virial in hybrid
|
// accumulate sub-style global/peratom energy/virial in hybrid
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = eflag_global = vflag_global = eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
for (m = 0; m < nstyles; m++) {
|
for (m = 0; m < nstyles; m++) {
|
||||||
neighbor->nimproperlist = nimproperlist[m];
|
neighbor->nimproperlist = nimproperlist[m];
|
||||||
|
|||||||
@ -44,8 +44,7 @@ ImproperZero::~ImproperZero()
|
|||||||
|
|
||||||
void ImproperZero::compute(int eflag, int vflag)
|
void ImproperZero::compute(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
Reference in New Issue
Block a user