add missing updates for symbolic constants in Atom class

This commit is contained in:
Axel Kohlmeyer 2020-09-16 22:58:12 -04:00
parent 6e9a39cf22
commit 429cc0cacf
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
12 changed files with 51 additions and 50 deletions

View File

@ -75,30 +75,27 @@ void NeighBondKokkos<DeviceType>::init_topology_kk() {
// 1st time allocation of topology lists
if (atom->molecular && atom->nbonds && maxbond == 0) {
if (nprocs == 1) maxbond = atom->nbonds;
else maxbond = static_cast<int> (LB_FACTOR * atom->nbonds / nprocs);
memoryKK->create_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neigh:neighbor->bondlist");
}
if (atom->molecular && atom->nangles && maxangle == 0) {
if (nprocs == 1) maxangle = atom->nangles;
else maxangle = static_cast<int> (LB_FACTOR * atom->nangles / nprocs);
memoryKK->create_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neigh:neighbor->anglelist");
}
if (atom->molecular && atom->ndihedrals && maxdihedral == 0) {
if (nprocs == 1) maxdihedral = atom->ndihedrals;
else maxdihedral = static_cast<int>
(LB_FACTOR * atom->ndihedrals / nprocs);
memoryKK->create_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neigh:neighbor->dihedrallist");
}
if (atom->molecular && atom->nimpropers && maximproper == 0) {
if (nprocs == 1) maximproper = atom->nimpropers;
else maximproper = static_cast<int>
(LB_FACTOR * atom->nimpropers / nprocs);
memoryKK->create_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neigh:neighbor->improperlist");
if (atom->molecular != Atom::ATOMIC) {
if (atom->nbonds && maxbond == 0) {
if (nprocs == 1) maxbond = atom->nbonds;
else maxbond = static_cast<int> (LB_FACTOR * atom->nbonds / nprocs);
memoryKK->create_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neigh:neighbor->bondlist");
}
if (atom->nangles && maxangle == 0) {
if (nprocs == 1) maxangle = atom->nangles;
else maxangle = static_cast<int> (LB_FACTOR * atom->nangles / nprocs);
memoryKK->create_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neigh:neighbor->anglelist");
}
if (atom->ndihedrals && maxdihedral == 0) {
if (nprocs == 1) maxdihedral = atom->ndihedrals;
else maxdihedral = static_cast<int> (LB_FACTOR * atom->ndihedrals / nprocs);
memoryKK->create_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neigh:neighbor->dihedrallist");
}
if (atom->nimpropers && maximproper == 0) {
if (nprocs == 1) maximproper = atom->nimpropers;
else maximproper = static_cast<int> (LB_FACTOR * atom->nimpropers / nprocs);
memoryKK->create_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neigh:neighbor->improperlist");
}
}
// set flags that determine which topology neighboring routines to use

View File

@ -316,7 +316,7 @@ void NeighborKokkos::build_kokkos(int topoflag)
// build topology lists for bonds/angles/etc
if (atom->molecular && topoflag) build_topology();
if ((atom->molecular != Atom::ATOMIC) && topoflag) build_topology();
}
template<class DeviceType>

View File

@ -125,7 +125,7 @@ void FixHyperGlobal::init()
if (force->newton_pair == 0)
error->all(FLERR,"Hyper global requires newton pair on");
if (atom->molecular && me == 0)
if ((atom->molecular != Atom::ATOMIC) && (me == 0))
error->warning(FLERR,"Hyper global for molecular systems "
"requires care in defining hyperdynamic bonds");

View File

@ -274,7 +274,7 @@ void FixHyperLocal::init()
if (force->newton_pair == 0)
error->all(FLERR,"Hyper local requires newton pair on");
if (atom->molecular && me == 0)
if ((atom->molecular != Atom::ATOMIC) && (me == 0))
error->warning(FLERR,"Hyper local for molecular systems "
"requires care in defining hyperdynamic bonds");

View File

@ -152,10 +152,12 @@ void ComputePressureBocs::init()
vptr = nullptr;
if (pairflag && force->pair) nvirial++;
if (bondflag && atom->molecular && force->bond) nvirial++;
if (angleflag && atom->molecular && force->angle) nvirial++;
if (dihedralflag && atom->molecular && force->dihedral) nvirial++;
if (improperflag && atom->molecular && force->improper) nvirial++;
if (atom->molecular != Atom::ATOMIC) {
if (bondflag && force->bond) nvirial++;
if (angleflag && force->angle) nvirial++;
if (dihedralflag && force->dihedral) nvirial++;
if (improperflag && force->improper) nvirial++;
}
if (fixflag)
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->virial_flag) nvirial++;

View File

