whitespace
This commit is contained in:
@ -391,13 +391,13 @@ void ComputeVoronoi::checkOccupation()
|
||||
|
||||
int i, j, k;
|
||||
double rx, ry, rz;
|
||||
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
int nall = atom->nghost + nlocal;
|
||||
double **x = atom->x;
|
||||
|
||||
// prepare destination buffer for variable evaluation
|
||||
|
||||
|
||||
if (atom->nmax > lmax) {
|
||||
memory->destroy(lnext);
|
||||
lmax = atom->nmax;
|
||||
@ -432,7 +432,7 @@ void ComputeVoronoi::checkOccupation()
|
||||
}
|
||||
|
||||
// MPI sum occupation
|
||||
|
||||
|
||||
#ifdef NOTINPLACE
|
||||
memcpy(sendocc, occvec, oldnatoms*sizeof(*occvec));
|
||||
MPI_Allreduce(sendocc, occvec, oldnatoms, MPI_INT, MPI_SUM, world);
|
||||
@ -441,7 +441,7 @@ void ComputeVoronoi::checkOccupation()
|
||||
#endif
|
||||
|
||||
// determine the total number of atoms in this atom's currently occupied cell
|
||||
|
||||
|
||||
int c;
|
||||
for (i=0; i<oldnall; i++) { // loop over lroot (old voronoi cells)
|
||||
// count
|
||||
@ -464,7 +464,7 @@ void ComputeVoronoi::checkOccupation()
|
||||
// but take into account that new atoms might have been added to
|
||||
// the system, so we can only look up occupancy for tags that are
|
||||
// smaller or equal to the recorded largest tag.
|
||||
|
||||
|
||||
for (i=0; i<nlocal; i++) {
|
||||
tagint mytag = atom->tag[i];
|
||||
if (mytag > oldmaxtag)
|
||||
@ -479,7 +479,7 @@ void ComputeVoronoi::checkOccupation()
|
||||
void ComputeVoronoi::loopCells()
|
||||
{
|
||||
// invoke voro++ and fetch results for owned atoms in group
|
||||
|
||||
|
||||
voronoicell_neighbor c;
|
||||
int i;
|
||||
if (faces_flag) nfaces = 0;
|
||||
|
||||
@ -40,7 +40,7 @@ enum{UNDECIDED,PERATOM,LOCAL}; // same as in ComputeReduceRegion
|
||||
void abs_max(void *in, void *inout, int * /*len*/, MPI_Datatype * /*type*/)
|
||||
{
|
||||
// r is the already reduced value, n is the new value
|
||||
|
||||
|
||||
double n = std::fabs(*(double *) in), r = *(double *) inout;
|
||||
double m;
|
||||
|
||||
@ -55,7 +55,7 @@ void abs_max(void *in, void *inout, int * /*len*/, MPI_Datatype * /*type*/)
|
||||
void abs_min(void *in, void *inout, int * /*len*/, MPI_Datatype * /*type*/)
|
||||
{
|
||||
// r is the already reduced value, n is the new value
|
||||
|
||||
|
||||
double n = std::fabs(*(double *) in), r = *(double *) inout;
|
||||
double m;
|
||||
|
||||
@ -270,7 +270,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
|
||||
error->all(FLERR, "Compute {} compute {} does not calculate a per-atom array", style, val.id);
|
||||
if (val.argindex && val.argindex > val.val.c->size_peratom_cols)
|
||||
error->all(FLERR, "Compute {} compute {} array is accessed out-of-range", style, val.id);
|
||||
|
||||
|
||||
} else if (input_mode == LOCAL) {
|
||||
if (!val.val.c->peratom_flag)
|
||||
error->all(FLERR, "Compute {} compute {} does not calculate local values", style, val.id);
|
||||
@ -295,7 +295,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
|
||||
error->all(FLERR, "Compute {} fix {} does not calculate a per-atom array", style, val.id);
|
||||
if (val.argindex && (val.argindex > val.val.f->size_peratom_cols))
|
||||
error->all(FLERR, "Compute {} fix {} array is accessed out-of-range", style, val.id);
|
||||
|
||||
|
||||
} else if (input_mode == LOCAL) {
|
||||
if (!val.val.f->local_flag)
|
||||
error->all(FLERR, "Compute {} fix {} does not calculate local values", style, val.id);
|
||||
|
||||
@ -61,7 +61,7 @@ double ComputeReduceRegion::compute_one(int m, int flag)
|
||||
|
||||
// initialization in case it has not yet been run, e.g. when
|
||||
// the compute was invoked right after it has been created
|
||||
|
||||
|
||||
if ((val.which == ArgInfo::COMPUTE) || (val.which == ArgInfo::FIX)) {
|
||||
if (val.val.c == nullptr) init();
|
||||
}
|
||||
|
||||
@ -1502,7 +1502,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
// equal-style variable is being evaluated
|
||||
|
||||
if (style[ivar] == EQUAL) {
|
||||
|
||||
|
||||
// c_ID = scalar from global scalar
|
||||
|
||||
if (lowercase && nbracket == 0) {
|
||||
@ -1588,7 +1588,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
// C_ID[i][j] = scalar element of per-atom array, note uppercase "C"
|
||||
|
||||
} else if (!lowercase && nbracket == 2) {
|
||||
|
||||
|
||||
if (!compute->peratom_flag)
|
||||
print_var_error(FLERR,"Mismatched compute in variable formula",ivar);
|
||||
if (!compute->size_peratom_cols)
|
||||
@ -1612,13 +1612,13 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
tree,treestack,ntreestack,argstack,nargstack);
|
||||
|
||||
// no other possibilities for equal-style variable, so error
|
||||
|
||||
|
||||
} else print_var_error(FLERR,"Mismatched compute in variable formula",ivar);
|
||||
|
||||
// vector-style variable is being evaluated
|
||||
|
||||
} else if (style[ivar] == VECTOR) {
|
||||
|
||||
|
||||
// c_ID = vector from global vector
|
||||
|
||||
if (lowercase && nbracket == 0) {
|
||||
@ -1641,7 +1641,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
newtree->nvector = compute->size_vector;
|
||||
newtree->nstride = 1;
|
||||
treestack[ntreestack++] = newtree;
|
||||
|
||||
|
||||
// c_ID[i] = vector from global array
|
||||
|
||||
} else if (lowercase && nbracket == 1) {
|
||||
@ -1666,15 +1666,15 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
newtree->nvector = compute->size_array_rows;
|
||||
newtree->nstride = compute->size_array_cols;
|
||||
treestack[ntreestack++] = newtree;
|
||||
|
||||
|
||||
// no other possibilities for vector-style variable, so error
|
||||
|
||||
|
||||
} else print_var_error(FLERR,"Mismatched compute in variable formula",ivar);
|
||||
|
||||
// atom-style variable is being evaluated
|
||||
|
||||
} else if (style[ivar] == ATOM) {
|
||||
|
||||
|
||||
// c_ID = vector from per-atom vector
|
||||
|
||||
if (lowercase && nbracket == 0) {
|
||||
@ -1696,7 +1696,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
newtree->array = compute->vector_atom;
|
||||
newtree->nstride = 1;
|
||||
treestack[ntreestack++] = newtree;
|
||||
|
||||
|
||||
// c_ID[i] = vector from per-atom array
|
||||
|
||||
} else if (lowercase && nbracket == 1) {
|
||||
@ -1724,10 +1724,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
treestack[ntreestack++] = newtree;
|
||||
|
||||
// no other possibilities for atom-style variable, so error
|
||||
|
||||
|
||||
} else print_var_error(FLERR,"Mismatched compute in variable formula",ivar);
|
||||
}
|
||||
|
||||
|
||||
// ----------------
|
||||
// fix
|
||||
// ----------------
|
||||
@ -1770,7 +1770,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
// equal-style variable is being evaluated
|
||||
|
||||
if (style[ivar] == EQUAL) {
|
||||
|
||||
|
||||
// f_ID = scalar from global scalar
|
||||
|
||||
if (lowercase && nbracket == 0) {
|
||||
@ -1826,14 +1826,14 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
if (update->whichflag > 0 &&
|
||||
update->ntimestep % fix->peratom_freq)
|
||||
print_var_error(FLERR,"Fix in variable not computed at a compatible time",ivar);
|
||||
|
||||
|
||||
peratom2global(1,nullptr,fix->vector_atom,1,index1,tree,
|
||||
treestack,ntreestack,argstack,nargstack);
|
||||
|
||||
// F_ID[i][j] = scalar element of per-atom array, note uppercase "F"
|
||||
|
||||
} else if (!lowercase && nbracket == 2) {
|
||||
|
||||
|
||||
if (!fix->peratom_flag)
|
||||
print_var_error(FLERR,"Mismatched fix in variable formula",ivar);
|
||||
if (!fix->size_peratom_cols)
|
||||
@ -1852,13 +1852,13 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
tree,treestack,ntreestack,argstack,nargstack);
|
||||
|
||||
// no other possibilities for equal-style variable, so error
|
||||
|
||||
|
||||
} else print_var_error(FLERR,"Mismatched fix in variable formula",ivar);
|
||||
|
||||
// vector-style variable is being evaluated
|
||||
|
||||
} else if (style[ivar] == VECTOR) {
|
||||
|
||||
|
||||
// f_ID = vector from global vector
|
||||
|
||||
if (lowercase && nbracket == 0) {
|
||||
@ -1875,7 +1875,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
memory->create(vec,nvec,"variable:values");
|
||||
for (int m = 0; m < nvec; m++)
|
||||
vec[m] = fix->compute_vector(m);
|
||||
|
||||
|
||||
auto newtree = new Tree();
|
||||
newtree->type = VECTORARRAY;
|
||||
newtree->array = vec;
|
||||
@ -1883,7 +1883,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
newtree->nstride = 1;
|
||||
newtree->selfalloc = 1;
|
||||
treestack[ntreestack++] = newtree;
|
||||
|
||||
|
||||
// f_ID[i] = vector from global array
|
||||
|
||||
} else if (lowercase && nbracket == 1) {
|
||||
@ -1910,15 +1910,15 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
newtree->nstride = 1;
|
||||
newtree->selfalloc = 1;
|
||||
treestack[ntreestack++] = newtree;
|
||||
|
||||
|
||||
// no other possibilities for vector-style variable, so error
|
||||
|
||||
|
||||
} else print_var_error(FLERR,"Mismatched fix in variable formula",ivar);
|
||||
|
||||
// atom-style variable is being evaluated
|
||||
|
||||
} else if (style[ivar] == ATOM) {
|
||||
|
||||
|
||||
// f_ID = vector from per-atom vector
|
||||
|
||||
if (lowercase && nbracket == 0) {
|
||||
@ -1935,7 +1935,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
newtree->array = fix->vector_atom;
|
||||
newtree->nstride = 1;
|
||||
treestack[ntreestack++] = newtree;
|
||||
|
||||
|
||||
// f_ID[i] = vector from per-atom array
|
||||
|
||||
} else if (lowercase && nbracket == 1) {
|
||||
@ -1958,7 +1958,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
treestack[ntreestack++] = newtree;
|
||||
|
||||
// no other possibilities for atom-style variable, so error
|
||||
|
||||
|
||||
} else print_var_error(FLERR,"Mismatched fix in variable formula",ivar);
|
||||
}
|
||||
|
||||
@ -2053,21 +2053,21 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
print_var_error(FLERR,"Atom-style variable in equal-style variable formula",ivar);
|
||||
if (treetype == VECTOR)
|
||||
print_var_error(FLERR,"Atom-style variable in vector-style variable formula",ivar);
|
||||
|
||||
|
||||
Tree *newtree = nullptr;
|
||||
evaluate(data[ivar][0],&newtree,ivar);
|
||||
treestack[ntreestack++] = newtree;
|
||||
|
||||
// vector from atomfile-style variable
|
||||
// point to the values in FixStore instance
|
||||
|
||||
|
||||
} else if (style[ivar] == ATOMFILE) {
|
||||
|
||||
if (tree == nullptr)
|
||||
print_var_error(FLERR,"Atomfile-style variable in equal-style variable formula",ivar);
|
||||
if (treetype == VECTOR)
|
||||
print_var_error(FLERR,"Atomfile-style variable in vector-style variable formula",ivar);
|
||||
|
||||
|
||||
auto newtree = new Tree();
|
||||
newtree->type = ATOMARRAY;
|
||||
newtree->array = reader[ivar]->fixstore->vstore;
|
||||
@ -2121,7 +2121,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
tree,treestack,ntreestack,argstack,nargstack);
|
||||
|
||||
// no other possibilities for variable with one bracket
|
||||
|
||||
|
||||
} else print_var_error(FLERR,"Mismatched variable in variable formula",ivar);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user