remove trailing whitespace

This commit is contained in:
Axel Kohlmeyer
2018-03-16 12:37:27 -04:00
parent ee862d8bf5
commit 59dbb49cf9
204 changed files with 1543 additions and 1543 deletions

View File

@ -199,7 +199,7 @@ Neighbor::~Neighbor()
delete [] slist;
delete [] plist;
for (int i = 0; i < nrequest; i++)
for (int i = 0; i < nrequest; i++)
if (requests[i]) delete requests[i];
memory->sfree(requests);
for (int i = 0; i < old_nrequest; i++)
@ -527,7 +527,7 @@ void Neighbor::init_styles()
#undef NBinStyle
#undef NBIN_CLASS
binclass = new BinCreator[nbclass];
binclass = new BinCreator[nbclass];
binnames = new char*[nbclass];
binmasks = new int[nbclass];
nbclass = 0;
@ -551,7 +551,7 @@ void Neighbor::init_styles()
#undef NStencilStyle
#undef NSTENCIL_CLASS
stencilclass = new StencilCreator[nsclass];
stencilclass = new StencilCreator[nsclass];
stencilnames = new char*[nsclass];
stencilmasks = new int[nsclass];
nsclass = 0;
@ -575,7 +575,7 @@ void Neighbor::init_styles()
#undef NPairStyle
#undef NPAIR_CLASS
pairclass = new PairCreator[npclass];
pairclass = new PairCreator[npclass];
pairnames = new char*[npclass];
pairmasks = new int[npclass];
npclass = 0;
@ -669,7 +669,7 @@ int Neighbor::init_pair()
// (5) copy = convert as many lists as possible to copy lists
// order of morph methods matters:
// (3) after (2), b/c it adjusts lists created by (2)
// (4) after (2) and (3),
// (4) after (2) and (3),
// b/c (2) may create new full lists, (3) may change them
// (5) last, after all lists are finalized, so all possible copies found
@ -680,13 +680,13 @@ int Neighbor::init_pair()
morph_granular(); // this method can change flags set by requestor
morph_halffull();
morph_copy();
// create new lists, one per request including added requests
// wait to allocate initial pages until copy lists are detected
// NOTE: can I allocate now, instead of down below?
nlist = nrequest;
lists = new NeighList*[nrequest];
neigh_bin = new NBin*[nrequest];
neigh_stencil = new NStencil*[nrequest];
@ -697,11 +697,11 @@ int Neighbor::init_pair()
// only for original requests, not ones added by Neighbor class
for (i = 0; i < nrequest; i++) {
if (requests[i]->kokkos_host || requests[i]->kokkos_device)
if (requests[i]->kokkos_host || requests[i]->kokkos_device)
create_kokkos_list(i);
else lists[i] = new NeighList(lmp);
lists[i]->index = i;
if (requests[i]->pair && i < nrequest_original) {
Pair *pair = (Pair *) requests[i]->requestor;
pair->init_list(requests[i]->id,lists[i]);
@ -721,22 +721,22 @@ int Neighbor::init_pair()
lists[i]->post_constructor(requests[i]);
// assign Bin,Stencil,Pair style to each list
int flag;
for (i = 0; i < nrequest; i++) {
flag = choose_bin(requests[i]);
lists[i]->bin_method = flag;
if (flag < 0)
if (flag < 0)
error->all(FLERR,"Requested neighbor bin option does not exist");
flag = choose_stencil(requests[i]);
lists[i]->stencil_method = flag;
if (flag < 0)
if (flag < 0)
error->all(FLERR,"Requested neighbor stencil method does not exist");
flag = choose_pair(requests[i]);
lists[i]->pair_method = flag;
if (flag < 0)
if (flag < 0)
error->all(FLERR,"Requested neighbor pair method does not exist");
}
@ -821,18 +821,18 @@ int Neighbor::init_pair()
}
// allocate initial pages for each list, except if copy flag set
for (i = 0; i < nlist; i++) {
if (lists[i]->copy) continue;
lists[i]->setup_pages(pgsize,oneatom);
}
// first-time allocation of per-atom data for lists that are built and store
// lists that do not store: copy
// lists that do not store: copy
// use atom->nmax for both grow() args
// i.e. grow first time to expanded size to avoid future reallocs
// also Kokkos list initialization
int maxatom = atom->nmax;
for (i = 0; i < nlist; i++)
if (neigh_pair[i] && !lists[i]->copy) lists[i]->grow(maxatom,maxatom);
@ -841,7 +841,7 @@ int Neighbor::init_pair()
// perpetual = non-occasional, re-built at every reneighboring
// slist = indices of perpetual NStencil classes
// perpetual = used by any perpetual NPair class
delete [] slist;
delete [] plist;
nstencil_perpetual = npair_perpetual = 0;
@ -852,11 +852,11 @@ int Neighbor::init_pair()
if (lists[i]->occasional == 0 && lists[i]->pair_method)
plist[npair_perpetual++] = i;
}
for (i = 0; i < nstencil; i++) {
flag = 0;
for (j = 0; j < npair_perpetual; j++)
if (lists[plist[j]]->stencil_method == neigh_stencil[i]->istyle)
if (lists[plist[j]]->stencil_method == neigh_stencil[i]->istyle)
flag = 1;
if (flag) slist[nstencil_perpetual++] = i;
}
@ -913,7 +913,7 @@ int Neighbor::init_pair()
void Neighbor::morph_unique()
{
NeighRequest *irq;
for (int i = 0; i < nrequest; i++) {
irq = requests[i];
@ -955,7 +955,7 @@ void Neighbor::morph_skip()
for (j = 0; j < nrequest; j++) {
if (i == j) continue;
jrq = requests[j];
// can only skip from a perpetual non-skip list
if (jrq->occasional) continue;
@ -970,7 +970,7 @@ void Neighbor::morph_skip()
// IJ newton = 1 for newton on, 2 for newton off
inewton = irq->newton;
if (inewton == 0) inewton = force->newton_pair ? 1 : 2;
if (inewton == 0) inewton = force->newton_pair ? 1 : 2;
jnewton = jrq->newton;
if (jnewton == 0) jnewton = force->newton_pair ? 1 : 2;
if (inewton != jnewton) continue;
@ -1151,7 +1151,7 @@ void Neighbor::morph_halffull()
break;
}
// if matching list exists, point to it
if (j < nrequest) {
@ -1170,7 +1170,7 @@ void Neighbor::morph_copy()
{
int i,j,inewton,jnewton;
NeighRequest *irq,*jrq;
for (i = 0; i < nrequest; i++) {
irq = requests[i];
@ -1205,7 +1205,7 @@ void Neighbor::morph_copy()
// IJ newton = 1 for newton on, 2 for newton off
inewton = irq->newton;
if (inewton == 0) inewton = force->newton_pair ? 1 : 2;
if (inewton == 0) inewton = force->newton_pair ? 1 : 2;
jnewton = jrq->newton;
if (jnewton == 0) jnewton = force->newton_pair ? 1 : 2;
if (inewton != jnewton) continue;
@ -1343,11 +1343,11 @@ void Neighbor::init_topology()
else bondwhich = ALL;
if (!neigh_bond || bondwhich != old_bondwhich) {
delete neigh_bond;
if (bondwhich == ALL)
if (bondwhich == ALL)
neigh_bond = new NTopoBondAll(lmp);
else if (bondwhich == PARTIAL)
else if (bondwhich == PARTIAL)
neigh_bond = new NTopoBondPartial(lmp);
else if (bondwhich == TEMPLATE)
else if (bondwhich == TEMPLATE)
neigh_bond = new NTopoBondTemplate(lmp);
}
}
@ -1359,11 +1359,11 @@ void Neighbor::init_topology()
else anglewhich = ALL;
if (!neigh_angle || anglewhich != old_anglewhich) {
delete neigh_angle;
if (anglewhich == ALL)
if (anglewhich == ALL)
neigh_angle = new NTopoAngleAll(lmp);
else if (anglewhich == PARTIAL)
else if (anglewhich == PARTIAL)
neigh_angle = new NTopoAnglePartial(lmp);
else if (anglewhich == TEMPLATE)
else if (anglewhich == TEMPLATE)
neigh_angle = new NTopoAngleTemplate(lmp);
}
}
@ -1375,11 +1375,11 @@ void Neighbor::init_topology()
else dihedralwhich = ALL;
if (!neigh_dihedral || dihedralwhich != old_dihedralwhich) {
delete neigh_dihedral;
if (dihedralwhich == ALL)
if (dihedralwhich == ALL)
neigh_dihedral = new NTopoDihedralAll(lmp);
else if (dihedralwhich == PARTIAL)
else if (dihedralwhich == PARTIAL)
neigh_dihedral = new NTopoDihedralPartial(lmp);
else if (dihedralwhich == TEMPLATE)
else if (dihedralwhich == TEMPLATE)
neigh_dihedral = new NTopoDihedralTemplate(lmp);
}
}
@ -1391,11 +1391,11 @@ void Neighbor::init_topology()
else improperwhich = ALL;
if (!neigh_improper || improperwhich != old_improperwhich) {
delete neigh_improper;
if (improperwhich == ALL)
if (improperwhich == ALL)
neigh_improper = new NTopoImproperAll(lmp);
else if (improperwhich == PARTIAL)
else if (improperwhich == PARTIAL)
neigh_improper = new NTopoImproperPartial(lmp);
else if (improperwhich == TEMPLATE)
else if (improperwhich == TEMPLATE)
neigh_improper = new NTopoImproperTemplate(lmp);
}
}
@ -1449,7 +1449,7 @@ void Neighbor::print_pairwise_info()
fprintf(out," binsize = %g, bins = %g %g %g\n",binsize,
ceil(bbox[0]/binsize), ceil(bbox[1]/binsize),
ceil(bbox[2]/binsize));
fprintf(out," %d neighbor lists, "
"perpetual/occasional/extra = %d %d %d\n",
nlist,nperpetual,noccasional,nextra);
@ -1478,7 +1478,7 @@ void Neighbor::print_pairwise_info()
if (rq->copy)
fprintf(out,", copy from (%d)",rq->copylist+1);
else if (rq->halffull)
else if (rq->halffull)
fprintf(out,", half/full from (%d)",rq->halffulllist+1);
else if (rq->skip)
fprintf(out,", skip from (%d)",rq->skiplist+1);
@ -1496,7 +1496,7 @@ void Neighbor::print_pairwise_info()
else fprintf(out,", newton off");
} else if (rq->newton == 1) fprintf(out,", newton on");
else if (rq->newton == 2) fprintf(out,", newton off");
if (rq->ghost) fprintf(out,", ghost");
if (rq->size) fprintf(out,", size");
if (rq->history) fprintf(out,", history");
@ -1516,17 +1516,17 @@ void Neighbor::print_pairwise_info()
fprintf(out," ");
if (lists[i]->pair_method == 0) fprintf(out,"pair build: none\n");
else fprintf(out,"pair build: %s\n",pairnames[lists[i]->pair_method-1]);
fprintf(out," ");
if (lists[i]->stencil_method == 0) fprintf(out,"stencil: none\n");
else fprintf(out,"stencil: %s\n",
stencilnames[lists[i]->stencil_method-1]);
fprintf(out," ");
if (lists[i]->bin_method == 0) fprintf(out,"bin: none\n");
else fprintf(out,"bin: %s\n",binnames[lists[i]->bin_method-1]);
}
/*
fprintf(out," %d stencil methods\n",nstencil);
for (i = 0; i < nstencil; i++)
@ -1540,7 +1540,7 @@ void Neighbor::print_pairwise_info()
}
}
}
/* ----------------------------------------------------------------------
make copy of current requests and Neighbor params
used to compare to when next run occurs
@ -1663,7 +1663,7 @@ int Neighbor::choose_stencil(NeighRequest *rq)
// mask & NS_NEWTOFF,mask & NS_GHOST,mask & NS_SSA);
// exactly one of half or full is set and must match
if (rq->half) {
if (!(mask & NS_HALF)) continue;
} else if (rq->full) {
@ -1678,7 +1678,7 @@ int Neighbor::choose_stencil(NeighRequest *rq)
if (!(mask & NS_NEWTOFF)) continue;
}
// require match of these request flags and mask bits
// require match of these request flags and mask bits
// (!A != !B) is effectively a logical xor
if (!rq->ghost != !(mask & NS_GHOST)) continue;
@ -1701,7 +1701,7 @@ int Neighbor::choose_stencil(NeighRequest *rq)
}
// domain triclinic flag is on or off and must match
if (triclinic) {
if (!(mask & NS_TRI)) continue;
} else if (!triclinic) {
@ -1741,7 +1741,7 @@ int Neighbor::choose_pair(NeighRequest *rq)
else if (rq->newton == 2) newtflag = 0;
int molecular = atom->molecular;
//printf("PAIR RQ FLAGS: hf %d %d n %d g %d sz %d gos %d r %d b %d o %d i %d "
// "kk %d %d ss %d dn %d sk %d cp %d hf %d oo %d\n",
// rq->half,rq->full,rq->newton,rq->ghost,rq->size,
@ -1795,7 +1795,7 @@ int Neighbor::choose_pair(NeighRequest *rq)
if (mask & NP_MOLONLY) continue;
}
// require match of these request flags and mask bits
// require match of these request flags and mask bits
// (!A != !B) is effectively a logical xor
if (!rq->ghost != !(mask & NP_GHOST)) continue;
@ -1809,7 +1809,7 @@ int Neighbor::choose_pair(NeighRequest *rq)
if (!rq->kokkos_device != !(mask & NP_KOKKOS_DEVICE)) continue;
if (!rq->kokkos_host != !(mask & NP_KOKKOS_HOST)) continue;
if (!rq->ssa != !(mask & NP_SSA)) continue;
if (!rq->skip != !(mask & NP_SKIP)) continue;
if (!rq->halffull != !(mask & NP_HALF_FULL)) continue;
@ -2129,7 +2129,7 @@ void Neighbor::build_one(class NeighList *mylist, int preflag)
// build_one() should never be invoked on a perpetual list
if (!mylist->occasional)
if (!mylist->occasional)
error->all(FLERR,"Neighbor build one invoked on perpetual list");
// no need to build if already built since last re-neighbor
@ -2147,7 +2147,7 @@ void Neighbor::build_one(class NeighList *mylist, int preflag)
// if this is copy list and parent is occasional list,
// or this is halffull and parent is occasional list,
// insure parent is current
// insure parent is current
if (mylist->listcopy && mylist->listcopy->occasional)
build_one(mylist->listcopy,preflag);
@ -2325,7 +2325,7 @@ void Neighbor::modify_params(int narg, char **arg)
ex_mol_intra[nex_mol] = 0;
nex_mol++;
iarg += 3;
} else if (strcmp(arg[iarg+1],"none") == 0) {
nex_type = nex_group = nex_mol = 0;
iarg += 2;
@ -2348,9 +2348,9 @@ void Neighbor::exclusion_group_group_delete(int group1, int group2)
break;
mlast = m;
if (mlast == nex_group)
if (mlast == nex_group)
error->all(FLERR,"Unable to find group-group exclusion");
for (m = mlast+1; m < nex_group; m++) {
ex1_group[m-1] = ex1_group[m];
ex2_group[m-1] = ex2_group[m];