@ -441,7 +441,7 @@ void FixIntel::pair_init_check(const bool cdmessage)
}
#ifndef LMP_INTEL_NBOR_COMPAT
if (force->pair->manybody_flag && atom->molecular) {
if (force->pair->manybody_flag && (atom->molecular != Atom::ATOMIC)) {
int flag = 0;
if (atom->nbonds > 0 && force->special_lj[1] == 0.0 &&
force->special_coul[1] == 0.0) flag = 1;
@ -456,7 +456,7 @@ void FixIntel::pair_init_check(const bool cdmessage)
#endif
int need_tag = 0;
if (atom->molecular) need_tag = 1;
if (atom->molecular != Atom::ATOMIC) need_tag = 1;
// Clear buffers used for pair style
char kmode[80];
@ -507,8 +507,8 @@ void FixIntel::pair_init_check(const bool cdmessage)
void FixIntel::bond_init_check()
{
if (_offload_balance != 0.0 && atom->molecular &&
force->newton_pair != force->newton_bond)
if ((_offload_balance != 0.0) && (atom->molecular != Atom::ATOMIC)
&& (force->newton_pair != force->newton_bond))
error->all(FLERR,
"USER-INTEL package requires same setting for newton bond and non-bond.");

View File

@ -88,7 +88,7 @@ void NPairFullBinGhostIntel::fbi(NeighList * list,
_fix->nbor_pack_width());
int need_ic = 0;
if (atom->molecular)
if (atom->molecular != Atom::ATOMIC)
dminimum_image_check(need_ic, neighbor->cutneighmax, neighbor->cutneighmax,
neighbor->cutneighmax);
@ -420,7 +420,7 @@ void NPairFullBinGhostIntel::fbi(const int offload, NeighList * list,
}
} // for u
if (molecular && i < nlocal) {
if ((molecular != Atom::ATOMIC) && (i < nlocal)) {
int alln = n;
n = 0;
#if defined(LMP_SIMD_COMPILER)

View File

@ -189,10 +189,12 @@ void ComputePressure::init()
if (pairhybridflag && force->pair) nvirial++;
if (pairflag && force->pair) nvirial++;
if (bondflag && atom->molecular && force->bond) nvirial++;
if (angleflag && atom->molecular && force->angle) nvirial++;
if (dihedralflag && atom->molecular && force->dihedral) nvirial++;
if (improperflag && atom->molecular && force->improper) nvirial++;
if (atom->molecular != Atom::ATOMIC) {
if (bondflag && force->bond) nvirial++;
if (angleflag && force->angle) nvirial++;
if (dihedralflag && force->dihedral) nvirial++;
if (improperflag && force->improper) nvirial++;
}
if (fixflag)
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->thermo_virial) nvirial++;

View File

@ -727,7 +727,7 @@ void Domain::image_check()
// if running verlet/split, don't check on KSpace partition since
// it has no ghost atoms and thus bond partners won't exist
if (!atom->molecular) return;
if (atom->molecular == Atom::ATOMIC) return;
if (!xperiodic && !yperiodic && (dimension == 2 || !zperiodic)) return;
if (strncmp(update->integrate_style,"verlet/split",12) == 0 &&
universe->iworld != 0) return;
@ -837,7 +837,7 @@ void Domain::box_too_small_check()
// if running verlet/split, don't check on KSpace partition since
// it has no ghost atoms and thus bond partners won't exist
if (!atom->molecular) return;
if (atom->molecular == Atom::ATOMIC) return;
if (!xperiodic && !yperiodic && (dimension == 2 || !zperiodic)) return;
if (strncmp(update->integrate_style,"verlet/split",12) == 0 &&
universe->iworld != 0) return;

View File

@ -332,7 +332,7 @@ void Finish::end(int flag)
mpi_timings("Pair",timer,Timer::PAIR, world,nprocs,
nthreads,me,time_loop,screen,logfile);
if (atom->molecular)
if (atom->molecular != Atom::ATOMIC)
mpi_timings("Bond",timer,Timer::BOND,world,nprocs,
nthreads,me,time_loop,screen,logfile);
@ -391,7 +391,7 @@ void Finish::end(int flag)
utils::logmesg(lmp,fmt::format(thr_fmt,me,thr_total,thr_total/time_loop*100.0));
omp_times(fixomp,"Pair",Timer::PAIR,nthreads,screen,logfile);
if (atom->molecular)
if (atom->molecular != Atom::ATOMIC)
omp_times(fixomp,"Bond",Timer::BOND,nthreads,screen,logfile);
if (force->kspace)
omp_times(fixomp,"Kspace",Timer::KSPACE,nthreads,screen,logfile);
@ -585,7 +585,7 @@ void Finish::end(int flag)
mesg += fmt::format("Total # of neighbors = {:.8g}\n",nall);
if (atom->natoms > 0)
mesg += fmt::format("Ave neighs/atom = {:.8}\n",nall/atom->natoms);
if (atom->molecular && atom->natoms > 0)
if ((atom->molecular != Atom::ATOMIC) && (atom->natoms > 0))
mesg += fmt::format("Ave special neighs/atom = {:.8}\n",
nspec_all/atom->natoms);
mesg += fmt::format("Neighbor list builds = {}\n",neighbor->ncalls);

View File

@ -1296,7 +1296,7 @@ void Neighbor::init_topology()
{
int i,m;
if (!atom->molecular) return;
if (atom->molecular == Atom::ATOMIC) return;
// set flags that determine which topology neighbor classes to use
// these settings could change from run to run, depending on fixes defined
@ -1801,7 +1801,7 @@ int Neighbor::choose_pair(NeighRequest *rq)
if (molecular != Atom::ATOMIC) {
if (mask & NP_ATOMONLY) continue;
} else if (!molecular) {
} else if (molecular == Atom::ATOMIC) {
if (mask & NP_MOLONLY) continue;
}
@ -2097,7 +2097,7 @@ void Neighbor::build(int topoflag)
// build topology lists for bonds/angles/etc
if (atom->molecular && topoflag) build_topology();
if ((atom->molecular != Atom::ATOMIC) && topoflag) build_topology();
}
/* ----------------------------------------------------------------------

View File

@ -64,7 +64,7 @@ void ResetMolIDs::command(int narg, char **arg)
error->all(FLERR,"Reset_mol_ids command before simulation box is defined");
if (atom->tag_enable == 0)
error->all(FLERR,"Cannot use reset_mol_ids unless atoms have IDs");
if (atom->molecular != 1)
if (atom->molecular != Atom::MOLECULAR)
error->all(FLERR,"Can only use reset_mol_ids on molecular systems");
// process args