whitespace fixes

This commit is contained in:
Axel Kohlmeyer
2021-05-12 06:30:52 -04:00
parent 24075b3281
commit 9ef0395313
43 changed files with 505 additions and 507 deletions

View File

@ -31,7 +31,7 @@ using namespace LAMMPS_NS;
sx,sy,sz = bin bounds = furthest the stencil could possibly extend
calculated below in create_setup()
3d creates xyz stencil, 2d creates xy stencil
for full list or half list with newton off
for full list or half list with newton off
use a full stencil
stencil is all surrounding bins including self
regardless of triclinic
@ -57,7 +57,7 @@ using namespace LAMMPS_NS;
a half list with newton on has a half same-collection stencil
a full list or half list with newton off has a full same-collection stencil
cross collection stencils are always full to allow small-to-large lookups
for orthogonal boxes, a half stencil includes bins to the "upper right" of central bin
for orthogonal boxes, a half stencil includes bins to the "upper right" of central bin
for triclinic, a half stencil includes bins in the z (3D) or y (2D) plane of self and above
cutoff is not cutneighmaxsq, but max cutoff for that atom collection
no versions that allow ghost on (any need for it?)
@ -74,15 +74,15 @@ NStencil::NStencil(LAMMPS *lmp) : Pointers(lmp)
nstencil_multi_old = nullptr;
stencil_multi_old = nullptr;
distsq_multi_old = nullptr;
nstencil_multi = nullptr;
stencil_multi = nullptr;
maxstencil_multi = nullptr;
flag_half_multi = nullptr;
flag_skip_multi = nullptr;
bin_collection_multi = nullptr;
maxcollections = 0;
dimension = domain->dimension;
@ -106,9 +106,9 @@ NStencil::~NStencil()
delete [] stencil_multi_old;
delete [] distsq_multi_old;
}
if (maxstencil_multi) {
memory->destroy(nstencil_multi);
for (int i = 0; i < maxcollections; i++) {
for (int j = 0; j < maxcollections; j++)
@ -120,7 +120,7 @@ NStencil::~NStencil()
memory->destroy(flag_half_multi);
memory->destroy(flag_skip_multi);
memory->destroy(bin_collection_multi);
memory->destroy(stencil_sx_multi);
memory->destroy(stencil_sy_multi);
memory->destroy(stencil_sz_multi);
@ -128,7 +128,7 @@ NStencil::~NStencil()
memory->destroy(stencil_mbinx_multi);
memory->destroy(stencil_mbiny_multi);
memory->destroy(stencil_mbinz_multi);
memory->destroy(stencil_binsizex_multi);
memory->destroy(stencil_binsizey_multi);
memory->destroy(stencil_binsizez_multi);
@ -154,7 +154,7 @@ void NStencil::copy_neighbor_info()
cutneighmaxsq = neighbor->cutneighmaxsq;
cuttypesq = neighbor->cuttypesq;
cutneighsq = neighbor->cutneighsq;
ncollections = neighbor->ncollections;
collection = neighbor->collection;
cutcollectionsq = neighbor->cutcollectionsq;
@ -209,15 +209,15 @@ void NStencil::copy_bin_info_multi()
void NStencil::create_setup()
{
if (neighstyle != Neighbor::MULTI){
if (nb) copy_bin_info();
last_stencil = update->ntimestep;
// sx,sy,sz = max range of stencil in each dim
// smax = max possible size of entire 3d stencil
// stencil will be empty if cutneighmax = 0.0
sx = static_cast<int> (cutneighmax*bininvx);
if (sx*binsizex < cutneighmax) sx++;
sy = static_cast<int> (cutneighmax*bininvy);
@ -225,12 +225,12 @@ void NStencil::create_setup()
sz = static_cast<int> (cutneighmax*bininvz);
if (sz*binsizez < cutneighmax) sz++;
if (dimension == 2) sz = 0;
int smax = (2*sx+1) * (2*sy+1) * (2*sz+1);
// reallocate stencil structs if necessary
// for BIN and MULTI_OLD styles
if (neighstyle == Neighbor::BIN) {
if (smax > maxstencil) {
maxstencil = smax;
@ -241,7 +241,7 @@ void NStencil::create_setup()
memory->create(stencilxyz,maxstencil,3,"neighstencil:stencilxyz");
}
}
} else {
int i;
int n = atom->ntypes;
@ -271,19 +271,19 @@ void NStencil::create_setup()
int i, j, bin_collection, smax;
double stencil_range;
int n = ncollections;
if (nb) copy_bin_info_multi();
// Deallocate arrays if previously allocated
if((n > maxcollections) && stencil_multi){
if((n > maxcollections) && stencil_multi){
memory->destroy(nstencil_multi);
for (i = 0; i < maxcollections; i++) {
for (j = 0; j < maxcollections; j++)
memory->destroy(stencil_multi[i][j]);
delete [] stencil_multi[i];
}
delete [] stencil_multi;
memory->destroy(maxstencil_multi);
delete [] stencil_multi;
memory->destroy(maxstencil_multi);
memory->destroy(flag_half_multi);
memory->destroy(flag_skip_multi);
memory->destroy(bin_collection_multi);
@ -295,39 +295,39 @@ void NStencil::create_setup()
memory->destroy(stencil_binsizez_multi);
memory->destroy(stencil_mbinx_multi);
memory->destroy(stencil_mbiny_multi);
memory->destroy(stencil_mbinz_multi);
}
// Allocate arrays
if (!maxstencil_multi) {
memory->create(flag_half_multi, n, n,
memory->destroy(stencil_mbinz_multi);
}
// Allocate arrays
if (!maxstencil_multi) {
memory->create(flag_half_multi, n, n,
"neighstencil:flag_half_multi");
memory->create(flag_skip_multi, n, n,
memory->create(flag_skip_multi, n, n,
"neighstencil:flag_skip_multi");
memory->create(bin_collection_multi, n, n,
memory->create(bin_collection_multi, n, n,
"neighstencil:bin_collection_multi");
memory->create(stencil_sx_multi, n, n,
"neighstencil:stencil_sx_multi");
memory->create(stencil_sy_multi, n, n,
memory->create(stencil_sx_multi, n, n,
"neighstencil:stencil_sx_multi");
memory->create(stencil_sy_multi, n, n,
"neighstencil:stencil_sy_multi");
memory->create(stencil_sz_multi, n, n,
memory->create(stencil_sz_multi, n, n,
"neighstencil:stencil_sz_multi");
memory->create(stencil_binsizex_multi, n, n,
memory->create(stencil_binsizex_multi, n, n,
"neighstencil:stencil_binsizex_multi");
memory->create(stencil_binsizey_multi, n, n,
memory->create(stencil_binsizey_multi, n, n,
"neighstencil:stencil_binsizey_multi");
memory->create(stencil_binsizez_multi, n, n,
memory->create(stencil_binsizez_multi, n, n,
"neighstencil:stencil_binsizez_multi");
memory->create(stencil_mbinx_multi, n, n,
memory->create(stencil_mbinx_multi, n, n,
"neighstencil:stencil_mbinx_multi");
memory->create(stencil_mbiny_multi, n, n,
memory->create(stencil_mbiny_multi, n, n,
"neighstencil:stencil_mbiny_multi");
memory->create(stencil_mbinz_multi, n, n,
memory->create(stencil_mbinz_multi, n, n,
"neighstencil:stencil_mbinz_multi");
memory->create(maxstencil_multi, n, n, "neighstencil::maxstencil_multi");
memory->create(nstencil_multi, n, n, "neighstencil::nstencil_multi");
stencil_multi = new int**[n]();
@ -338,38 +338,38 @@ void NStencil::create_setup()
nstencil_multi[i][j] = 0;
stencil_multi[i][j] = nullptr;
}
}
maxcollections = n;
}
maxcollections = n;
}
// Skip all stencils by default, initialize smax
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
flag_skip_multi[i][j] = 1;
flag_skip_multi[i][j] = 1;
}
}
// Determine which stencils need to be built
set_stencil_properties();
set_stencil_properties();
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
// Skip creation of unused stencils
// Skip creation of unused stencils
if (flag_skip_multi[i][j]) continue;
// Copy bin info for this pair of atom collections
bin_collection = bin_collection_multi[i][j];
stencil_binsizex_multi[i][j] = binsizex_multi[bin_collection];
stencil_binsizey_multi[i][j] = binsizey_multi[bin_collection];
stencil_binsizez_multi[i][j] = binsizez_multi[bin_collection];
stencil_mbinx_multi[i][j] = mbinx_multi[bin_collection];
stencil_mbiny_multi[i][j] = mbiny_multi[bin_collection];
stencil_mbinz_multi[i][j] = mbinz_multi[bin_collection];
stencil_range = sqrt(cutcollectionsq[i][j]);
sx = static_cast<int> (stencil_range*bininvx_multi[bin_collection]);
if (sx*binsizex_multi[bin_collection] < stencil_range) sx++;
sy = static_cast<int> (stencil_range*bininvy_multi[bin_collection]);
@ -377,13 +377,13 @@ void NStencil::create_setup()
sz = static_cast<int> (stencil_range*bininvz_multi[bin_collection]);
if (sz*binsizez_multi[bin_collection] < stencil_range) sz++;
if (dimension == 2) sz = 0;
stencil_sx_multi[i][j] = sx;
stencil_sy_multi[i][j] = sy;
stencil_sz_multi[i][j] = sz;
smax = ((2*sx+1) * (2*sy+1) * (2*sz+1));
smax = ((2*sx+1) * (2*sy+1) * (2*sz+1));
if (smax > maxstencil_multi[i][j]) {
maxstencil_multi[i][j] = smax;
if(stencil_multi[i][j])