forked from lijiext/lammps
remove trailing whitespace
This commit is contained in:
parent
d83cf8e4b0
commit
646dc83394
|
@ -118,7 +118,7 @@ int AtomVec::grow_nmax_bonus(int nmax_bonus)
|
|||
bigint AtomVec::roundup(bigint n)
|
||||
{
|
||||
if (n % DELTA) n = n/DELTA * DELTA + DELTA;
|
||||
if (n > MAXSMALLINT)
|
||||
if (n > MAXSMALLINT)
|
||||
error->one(FLERR,"Too many atoms created on one or more procs");
|
||||
return n;
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ void CreateAtoms::command(int narg, char **arg)
|
|||
subsetflag = RATIO;
|
||||
subsetfrac = force->numeric(FLERR,arg[iarg+1]);
|
||||
subsetseed = force->inumeric(FLERR,arg[iarg+2]);
|
||||
if (subsetfrac <= 0.0 || subsetfrac > 1.0 || subsetseed <= 0)
|
||||
if (subsetfrac <= 0.0 || subsetfrac > 1.0 || subsetseed <= 0)
|
||||
error->all(FLERR,"Illegal create_atoms command");
|
||||
iarg += 3;
|
||||
} else if (strcmp(arg[iarg],"subset") == 0) {
|
||||
|
@ -213,7 +213,7 @@ void CreateAtoms::command(int narg, char **arg)
|
|||
subsetflag = SUBSET;
|
||||
nsubset = force->bnumeric(FLERR,arg[iarg+1]);
|
||||
subsetseed = force->inumeric(FLERR,arg[iarg+2]);
|
||||
if (nsubset <= 0 || subsetseed <= 0)
|
||||
if (nsubset <= 0 || subsetseed <= 0)
|
||||
error->all(FLERR,"Illegal create_atoms command");
|
||||
iarg += 3;
|
||||
} else error->all(FLERR,"Illegal create_atoms command");
|
||||
|
@ -805,7 +805,7 @@ void CreateAtoms::add_lattice()
|
|||
// rough estimate of total time used for create atoms
|
||||
// one inner loop takes about 25ns on a typical desktop CPU core in 2019
|
||||
// maxestimate = time in hours
|
||||
|
||||
|
||||
double estimate = 2.5e-8/3600.0;
|
||||
estimate *= static_cast<double> (khi-klo+1);
|
||||
estimate *= static_cast<double> (jhi-jlo+1);
|
||||
|
@ -831,7 +831,7 @@ void CreateAtoms::add_lattice()
|
|||
|
||||
int overflow;
|
||||
MPI_Allreduce(&nlatt_overflow,&overflow,1,MPI_INT,MPI_SUM,world);
|
||||
if (overflow)
|
||||
if (overflow)
|
||||
error->all(FLERR,"Create_atoms lattice size overflow on 1 or more procs");
|
||||
|
||||
bigint nadd;
|
||||
|
@ -850,7 +850,7 @@ void CreateAtoms::add_lattice()
|
|||
if (nprocs == 1) nadd = nsubset;
|
||||
else nadd = static_cast<bigint> (LB_FACTOR * nsubset/bnlattall * nlatt);
|
||||
}
|
||||
|
||||
|
||||
// allocate atom arrays to size N, rounded up by AtomVec->DELTA
|
||||
|
||||
bigint nbig = atom->avec->roundup(nadd + atom->nlocal);
|
||||
|
@ -895,13 +895,13 @@ void CreateAtoms::loop_lattice(int action)
|
|||
for (m = 0; m < nbasis; m++) {
|
||||
double *coord;
|
||||
double x[3],lamda[3];
|
||||
|
||||
|
||||
x[0] = i + basis[m][0];
|
||||
x[1] = j + basis[m][1];
|
||||
x[2] = k + basis[m][2];
|
||||
|
||||
// convert from lattice coords to box coords
|
||||
|
||||
|
||||
domain->lattice->lattice2box(x[0],x[1],x[2]);
|
||||
|
||||
// if a region was specified, test if atom is in it
|
||||
|
@ -910,20 +910,20 @@ void CreateAtoms::loop_lattice(int action)
|
|||
if (!domain->regions[nregion]->match(x[0],x[1],x[2])) continue;
|
||||
|
||||
// if variable test specified, eval variable
|
||||
|
||||
|
||||
if (varflag && vartest(x) == 0) continue;
|
||||
|
||||
|
||||
// test if atom/molecule position is in my subbox
|
||||
|
||||
|
||||
if (triclinic) {
|
||||
domain->x2lamda(x,lamda);
|
||||
coord = lamda;
|
||||
} else coord = x;
|
||||
|
||||
|
||||
if (coord[0] < sublo[0] || coord[0] >= subhi[0] ||
|
||||
coord[1] < sublo[1] || coord[1] >= subhi[1] ||
|
||||
coord[2] < sublo[2] || coord[2] >= subhi[2]) continue;
|
||||
|
||||
|
||||
// this proc owns the lattice site
|
||||
// perform action: add, just count, add if flagged
|
||||
// add = add an atom or entire molecule to my list of atoms
|
||||
|
|
|
@ -45,7 +45,7 @@ class CreateAtoms : protected Pointers {
|
|||
|
||||
int ilo,ihi,jlo,jhi,klo,khi;
|
||||
|
||||
int nlatt; // number of owned lattice sites
|
||||
int nlatt; // number of owned lattice sites
|
||||
int nlatt_overflow; // 1 if local nlatt exceeds a 32-bit int
|
||||
|
||||
int *flag; // flag subset of particles to insert on lattice
|
||||
|
|
|
@ -223,18 +223,18 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next)
|
|||
}
|
||||
|
||||
// bound thresh for RNG accuracy
|
||||
|
||||
|
||||
thresh = MAX(thresh,0.01);
|
||||
thresh = MIN(thresh,0.99);
|
||||
|
||||
// new empty active sets for next iteration
|
||||
|
||||
|
||||
newactive[0] = newactive[1] = 0;
|
||||
newfirst[0] = newfirst[1] = -1;
|
||||
newlast[0] = newlast[1] = -1;
|
||||
|
||||
// index = first value in ADD or SUBTRACT set
|
||||
|
||||
|
||||
if (mode == ADD) newvalue = 1;
|
||||
else if (mode == SUBTRACT) newvalue = 0;
|
||||
index = first[mode];
|
||||
|
@ -242,7 +242,7 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next)
|
|||
// flip marks from 0 -> 1 (ADD) or 1 -> 0 (SUBTRACT)
|
||||
// loop over active set via next vector = linked list
|
||||
// flip each value based on RN < thresh
|
||||
|
||||
|
||||
nflip = 0;
|
||||
while (index >= 0) {
|
||||
if (uniform() < thresh) {
|
||||
|
@ -254,7 +254,7 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next)
|
|||
|
||||
// oldindex can now be appended to a new active set
|
||||
// which = which of two new active sets to append to
|
||||
|
||||
|
||||
which = mark[oldindex];
|
||||
newactive[which]++;
|
||||
if (newfirst[which] < 0) newfirst[which] = oldindex;
|
||||
|
@ -264,13 +264,13 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next)
|
|||
|
||||
// set active sets for next iteration to the new ones
|
||||
// next vector is already updated
|
||||
|
||||
|
||||
active[0] = newactive[0];
|
||||
active[1] = newactive[1];
|
||||
active[1] = newactive[1];
|
||||
first[0] = newfirst[0];
|
||||
first[1] = newfirst[1];
|
||||
first[1] = newfirst[1];
|
||||
last[0] = newlast[0];
|
||||
last[1] = newlast[1];
|
||||
last[1] = newlast[1];
|
||||
}
|
||||
|
||||
// update nmark and activeall
|
||||
|
@ -289,7 +289,7 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next)
|
|||
else if (mode == SUBTRACT) nmark -= nflipall;
|
||||
|
||||
niter++;
|
||||
|
||||
|
||||
// DEBUG output of stats
|
||||
|
||||
//if (comm->me == 0) printf("%d %ld %ld %g %ld\n",
|
||||
|
|
|
@ -442,7 +442,7 @@ void ReadData::command(int narg, char **arg)
|
|||
atom->deallocate_topology();
|
||||
|
||||
// allocate atom arrays to N, rounded up by increment of DELTA
|
||||
|
||||
|
||||
bigint nbig = n;
|
||||
nbig = atom->avec->roundup(nbig);
|
||||
n = static_cast<int> (nbig);
|
||||
|
|
|
@ -167,7 +167,7 @@ void ReadRestart::command(int narg, char **arg)
|
|||
atom->deallocate_topology();
|
||||
|
||||
// allocate atom arrays to size N, rounded up by AtomVec->DELTA
|
||||
|
||||
|
||||
bigint nbig = n;
|
||||
nbig = atom->avec->roundup(nbig);
|
||||
n = static_cast<int> (nbig);
|
||||
|
@ -220,7 +220,7 @@ void ReadRestart::command(int narg, char **arg)
|
|||
|
||||
// can calculate number of atoms from assignedChunkSize
|
||||
|
||||
if (!nextra) {
|
||||
if (!nextra) {
|
||||
atom->nlocal = 1; // temporarily claim there is one atom...
|
||||
int perAtomSize = avec->size_restart(); // ...so we can get its size
|
||||
atom->nlocal = 0; // restore nlocal to zero atoms
|
||||
|
|
|
@ -225,7 +225,7 @@ void Replicate::command(int narg, char **arg)
|
|||
atom->allocate_type_arrays();
|
||||
|
||||
// allocate atom arrays to size N, rounded up by AtomVec->DELTA
|
||||
|
||||
|
||||
bigint nbig = n;
|
||||
nbig = atom->avec->roundup(nbig);
|
||||
n = static_cast<int> (nbig);
|
||||
|
|
Loading…
Reference in New Issue