USER-DPD: remove unneeded gairct_ssa[] & anum vars, and some > 0 guards
This commit is contained in:
@ -499,7 +499,7 @@ void FixShardlow::ssa_update_dpde(
|
||||
|
||||
void FixShardlow::initial_integrate(int vflag)
|
||||
{
|
||||
int i,ii,inum,anum;
|
||||
int i,ii,inum;
|
||||
int *ilist;
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
@ -532,7 +532,6 @@ void FixShardlow::initial_integrate(int vflag)
|
||||
v_t0 = (double (*)[3]) memory->smalloc(sizeof(double)*3*nghost, "FixShardlow:v_t0");
|
||||
|
||||
inum = list->inum;
|
||||
anum = inum + list->gnum;
|
||||
ilist = list->ilist;
|
||||
|
||||
dtsqrt = sqrt(update->dt);
|
||||
@ -542,10 +541,8 @@ void FixShardlow::initial_integrate(int vflag)
|
||||
while (ii < inum) {
|
||||
i = ilist[ii];
|
||||
int len = list->numneigh[i];
|
||||
if (len > 0) {
|
||||
if (useDPDE) ssa_update_dpde(i, &(list->firstneigh[i][0]), len);
|
||||
else ssa_update_dpd(i, &(list->firstneigh[i][0]), len);
|
||||
}
|
||||
if (useDPDE) ssa_update_dpde(i, &(list->firstneigh[i][0]), len);
|
||||
else ssa_update_dpd(i, &(list->firstneigh[i][0]), len);
|
||||
ii++;
|
||||
}
|
||||
|
||||
@ -567,10 +564,8 @@ void FixShardlow::initial_integrate(int vflag)
|
||||
while (ct-- > 0) {
|
||||
i = ilist[ii];
|
||||
int len = list->numneigh[i];
|
||||
if (len > 0) {
|
||||
if (useDPDE) ssa_update_dpde(i, &(list->firstneigh[i][0]), len);
|
||||
else ssa_update_dpd(i, &(list->firstneigh[i][0]), len);
|
||||
}
|
||||
if (useDPDE) ssa_update_dpde(i, &(list->firstneigh[i][0]), len);
|
||||
else ssa_update_dpd(i, &(list->firstneigh[i][0]), len);
|
||||
ii++;
|
||||
}
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@ NBinSSA::NBinSSA(LAMMPS *lmp) : NBinStandard(lmp)
|
||||
binct_ssa = NULL;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
gairhead_ssa[i] = -1;
|
||||
gairct_ssa[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +68,6 @@ void NBinSSA::bin_atoms()
|
||||
|
||||
for (i = 0; i < 9; i++) {
|
||||
gairhead_ssa[i] = -1;
|
||||
gairct_ssa[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < mbins; i++) {
|
||||
@ -89,7 +87,6 @@ void NBinSSA::bin_atoms()
|
||||
if (mask[i] & bitmask) {
|
||||
bins[i] = gairhead_ssa[ibin];
|
||||
gairhead_ssa[ibin] = i;
|
||||
++(gairct_ssa[ibin]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -98,7 +95,6 @@ void NBinSSA::bin_atoms()
|
||||
if (ibin < 2) continue; // skip ghost atoms not in AIR
|
||||
bins[i] = gairhead_ssa[ibin];
|
||||
gairhead_ssa[ibin] = i;
|
||||
++(gairct_ssa[ibin]);
|
||||
}
|
||||
}
|
||||
for (i = nlocal-1; i >= 0; i--) {
|
||||
|
||||
@ -32,7 +32,6 @@ class NBinSSA : public NBinStandard {
|
||||
int *binlist_ssa; // index in neighlist of 1st local atom in each bin
|
||||
int *binct_ssa; // count of local atoms in each bin
|
||||
int gairhead_ssa[9]; // index of 1st ghost atom in each AIR
|
||||
int gairct_ssa[9]; // count of ghost atoms in each AIR
|
||||
int maxbin_ssa; // size of binlist_ssa and binct_ssa arrays
|
||||
|
||||
// Bounds of the local atoms in the binhead array
|
||||
|
||||
@ -180,21 +180,20 @@ void NPairHalfBinNewtonSSA::build(NeighList *list)
|
||||
}
|
||||
}
|
||||
|
||||
ilist[inum++] = i;
|
||||
if (n > 0) {
|
||||
ilist[inum++] = i;
|
||||
}
|
||||
firstneigh[i] = neighptr;
|
||||
numneigh[i] = n;
|
||||
ipage->vgot(n);
|
||||
if (ipage->status())
|
||||
error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
||||
}
|
||||
// verify count of atoms in ibin
|
||||
if (binct_ssa[ibin] != (inum - binlist_ssa[ibin]))
|
||||
error->one(FLERR,"binct_ssa didn't agree with length in ilist");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list->inum = inum;
|
||||
list->AIRct_ssa[0] = list->inum = inum;
|
||||
|
||||
// loop over AIR ghost atoms, storing their local neighbors
|
||||
// since these are ghosts, must check if stencil bin is out of bounds
|
||||
|
||||
Reference in New Issue
Block a user