move enum{SINGLE,MULTI} and enum{MULTIPLE} to Comm in comm.h
This commit is contained in:
@ -46,7 +46,6 @@ using namespace LAMMPS_NS;
|
||||
#define BUFEXTRA 1000
|
||||
#define BIG 1.0e20
|
||||
|
||||
enum{SINGLE,MULTI}; // same as in Comm
|
||||
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -71,7 +70,7 @@ CommBrick::CommBrick(LAMMPS *lmp) :
|
||||
CommBrick::~CommBrick()
|
||||
{
|
||||
free_swap();
|
||||
if (mode == MULTI) {
|
||||
if (mode == Comm::MULTI) {
|
||||
free_multi();
|
||||
memory->destroy(cutghostmulti);
|
||||
}
|
||||
@ -144,11 +143,11 @@ void CommBrick::init()
|
||||
|
||||
// memory for multi-style communication
|
||||
|
||||
if (mode == MULTI && multilo == NULL) {
|
||||
if (mode == Comm::MULTI && multilo == NULL) {
|
||||
allocate_multi(maxswap);
|
||||
memory->create(cutghostmulti,atom->ntypes+1,3,"comm:cutghostmulti");
|
||||
}
|
||||
if (mode == SINGLE && multilo) {
|
||||
if (mode == Comm::SINGLE && multilo) {
|
||||
free_multi();
|
||||
memory->destroy(cutghostmulti);
|
||||
}
|
||||
@ -184,7 +183,7 @@ void CommBrick::setup()
|
||||
subhi = domain->subhi;
|
||||
cutghost[0] = cutghost[1] = cutghost[2] = cut;
|
||||
|
||||
if (mode == MULTI) {
|
||||
if (mode == Comm::MULTI) {
|
||||
double *cuttype = neighbor->cuttype;
|
||||
for (i = 1; i <= ntypes; i++) {
|
||||
cut = 0.0;
|
||||
@ -208,7 +207,7 @@ void CommBrick::setup()
|
||||
length2 = h_inv[2];
|
||||
cutghost[2] = cut * length2;
|
||||
|
||||
if (mode == MULTI) {
|
||||
if (mode == Comm::MULTI) {
|
||||
double *cuttype = neighbor->cuttype;
|
||||
for (i = 1; i <= ntypes; i++) {
|
||||
cut = 0.0;
|
||||
@ -357,7 +356,7 @@ void CommBrick::setup()
|
||||
if (ineed % 2 == 0) {
|
||||
sendproc[iswap] = procneigh[dim][0];
|
||||
recvproc[iswap] = procneigh[dim][1];
|
||||
if (mode == SINGLE) {
|
||||
if (mode == Comm::SINGLE) {
|
||||
if (ineed < 2) slablo[iswap] = -BIG;
|
||||
else slablo[iswap] = 0.5 * (sublo[dim] + subhi[dim]);
|
||||
slabhi[iswap] = sublo[dim] + cutghost[dim];
|
||||
@ -380,7 +379,7 @@ void CommBrick::setup()
|
||||
} else {
|
||||
sendproc[iswap] = procneigh[dim][1];
|
||||
recvproc[iswap] = procneigh[dim][0];
|
||||
if (mode == SINGLE) {
|
||||
if (mode == Comm::SINGLE) {
|
||||
slablo[iswap] = subhi[dim] - cutghost[dim];
|
||||
if (ineed < 2) slabhi[iswap] = BIG;
|
||||
else slabhi[iswap] = 0.5 * (sublo[dim] + subhi[dim]);
|
||||
@ -737,7 +736,7 @@ void CommBrick::borders()
|
||||
// store sent atom indices in sendlist for use in future timesteps
|
||||
|
||||
x = atom->x;
|
||||
if (mode == SINGLE) {
|
||||
if (mode == Comm::SINGLE) {
|
||||
lo = slablo[iswap];
|
||||
hi = slabhi[iswap];
|
||||
} else {
|
||||
@ -766,7 +765,7 @@ void CommBrick::borders()
|
||||
|
||||
if (sendflag) {
|
||||
if (!bordergroup || ineed >= 2) {
|
||||
if (mode == SINGLE) {
|
||||
if (mode == Comm::SINGLE) {
|
||||
for (i = nfirst; i < nlast; i++)
|
||||
if (x[i][dim] >= lo && x[i][dim] <= hi) {
|
||||
if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
|
||||
@ -783,7 +782,7 @@ void CommBrick::borders()
|
||||
}
|
||||
|
||||
} else {
|
||||
if (mode == SINGLE) {
|
||||
if (mode == Comm::SINGLE) {
|
||||
ngroup = atom->nfirst;
|
||||
for (i = 0; i < ngroup; i++)
|
||||
if (x[i][dim] >= lo && x[i][dim] <= hi) {
|
||||
@ -1396,7 +1395,7 @@ void CommBrick::grow_swap(int n)
|
||||
{
|
||||
free_swap();
|
||||
allocate_swap(n);
|
||||
if (mode == MULTI) {
|
||||
if (mode == Comm::MULTI) {
|
||||
free_multi();
|
||||
allocate_multi(n);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user