remove some more trailing whitespace
This commit is contained in:
@ -52,6 +52,6 @@ void AngleDeprecated::settings(int, char **)
|
|||||||
writemsg(lmp,"\nAngle style 'DEPRECATED' is a dummy style\n\n",0);
|
writemsg(lmp,"\nAngle style 'DEPRECATED' is a dummy style\n\n",0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -52,6 +52,6 @@ void BondDeprecated::settings(int, char **)
|
|||||||
writemsg(lmp,"\nBond style 'DEPRECATED' is a dummy style\n\n",0);
|
writemsg(lmp,"\nBond style 'DEPRECATED' is a dummy style\n\n",0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@ enum{DEGREE, RADIAN, COSINE};
|
|||||||
|
|
||||||
ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) :
|
ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Compute(lmp, narg, arg),
|
Compute(lmp, narg, arg),
|
||||||
ilo(NULL), ihi(NULL), jlo(NULL), jhi(NULL), klo(NULL), khi(NULL),
|
ilo(NULL), ihi(NULL), jlo(NULL), jhi(NULL), klo(NULL), khi(NULL),
|
||||||
hist(NULL), histall(NULL),
|
hist(NULL), histall(NULL),
|
||||||
rcutinnerj(NULL), rcutinnerk(NULL),
|
rcutinnerj(NULL), rcutinnerk(NULL),
|
||||||
rcutouterj(NULL), rcutouterk(NULL),
|
rcutouterj(NULL), rcutouterk(NULL),
|
||||||
@ -53,7 +53,7 @@ ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
iatomcount(NULL), iatomcountall(NULL), iatomflag(NULL),
|
iatomcount(NULL), iatomcountall(NULL), iatomflag(NULL),
|
||||||
maxjatom(NULL), maxkatom(NULL),
|
maxjatom(NULL), maxkatom(NULL),
|
||||||
numjatom(NULL), numkatom(NULL),
|
numjatom(NULL), numkatom(NULL),
|
||||||
neighjatom(NULL),neighkatom(NULL),
|
neighjatom(NULL),neighkatom(NULL),
|
||||||
jatomflag(NULL), katomflag(NULL),
|
jatomflag(NULL), katomflag(NULL),
|
||||||
maxjkatom(NULL), numjkatom(NULL),
|
maxjkatom(NULL), numjkatom(NULL),
|
||||||
neighjkatom(NULL), bothjkatom(NULL), delrjkatom(NULL)
|
neighjkatom(NULL), bothjkatom(NULL), delrjkatom(NULL)
|
||||||
@ -99,7 +99,7 @@ ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
if (!nargtriple) ntriples = 1;
|
if (!nargtriple) ntriples = 1;
|
||||||
else {
|
else {
|
||||||
if (nargtriple % nargsperadf)
|
if (nargtriple % nargsperadf)
|
||||||
error->all(FLERR,"Illegal compute adf command");
|
error->all(FLERR,"Illegal compute adf command");
|
||||||
ntriples = nargtriple/nargsperadf;
|
ntriples = nargtriple/nargsperadf;
|
||||||
}
|
}
|
||||||
@ -140,8 +140,8 @@ ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
force->bounds(FLERR,arg[iarg],atom->ntypes,ilo[m],ihi[m]);
|
force->bounds(FLERR,arg[iarg],atom->ntypes,ilo[m],ihi[m]);
|
||||||
force->bounds(FLERR,arg[iarg+1],atom->ntypes,jlo[m],jhi[m]);
|
force->bounds(FLERR,arg[iarg+1],atom->ntypes,jlo[m],jhi[m]);
|
||||||
force->bounds(FLERR,arg[iarg+2],atom->ntypes,klo[m],khi[m]);
|
force->bounds(FLERR,arg[iarg+2],atom->ntypes,klo[m],khi[m]);
|
||||||
if (ilo[m] > ihi[m] ||
|
if (ilo[m] > ihi[m] ||
|
||||||
jlo[m] > jhi[m] ||
|
jlo[m] > jhi[m] ||
|
||||||
klo[m] > khi[m])
|
klo[m] > khi[m])
|
||||||
error->all(FLERR,"Illegal compute adf command");
|
error->all(FLERR,"Illegal compute adf command");
|
||||||
rcutinnerj[m] = force->numeric(FLERR,arg[iarg+3]);
|
rcutinnerj[m] = force->numeric(FLERR,arg[iarg+3]);
|
||||||
@ -157,7 +157,7 @@ ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
// identify central atom types
|
// identify central atom types
|
||||||
|
|
||||||
int i,j,k;
|
int i,j,k;
|
||||||
|
|
||||||
for (int m = 0; m < ntriples; m++) {
|
for (int m = 0; m < ntriples; m++) {
|
||||||
@ -311,13 +311,13 @@ void ComputeADF::init()
|
|||||||
|
|
||||||
int x0;
|
int x0;
|
||||||
if (ordinate_style == DEGREE) {
|
if (ordinate_style == DEGREE) {
|
||||||
deltax = MY_PI / nbin * rad2deg;
|
deltax = MY_PI / nbin * rad2deg;
|
||||||
deltaxinv = nbin / MY_PI;
|
deltaxinv = nbin / MY_PI;
|
||||||
x0 = 0.0;
|
x0 = 0.0;
|
||||||
|
|
||||||
} else if (ordinate_style == RADIAN) {
|
} else if (ordinate_style == RADIAN) {
|
||||||
deltax = MY_PI / nbin;
|
deltax = MY_PI / nbin;
|
||||||
deltaxinv = nbin / MY_PI;
|
deltaxinv = nbin / MY_PI;
|
||||||
x0 = 0.0;
|
x0 = 0.0;
|
||||||
|
|
||||||
} else if (ordinate_style == COSINE) {
|
} else if (ordinate_style == COSINE) {
|
||||||
@ -392,7 +392,7 @@ void ComputeADF::compute_array()
|
|||||||
// tally the ADFs
|
// tally the ADFs
|
||||||
// all three atoms i, j, and k must be in fix group
|
// all three atoms i, j, and k must be in fix group
|
||||||
// tally I,J,K triple only if I is central atom
|
// tally I,J,K triple only if I is central atom
|
||||||
// and J,K matches unordered neighbor types (JJ,KK)
|
// and J,K matches unordered neighbor types (JJ,KK)
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
int *type = atom->type;
|
int *type = atom->type;
|
||||||
@ -422,22 +422,22 @@ void ComputeADF::compute_array()
|
|||||||
numkatom[m] = 0;
|
numkatom[m] = 0;
|
||||||
numjkatom[m] = 0;
|
numjkatom[m] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (jj = 0; jj < jnum; jj++) {
|
for (jj = 0; jj < jnum; jj++) {
|
||||||
j = jlist[jj];
|
j = jlist[jj];
|
||||||
factor_lj = special_lj[sbmask(j)];
|
factor_lj = special_lj[sbmask(j)];
|
||||||
factor_coul = special_coul[sbmask(j)];
|
factor_coul = special_coul[sbmask(j)];
|
||||||
j &= NEIGHMASK;
|
j &= NEIGHMASK;
|
||||||
|
|
||||||
// if both weighting factors are 0, skip this pair
|
// if both weighting factors are 0, skip this pair
|
||||||
// could be 0 and still be in neigh list for long-range Coulombics
|
// could be 0 and still be in neigh list for long-range Coulombics
|
||||||
// want consistency with non-charged triples which wouldn't be in list
|
// want consistency with non-charged triples which wouldn't be in list
|
||||||
|
|
||||||
if (factor_lj == 0.0 && factor_coul == 0.0) continue;
|
if (factor_lj == 0.0 && factor_coul == 0.0) continue;
|
||||||
|
|
||||||
if (!(mask[j] & groupbit)) continue;
|
if (!(mask[j] & groupbit)) continue;
|
||||||
jtype = type[j];
|
jtype = type[j];
|
||||||
|
|
||||||
delx = xtmp - x[j][0];
|
delx = xtmp - x[j][0];
|
||||||
dely = ytmp - x[j][1];
|
dely = ytmp - x[j][1];
|
||||||
delz = ztmp - x[j][2];
|
delz = ztmp - x[j][2];
|
||||||
@ -451,8 +451,8 @@ void ComputeADF::compute_array()
|
|||||||
if (!iatomflag[m][itype]) continue;
|
if (!iatomflag[m][itype]) continue;
|
||||||
|
|
||||||
int jflag = 0;
|
int jflag = 0;
|
||||||
if (jatomflag[m][jtype] &&
|
if (jatomflag[m][jtype] &&
|
||||||
rsq >= rcutinnerj[m]*rcutinnerj[m] &&
|
rsq >= rcutinnerj[m]*rcutinnerj[m] &&
|
||||||
rsq <= rcutouterj[m]*rcutouterj[m]) {
|
rsq <= rcutouterj[m]*rcutouterj[m]) {
|
||||||
jflag = 1;
|
jflag = 1;
|
||||||
jatom = numjatom[m]++;
|
jatom = numjatom[m]++;
|
||||||
@ -462,10 +462,10 @@ void ComputeADF::compute_array()
|
|||||||
memory->grow(neighjatom[m],maxjatom[m],"adf:neighjatom");
|
memory->grow(neighjatom[m],maxjatom[m],"adf:neighjatom");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int kflag = 0;
|
int kflag = 0;
|
||||||
if (katomflag[m][jtype] &&
|
if (katomflag[m][jtype] &&
|
||||||
rsq >= rcutinnerk[m]*rcutinnerk[m] &&
|
rsq >= rcutinnerk[m]*rcutinnerk[m] &&
|
||||||
rsq <= rcutouterk[m]*rcutouterk[m]) {
|
rsq <= rcutouterk[m]*rcutouterk[m]) {
|
||||||
kflag = 1;
|
kflag = 1;
|
||||||
katom = numkatom[m]++;
|
katom = numkatom[m]++;
|
||||||
@ -492,7 +492,7 @@ void ComputeADF::compute_array()
|
|||||||
memory->grow(delrjkatom[m],maxjkatom[m],4,"adf:delrjkatom");
|
memory->grow(delrjkatom[m],maxjkatom[m],4,"adf:delrjkatom");
|
||||||
}
|
}
|
||||||
|
|
||||||
// indicate if atom in both lists
|
// indicate if atom in both lists
|
||||||
|
|
||||||
if (jflag && kflag)
|
if (jflag && kflag)
|
||||||
bothjkatom[m][jk] = 1;
|
bothjkatom[m][jk] = 1;
|
||||||
@ -558,7 +558,7 @@ void ComputeADF::compute_array()
|
|||||||
// copy into output array
|
// copy into output array
|
||||||
|
|
||||||
for (m = 0; m < ntriples; m++) {
|
for (m = 0; m < ntriples; m++) {
|
||||||
|
|
||||||
double count = 0;
|
double count = 0;
|
||||||
for (ibin = 0; ibin < nbin; ibin++)
|
for (ibin = 0; ibin < nbin; ibin++)
|
||||||
count += histall[m][ibin];
|
count += histall[m][ibin];
|
||||||
|
|||||||
@ -53,7 +53,7 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
bstyle = new int[nvalues];
|
bstyle = new int[nvalues];
|
||||||
vstr = new char*[nvalues];
|
vstr = new char*[nvalues];
|
||||||
vvar = new int[nvalues];
|
vvar = new int[nvalues];
|
||||||
|
|
||||||
nvalues = 0;
|
nvalues = 0;
|
||||||
tflag = 0;
|
tflag = 0;
|
||||||
nvar = 0;
|
nvar = 0;
|
||||||
@ -78,7 +78,7 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
setflag = 0;
|
setflag = 0;
|
||||||
tstr = NULL;
|
tstr = NULL;
|
||||||
|
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"set") == 0) {
|
if (strcmp(arg[iarg],"set") == 0) {
|
||||||
setflag = 1;
|
setflag = 1;
|
||||||
@ -114,7 +114,7 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (!input->variable->internalstyle(tvar))
|
if (!input->variable->internalstyle(tvar))
|
||||||
error->all(FLERR,"Variable for compute angle/local is invalid style");
|
error->all(FLERR,"Variable for compute angle/local is invalid style");
|
||||||
}
|
}
|
||||||
} else if (setflag)
|
} else if (setflag)
|
||||||
error->all(FLERR,"Compute angle/local set with no variable");
|
error->all(FLERR,"Compute angle/local set with no variable");
|
||||||
|
|
||||||
// initialize output
|
// initialize output
|
||||||
@ -289,7 +289,7 @@ int ComputeAngleLocal::compute_angles(int flag)
|
|||||||
|
|
||||||
if (nvalues == 1) ptr = &vlocal[m];
|
if (nvalues == 1) ptr = &vlocal[m];
|
||||||
else ptr = alocal[m];
|
else ptr = alocal[m];
|
||||||
|
|
||||||
if (nvar) {
|
if (nvar) {
|
||||||
ivar = 0;
|
ivar = 0;
|
||||||
if (tstr) input->variable->internal_set(tvar,theta);
|
if (tstr) input->variable->internal_set(tvar,theta);
|
||||||
|
|||||||
@ -55,7 +55,7 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
bstyle = new int[nvalues];
|
bstyle = new int[nvalues];
|
||||||
vstr = new char*[nvalues];
|
vstr = new char*[nvalues];
|
||||||
vvar = new int[nvalues];
|
vvar = new int[nvalues];
|
||||||
|
|
||||||
nvalues = 0;
|
nvalues = 0;
|
||||||
nvar = 0;
|
nvar = 0;
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
setflag = 0;
|
setflag = 0;
|
||||||
dstr = NULL;
|
dstr = NULL;
|
||||||
|
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"set") == 0) {
|
if (strcmp(arg[iarg],"set") == 0) {
|
||||||
setflag = 1;
|
setflag = 1;
|
||||||
@ -117,10 +117,10 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (!input->variable->internalstyle(dvar))
|
if (!input->variable->internalstyle(dvar))
|
||||||
error->all(FLERR,"Variable for compute bond/local is invalid style");
|
error->all(FLERR,"Variable for compute bond/local is invalid style");
|
||||||
}
|
}
|
||||||
} else if (setflag)
|
} else if (setflag)
|
||||||
error->all(FLERR,"Compute bond/local set with no variable");
|
error->all(FLERR,"Compute bond/local set with no variable");
|
||||||
|
|
||||||
|
|
||||||
// set singleflag if need to call bond->single()
|
// set singleflag if need to call bond->single()
|
||||||
// set velflag if compute any quantities based on velocities
|
// set velflag if compute any quantities based on velocities
|
||||||
|
|
||||||
|
|||||||
@ -117,7 +117,7 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
"does not exist");
|
"does not exist");
|
||||||
|
|
||||||
char *ptr = strstr(modify->compute[icompute]->style,"/chunk");
|
char *ptr = strstr(modify->compute[icompute]->style,"/chunk");
|
||||||
if (!ptr || (ptr != modify->compute[icompute]->style +
|
if (!ptr || (ptr != modify->compute[icompute]->style +
|
||||||
strlen(modify->compute[icompute]->style) - strlen("/chunk")))
|
strlen(modify->compute[icompute]->style) - strlen("/chunk")))
|
||||||
error->all(FLERR,"Compute for compute chunk/spread/atom "
|
error->all(FLERR,"Compute for compute chunk/spread/atom "
|
||||||
"does not calculate per-chunk values");
|
"does not calculate per-chunk values");
|
||||||
|
|||||||
@ -56,7 +56,7 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
bstyle = new int[nvalues];
|
bstyle = new int[nvalues];
|
||||||
vstr = new char*[nvalues];
|
vstr = new char*[nvalues];
|
||||||
vvar = new int[nvalues];
|
vvar = new int[nvalues];
|
||||||
|
|
||||||
nvalues = 0;
|
nvalues = 0;
|
||||||
nvar = 0;
|
nvar = 0;
|
||||||
|
|
||||||
@ -77,11 +77,11 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
setflag = 0;
|
setflag = 0;
|
||||||
pstr = NULL;
|
pstr = NULL;
|
||||||
|
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"set") == 0) {
|
if (strcmp(arg[iarg],"set") == 0) {
|
||||||
setflag = 1;
|
setflag = 1;
|
||||||
if (iarg+3 > narg)
|
if (iarg+3 > narg)
|
||||||
error->all(FLERR,"Illegal compute dihedral/local command");
|
error->all(FLERR,"Illegal compute dihedral/local command");
|
||||||
if (strcmp(arg[iarg+1],"phi") == 0) {
|
if (strcmp(arg[iarg+1],"phi") == 0) {
|
||||||
delete [] pstr;
|
delete [] pstr;
|
||||||
@ -115,7 +115,7 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (!input->variable->internalstyle(pvar))
|
if (!input->variable->internalstyle(pvar))
|
||||||
error->all(FLERR,"Variable for compute dihedral/local is invalid style");
|
error->all(FLERR,"Variable for compute dihedral/local is invalid style");
|
||||||
}
|
}
|
||||||
} else if (setflag)
|
} else if (setflag)
|
||||||
error->all(FLERR,"Compute dihedral/local set with no variable");
|
error->all(FLERR,"Compute dihedral/local set with no variable");
|
||||||
|
|
||||||
// initialize output
|
// initialize output
|
||||||
@ -295,17 +295,17 @@ int ComputeDihedralLocal::compute_dihedrals(int flag)
|
|||||||
if (rasq > 0) ra2inv = 1.0/rasq;
|
if (rasq > 0) ra2inv = 1.0/rasq;
|
||||||
if (rbsq > 0) rb2inv = 1.0/rbsq;
|
if (rbsq > 0) rb2inv = 1.0/rbsq;
|
||||||
rabinv = sqrt(ra2inv*rb2inv);
|
rabinv = sqrt(ra2inv*rb2inv);
|
||||||
|
|
||||||
c = (ax*bx + ay*by + az*bz)*rabinv;
|
c = (ax*bx + ay*by + az*bz)*rabinv;
|
||||||
s = rg*rabinv*(ax*vb3x + ay*vb3y + az*vb3z);
|
s = rg*rabinv*(ax*vb3x + ay*vb3y + az*vb3z);
|
||||||
|
|
||||||
if (c > 1.0) c = 1.0;
|
if (c > 1.0) c = 1.0;
|
||||||
if (c < -1.0) c = -1.0;
|
if (c < -1.0) c = -1.0;
|
||||||
phi = atan2(s,c);
|
phi = atan2(s,c);
|
||||||
|
|
||||||
if (nvalues == 1) ptr = &vlocal[m];
|
if (nvalues == 1) ptr = &vlocal[m];
|
||||||
else ptr = alocal[m];
|
else ptr = alocal[m];
|
||||||
|
|
||||||
if (nvar) {
|
if (nvar) {
|
||||||
ivar = 0;
|
ivar = 0;
|
||||||
if (pstr) input->variable->internal_set(pvar,phi);
|
if (pstr) input->variable->internal_set(pvar,phi);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
int iarg = 3;
|
int iarg = 3;
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"refresh") == 0) {
|
if (strcmp(arg[iarg],"refresh") == 0) {
|
||||||
if (iarg+2 > narg)
|
if (iarg+2 > narg)
|
||||||
error->all(FLERR,"Illegal compute displace/atom command");
|
error->all(FLERR,"Illegal compute displace/atom command");
|
||||||
refreshflag = 1;
|
refreshflag = 1;
|
||||||
delete [] rvar;
|
delete [] rvar;
|
||||||
@ -63,7 +63,7 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
if (refreshflag) {
|
if (refreshflag) {
|
||||||
ivar = input->variable->find(rvar);
|
ivar = input->variable->find(rvar);
|
||||||
if (ivar < 0)
|
if (ivar < 0)
|
||||||
error->all(FLERR,"Variable name for compute displace/atom does not exist");
|
error->all(FLERR,"Variable name for compute displace/atom does not exist");
|
||||||
if (input->variable->atomstyle(ivar) == 0)
|
if (input->variable->atomstyle(ivar) == 0)
|
||||||
error->all(FLERR,"Compute displace/atom variable "
|
error->all(FLERR,"Compute displace/atom variable "
|
||||||
|
|||||||
@ -77,7 +77,7 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
// pairwise args
|
// pairwise args
|
||||||
|
|
||||||
if (nargpair == 0) npairs = 1;
|
if (nargpair == 0) npairs = 1;
|
||||||
else {
|
else {
|
||||||
if (nargpair % 2) error->all(FLERR,"Illegal compute rdf command");
|
if (nargpair % 2) error->all(FLERR,"Illegal compute rdf command");
|
||||||
npairs = nargpair/2;
|
npairs = nargpair/2;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
init_chunk();
|
init_chunk();
|
||||||
|
|
||||||
// mode
|
// mode
|
||||||
|
|
||||||
if (strcmp(arg[4],"sum") == 0) mode = SUM;
|
if (strcmp(arg[4],"sum") == 0) mode = SUM;
|
||||||
else if (strcmp(arg[4],"min") == 0) mode = MINN;
|
else if (strcmp(arg[4],"min") == 0) mode = MINN;
|
||||||
else if (strcmp(arg[4],"max") == 0) mode = MAXX;
|
else if (strcmp(arg[4],"max") == 0) mode = MAXX;
|
||||||
@ -118,7 +118,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
// error check
|
// error check
|
||||||
|
|
||||||
for (int i = 0; i < nvalues; i++) {
|
for (int i = 0; i < nvalues; i++) {
|
||||||
if (which[i] == COMPUTE) {
|
if (which[i] == COMPUTE) {
|
||||||
int icompute = modify->find_compute(ids[i]);
|
int icompute = modify->find_compute(ids[i]);
|
||||||
@ -134,11 +134,11 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
|
if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
|
||||||
error->all(FLERR,"Compute reduce/chunk compute does not "
|
error->all(FLERR,"Compute reduce/chunk compute does not "
|
||||||
"calculate a per-atom array");
|
"calculate a per-atom array");
|
||||||
if (argindex[i] &&
|
if (argindex[i] &&
|
||||||
argindex[i] > modify->compute[icompute]->size_peratom_cols)
|
argindex[i] > modify->compute[icompute]->size_peratom_cols)
|
||||||
error->all(FLERR,
|
error->all(FLERR,
|
||||||
"Compute reduce/chunk compute array is accessed out-of-range");
|
"Compute reduce/chunk compute array is accessed out-of-range");
|
||||||
|
|
||||||
} else if (which[i] == FIX) {
|
} else if (which[i] == FIX) {
|
||||||
int ifix = modify->find_fix(ids[i]);
|
int ifix = modify->find_fix(ids[i]);
|
||||||
if (ifix < 0)
|
if (ifix < 0)
|
||||||
@ -156,7 +156,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols)
|
if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols)
|
||||||
error->all(FLERR,"Compute reduce/chunk fix array is "
|
error->all(FLERR,"Compute reduce/chunk fix array is "
|
||||||
"accessed out-of-range");
|
"accessed out-of-range");
|
||||||
|
|
||||||
} else if (which[i] == VARIABLE) {
|
} else if (which[i] == VARIABLE) {
|
||||||
int ivariable = input->variable->find(ids[i]);
|
int ivariable = input->variable->find(ids[i]);
|
||||||
if (ivariable < 0)
|
if (ivariable < 0)
|
||||||
@ -181,7 +181,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
// setup
|
// setup
|
||||||
|
|
||||||
if (mode == SUM) initvalue = 0.0;
|
if (mode == SUM) initvalue = 0.0;
|
||||||
else if (mode == MINN) initvalue = BIG;
|
else if (mode == MINN) initvalue = BIG;
|
||||||
else if (mode == MAXX) initvalue = -BIG;
|
else if (mode == MAXX) initvalue = -BIG;
|
||||||
@ -199,7 +199,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
ComputeReduceChunk::~ComputeReduceChunk()
|
ComputeReduceChunk::~ComputeReduceChunk()
|
||||||
{
|
{
|
||||||
delete [] idchunk;
|
delete [] idchunk;
|
||||||
|
|
||||||
delete [] which;
|
delete [] which;
|
||||||
delete [] argindex;
|
delete [] argindex;
|
||||||
for (int m = 0; m < nvalues; m++) delete [] ids[m];
|
for (int m = 0; m < nvalues; m++) delete [] ids[m];
|
||||||
@ -210,7 +210,7 @@ ComputeReduceChunk::~ComputeReduceChunk()
|
|||||||
memory->destroy(vglobal);
|
memory->destroy(vglobal);
|
||||||
memory->destroy(alocal);
|
memory->destroy(alocal);
|
||||||
memory->destroy(aglobal);
|
memory->destroy(aglobal);
|
||||||
|
|
||||||
memory->destroy(varatom);
|
memory->destroy(varatom);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,11 +284,11 @@ void ComputeReduceChunk::compute_vector()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// perform local reduction of single peratom value
|
// perform local reduction of single peratom value
|
||||||
|
|
||||||
compute_one(0,vlocal,1);
|
compute_one(0,vlocal,1);
|
||||||
|
|
||||||
// reduce the per-chunk values across all procs
|
// reduce the per-chunk values across all procs
|
||||||
|
|
||||||
if (mode == SUM)
|
if (mode == SUM)
|
||||||
MPI_Allreduce(vlocal,vglobal,nchunk,MPI_DOUBLE,MPI_SUM,world);
|
MPI_Allreduce(vlocal,vglobal,nchunk,MPI_DOUBLE,MPI_SUM,world);
|
||||||
else if (mode == MINN)
|
else if (mode == MINN)
|
||||||
@ -296,7 +296,7 @@ void ComputeReduceChunk::compute_vector()
|
|||||||
else if (mode == MAXX)
|
else if (mode == MAXX)
|
||||||
MPI_Allreduce(vlocal,vglobal,nchunk,MPI_DOUBLE,MPI_MAX,world);
|
MPI_Allreduce(vlocal,vglobal,nchunk,MPI_DOUBLE,MPI_MAX,world);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void ComputeReduceChunk::compute_array()
|
void ComputeReduceChunk::compute_array()
|
||||||
@ -324,11 +324,11 @@ void ComputeReduceChunk::compute_array()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// perform local reduction of all peratom values
|
// perform local reduction of all peratom values
|
||||||
|
|
||||||
for (int m = 0; m < nvalues; m++) compute_one(m,&alocal[0][m],nvalues);
|
for (int m = 0; m < nvalues; m++) compute_one(m,&alocal[0][m],nvalues);
|
||||||
|
|
||||||
// reduce the per-chunk values across all procs
|
// reduce the per-chunk values across all procs
|
||||||
|
|
||||||
if (mode == SUM)
|
if (mode == SUM)
|
||||||
MPI_Allreduce(&alocal[0][0],&aglobal[0][0],nchunk*nvalues,
|
MPI_Allreduce(&alocal[0][0],&aglobal[0][0],nchunk*nvalues,
|
||||||
MPI_DOUBLE,MPI_SUM,world);
|
MPI_DOUBLE,MPI_SUM,world);
|
||||||
@ -339,13 +339,13 @@ void ComputeReduceChunk::compute_array()
|
|||||||
MPI_Allreduce(&alocal[0][0],&aglobal[0][0],nchunk*nvalues,
|
MPI_Allreduce(&alocal[0][0],&aglobal[0][0],nchunk*nvalues,
|
||||||
MPI_DOUBLE,MPI_MAX,world);
|
MPI_DOUBLE,MPI_MAX,world);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride)
|
void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride)
|
||||||
{
|
{
|
||||||
// initialize per-chunk values in accumulation vector
|
// initialize per-chunk values in accumulation vector
|
||||||
|
|
||||||
for (int i = 0; i < nchunk; i += nstride) vchunk[i] = initvalue;
|
for (int i = 0; i < nchunk; i += nstride) vchunk[i] = initvalue;
|
||||||
|
|
||||||
// loop over my atoms
|
// loop over my atoms
|
||||||
@ -382,7 +382,7 @@ void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride)
|
|||||||
combine(vchunk[index*nstride],acompute[i][argindexm1]);
|
combine(vchunk[index*nstride],acompute[i][argindexm1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// access fix fields, check if fix frequency is a match
|
// access fix fields, check if fix frequency is a match
|
||||||
|
|
||||||
} else if (which[m] == FIX) {
|
} else if (which[m] == FIX) {
|
||||||
|
|||||||
@ -576,11 +576,11 @@ void CreateAtoms::add_single()
|
|||||||
if (triclinic) {
|
if (triclinic) {
|
||||||
domain->x2lamda(xone,lamda);
|
domain->x2lamda(xone,lamda);
|
||||||
if (remapflag) {
|
if (remapflag) {
|
||||||
if (domain->xperiodic && (lamda[0] < 0.0 || lamda[0] >= 1.0))
|
if (domain->xperiodic && (lamda[0] < 0.0 || lamda[0] >= 1.0))
|
||||||
lamda[0] = 0.0;
|
lamda[0] = 0.0;
|
||||||
if (domain->yperiodic && (lamda[1] < 0.0 || lamda[1] >= 1.0))
|
if (domain->yperiodic && (lamda[1] < 0.0 || lamda[1] >= 1.0))
|
||||||
lamda[1] = 0.0;
|
lamda[1] = 0.0;
|
||||||
if (domain->zperiodic && (lamda[2] < 0.0 || lamda[2] >= 1.0))
|
if (domain->zperiodic && (lamda[2] < 0.0 || lamda[2] >= 1.0))
|
||||||
lamda[2] = 0.0;
|
lamda[2] = 0.0;
|
||||||
}
|
}
|
||||||
coord = lamda;
|
coord = lamda;
|
||||||
|
|||||||
@ -68,7 +68,7 @@ void DeleteAtoms::command(int narg, char **arg)
|
|||||||
|
|
||||||
if (allflag) {
|
if (allflag) {
|
||||||
int igroup = group->find("all");
|
int igroup = group->find("all");
|
||||||
if ((igroup >= 0) &&
|
if ((igroup >= 0) &&
|
||||||
modify->check_rigid_group_overlap(group->bitmask[igroup]))
|
modify->check_rigid_group_overlap(group->bitmask[igroup]))
|
||||||
error->warning(FLERR,"Attempting to delete atoms in rigid bodies");
|
error->warning(FLERR,"Attempting to delete atoms in rigid bodies");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -52,6 +52,6 @@ void DihedralDeprecated::settings(int, char **)
|
|||||||
writemsg(lmp,"\nDihedral style 'DEPRECATED' is a dummy style\n\n",0);
|
writemsg(lmp,"\nDihedral style 'DEPRECATED' is a dummy style\n\n",0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -205,7 +205,7 @@ void FixGroup::set_group()
|
|||||||
|
|
||||||
// invoke atom-style variable if defined
|
// invoke atom-style variable if defined
|
||||||
// set post_integrate flag to 1, then unset after
|
// set post_integrate flag to 1, then unset after
|
||||||
// this is for any compute to check if it needs to
|
// this is for any compute to check if it needs to
|
||||||
// operate differently due to invocation this early in timestep
|
// operate differently due to invocation this early in timestep
|
||||||
// e.g. perform ghost comm update due to atoms having just moved
|
// e.g. perform ghost comm update due to atoms having just moved
|
||||||
|
|
||||||
|
|||||||
@ -191,7 +191,7 @@ void FixRestrain::min_setup(int vflag)
|
|||||||
void FixRestrain::post_force(int /*vflag*/)
|
void FixRestrain::post_force(int /*vflag*/)
|
||||||
{
|
{
|
||||||
energy = 0.0;
|
energy = 0.0;
|
||||||
|
|
||||||
ebond = 0.0;
|
ebond = 0.0;
|
||||||
eangle = 0.0;
|
eangle = 0.0;
|
||||||
edihed = 0.0;
|
edihed = 0.0;
|
||||||
@ -658,7 +658,7 @@ double FixRestrain::compute_vector(int n)
|
|||||||
} else if (n == 1) {
|
} else if (n == 1) {
|
||||||
MPI_Allreduce(&eangle,&eangle_all,1,MPI_DOUBLE,MPI_SUM,world);
|
MPI_Allreduce(&eangle,&eangle_all,1,MPI_DOUBLE,MPI_SUM,world);
|
||||||
return eangle_all;
|
return eangle_all;
|
||||||
} else if (n == 2) {
|
} else if (n == 2) {
|
||||||
MPI_Allreduce(&edihed,&edihed_all,1,MPI_DOUBLE,MPI_SUM,world);
|
MPI_Allreduce(&edihed,&edihed_all,1,MPI_DOUBLE,MPI_SUM,world);
|
||||||
return edihed_all;
|
return edihed_all;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -52,6 +52,6 @@ void ImproperDeprecated::settings(int, char **)
|
|||||||
writemsg(lmp,"\nImproper style 'DEPRECATED' is a dummy style\n\n",0);
|
writemsg(lmp,"\nImproper style 'DEPRECATED' is a dummy style\n\n",0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -957,7 +957,7 @@ void lammps_gather_atoms_concat(void *ptr, char *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// perform MPI_Allgatherv on each proc's chunk of Nlocal atoms
|
// perform MPI_Allgatherv on each proc's chunk of Nlocal atoms
|
||||||
|
|
||||||
int nprocs = lmp->comm->nprocs;
|
int nprocs = lmp->comm->nprocs;
|
||||||
|
|
||||||
int *recvcounts,*displs;
|
int *recvcounts,*displs;
|
||||||
@ -1078,7 +1078,7 @@ void lammps_gather_atoms_subset(void *ptr, char *name,
|
|||||||
LAMMPS *lmp = (LAMMPS *) ptr;
|
LAMMPS *lmp = (LAMMPS *) ptr;
|
||||||
|
|
||||||
BEGIN_CAPTURE
|
BEGIN_CAPTURE
|
||||||
{
|
{
|
||||||
int i,j,m,offset;
|
int i,j,m,offset;
|
||||||
tagint id;
|
tagint id;
|
||||||
|
|
||||||
@ -1319,9 +1319,9 @@ void lammps_scatter_atoms(void *ptr, char *name,
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void lammps_scatter_atoms_subset(void *ptr, char *name,
|
void lammps_scatter_atoms_subset(void *ptr, char *name,
|
||||||
int type, int count,
|
int type, int count,
|
||||||
int ndata, int *ids, void *data)
|
int ndata, int *ids, void *data)
|
||||||
{
|
{
|
||||||
LAMMPS *lmp = (LAMMPS *) ptr;
|
LAMMPS *lmp = (LAMMPS *) ptr;
|
||||||
|
|
||||||
BEGIN_CAPTURE
|
BEGIN_CAPTURE
|
||||||
|
|||||||
@ -52,6 +52,6 @@ void PairDeprecated::settings(int, char **)
|
|||||||
writemsg(lmp,"\nPair style 'DEPRECATED' is a dummy style\n\n",0);
|
writemsg(lmp,"\nPair style 'DEPRECATED' is a dummy style\n\n",0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -255,7 +255,7 @@ void WriteData::header()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fixflag)
|
if (fixflag)
|
||||||
for (int i = 0; i < modify->nfix; i++)
|
for (int i = 0; i < modify->nfix; i++)
|
||||||
if (modify->fix[i]->wd_header)
|
if (modify->fix[i]->wd_header)
|
||||||
for (int m = 0; m < modify->fix[i]->wd_header; m++)
|
for (int m = 0; m < modify->fix[i]->wd_header; m++)
|
||||||
|
|||||||
Reference in New Issue
Block a user