use ev_init for kspace
This commit is contained in:
@ -199,9 +199,7 @@ void PPPMGPU::compute(int eflag, int vflag)
|
|||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
// If need per-atom energies/virials, allocate per-atom arrays here
|
// If need per-atom energies/virials, allocate per-atom arrays here
|
||||||
// so that particle map on host can be done concurrently with GPU calculations
|
// so that particle map on host can be done concurrently with GPU calculations
|
||||||
|
|||||||
@ -615,8 +615,7 @@ void PPPMKokkos<DeviceType>::compute(int eflag, int vflag)
|
|||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag,0);
|
ev_init(eflag,vflag,0);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
eflag_atom = vflag_atom = 0;
|
||||||
|
|
||||||
// reallocate per-atom arrays if necessary
|
// reallocate per-atom arrays if necessary
|
||||||
|
|||||||
@ -365,9 +365,7 @@ void Ewald::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
// if atom count has changed, update qsum and qsqsum
|
// if atom count has changed, update qsum and qsqsum
|
||||||
|
|
||||||
|
|||||||
@ -688,8 +688,7 @@ void EwaldDisp::compute(int eflag, int vflag)
|
|||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = eflag_global = vflag_global = eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
if (!peratom_allocate_flag && (eflag_atom || vflag_atom)) {
|
if (!peratom_allocate_flag && (eflag_atom || vflag_atom)) {
|
||||||
allocate_peratom();
|
allocate_peratom();
|
||||||
|
|||||||
@ -454,9 +454,7 @@ void MSM::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = eflag_either = vflag_either = 0;
|
|
||||||
|
|
||||||
if (scalar_pressure_flag && vflag_either) {
|
if (scalar_pressure_flag && vflag_either) {
|
||||||
if (vflag_atom)
|
if (vflag_atom)
|
||||||
|
|||||||
@ -90,9 +90,7 @@ void MSMCG::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = eflag_either = vflag_either = 0;
|
|
||||||
|
|
||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
|
|||||||
@ -630,9 +630,7 @@ void PPPM::compute(int eflag, int vflag)
|
|||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
if (evflag_atom && !peratom_allocate_flag) {
|
if (evflag_atom && !peratom_allocate_flag) {
|
||||||
allocate_peratom();
|
allocate_peratom();
|
||||||
|
|||||||
@ -88,9 +88,7 @@ void PPPMCG::compute(int eflag, int vflag)
|
|||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
if (evflag_atom && !peratom_allocate_flag) {
|
if (evflag_atom && !peratom_allocate_flag) {
|
||||||
allocate_peratom();
|
allocate_peratom();
|
||||||
|
|||||||
@ -928,9 +928,7 @@ void PPPMDisp::compute(int eflag, int vflag)
|
|||||||
int i;
|
int i;
|
||||||
// convert atoms from box to lamda coords
|
// convert atoms from box to lamda coords
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
if (evflag_atom && !peratom_allocate_flag) {
|
if (evflag_atom && !peratom_allocate_flag) {
|
||||||
allocate_peratom();
|
allocate_peratom();
|
||||||
|
|||||||
@ -124,9 +124,7 @@ void PPPMStagger::compute(int eflag, int vflag)
|
|||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
if (evflag_atom && !peratom_allocate_flag) {
|
if (evflag_atom && !peratom_allocate_flag) {
|
||||||
allocate_peratom();
|
allocate_peratom();
|
||||||
|
|||||||
@ -174,9 +174,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
|
|||||||
int i;
|
int i;
|
||||||
// convert atoms from box to lamda coords
|
// convert atoms from box to lamda coords
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
if (evflag_atom && !peratom_allocate_flag) {
|
if (evflag_atom && !peratom_allocate_flag) {
|
||||||
allocate_peratom();
|
allocate_peratom();
|
||||||
|
|||||||
@ -161,9 +161,7 @@ void PPPMIntel::compute_first(int eflag, int vflag)
|
|||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
if (evflag_atom && !peratom_allocate_flag) {
|
if (evflag_atom && !peratom_allocate_flag) {
|
||||||
allocate_peratom();
|
allocate_peratom();
|
||||||
|
|||||||
@ -61,9 +61,7 @@ void EwaldOMP::compute(int eflag, int vflag)
|
|||||||
{
|
{
|
||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
|
||||||
|
|
||||||
// extend size of per-atom arrays if necessary
|
// extend size of per-atom arrays if necessary
|
||||||
|
|
||||||
|
|||||||
@ -90,9 +90,7 @@ void MSMCGOMP::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = eflag_either = vflag_either = 0;
|
|
||||||
|
|
||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
|
|||||||
@ -197,12 +197,7 @@ void Scafacos::compute(int eflag, int vflag)
|
|||||||
fcs_set_redistribute((FCS)fcs,0);
|
fcs_set_redistribute((FCS)fcs,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else
|
|
||||||
{
|
|
||||||
eflag_atom = 0;
|
|
||||||
vflag_global = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// grow xpbc, epot, efield if necessary
|
// grow xpbc, epot, efield if necessary
|
||||||
|
|
||||||
|
|||||||
@ -168,9 +168,7 @@ void KSpace::triclinic_check()
|
|||||||
|
|
||||||
void KSpace::compute_dummy(int eflag, int vflag)
|
void KSpace::compute_dummy(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
ev_init(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
|
||||||
eflag_atom = vflag_atom = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -195,6 +195,10 @@ class KSpace : protected Pointers {
|
|||||||
|
|
||||||
void pair_check();
|
void pair_check();
|
||||||
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;
|
||||||
|
}
|
||||||
double estimate_table_accuracy(double, double);
|
double estimate_table_accuracy(double, double);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user