reduce compiler warnings by avoiding to redeclare variables so they shadow others
This commit is contained in:
@ -183,16 +183,16 @@ void AngleHybrid::allocate()
|
||||
|
||||
void AngleHybrid::settings(int narg, char **arg)
|
||||
{
|
||||
int i,m,istyle;
|
||||
int i, m,istyle;
|
||||
|
||||
if (narg < 1) error->all(FLERR,"Illegal angle_style command");
|
||||
|
||||
// delete old lists, since cannot just change settings
|
||||
|
||||
if (nstyles) {
|
||||
for (int i = 0; i < nstyles; i++) delete styles[i];
|
||||
for (i = 0; i < nstyles; i++) delete styles[i];
|
||||
delete [] styles;
|
||||
for (int i = 0; i < nstyles; i++) delete [] keywords[i];
|
||||
for (i = 0; i < nstyles; i++) delete [] keywords[i];
|
||||
delete [] keywords;
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ void AngleHybrid::settings(int narg, char **arg)
|
||||
memory->destroy(map);
|
||||
delete [] nanglelist;
|
||||
delete [] maxangle;
|
||||
for (int i = 0; i < nstyles; i++)
|
||||
for (i = 0; i < nstyles; i++)
|
||||
memory->destroy(anglelist[i]);
|
||||
delete [] anglelist;
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ void AtomVecHybrid::process_args(int narg, char **arg)
|
||||
// call process_args() with set of args that are not atom style names
|
||||
// use known_style() to determine which args these are
|
||||
|
||||
int i,jarg,dummy;
|
||||
int i,k,jarg,dummy;
|
||||
|
||||
int iarg = 0;
|
||||
nstyles = 0;
|
||||
@ -123,7 +123,7 @@ void AtomVecHybrid::process_args(int narg, char **arg)
|
||||
molecular = Atom::ATOMIC;
|
||||
maxexchange = 0;
|
||||
|
||||
for (int k = 0; k < nstyles; k++) {
|
||||
for (k = 0; k < nstyles; k++) {
|
||||
if ((styles[k]->molecular == Atom::MOLECULAR && molecular == Atom::TEMPLATE) ||
|
||||
(styles[k]->molecular == Atom::TEMPLATE && molecular == Atom::MOLECULAR))
|
||||
error->all(FLERR,
|
||||
@ -147,7 +147,7 @@ void AtomVecHybrid::process_args(int narg, char **arg)
|
||||
int mass_pertype = 0;
|
||||
int mass_peratom = 0;
|
||||
|
||||
for (int k = 0; k < nstyles; k++) {
|
||||
for (k = 0; k < nstyles; k++) {
|
||||
if (styles[k]->mass_type == 0) mass_peratom = 1;
|
||||
if (styles[k]->mass_type == 1) mass_pertype = 1;
|
||||
}
|
||||
@ -159,14 +159,14 @@ void AtomVecHybrid::process_args(int narg, char **arg)
|
||||
|
||||
// free allstyles created by build_styles()
|
||||
|
||||
for (int i = 0; i < nallstyles; i++) delete [] allstyles[i];
|
||||
for (i = 0; i < nallstyles; i++) delete [] allstyles[i];
|
||||
delete [] allstyles;
|
||||
|
||||
// set field strings from all substyles
|
||||
|
||||
fieldstrings = new FieldStrings[nstyles];
|
||||
|
||||
for (int k = 0; k < nstyles; k++) {
|
||||
for (k = 0; k < nstyles; k++) {
|
||||
fieldstrings[k].fstr = new char*[NFIELDSTRINGS];
|
||||
fieldstrings[k].fstr[0] = styles[k]->fields_grow;
|
||||
fieldstrings[k].fstr[1] = styles[k]->fields_copy;
|
||||
@ -226,7 +226,7 @@ void AtomVecHybrid::process_args(int narg, char **arg)
|
||||
// sum two sizes over contributions from each substyle with bonus data.
|
||||
|
||||
nstyles_bonus = 0;
|
||||
for (int k = 0; k < nstyles; k++)
|
||||
for (k = 0; k < nstyles; k++)
|
||||
if (styles[k]->bonus_flag) nstyles_bonus++;
|
||||
|
||||
if (nstyles_bonus) {
|
||||
@ -235,7 +235,7 @@ void AtomVecHybrid::process_args(int narg, char **arg)
|
||||
nstyles_bonus = 0;
|
||||
size_forward_bonus = 0;
|
||||
size_border_bonus = 0;
|
||||
for (int k = 0; k < nstyles; k++) {
|
||||
for (k = 0; k < nstyles; k++) {
|
||||
if (styles[k]->bonus_flag) {
|
||||
styles_bonus[nstyles_bonus++] = styles[k];
|
||||
size_forward_bonus += styles[k]->size_forward_bonus;
|
||||
|
||||
@ -919,7 +919,7 @@ int Balance::shift()
|
||||
// do this with minimal adjustment to splits
|
||||
|
||||
double close = (1.0+EPSNEIGH) * neighbor->skin / boxsize;
|
||||
double delta,midpt,start,stop,lbound,ubound,spacing;
|
||||
double midpt,start,stop,lbound,ubound,spacing;
|
||||
|
||||
i = 0;
|
||||
while (i < np) {
|
||||
@ -1094,7 +1094,7 @@ int Balance::adjust(int n, double *split)
|
||||
}
|
||||
|
||||
int change = 0;
|
||||
for (int i = 1; i < n; i++)
|
||||
for (i = 1; i < n; i++)
|
||||
if (sum[i] != target[i]) {
|
||||
change = 1;
|
||||
if (rho == 0) split[i] = 0.5 * (lo[i]+hi[i]);
|
||||
|
||||
@ -182,9 +182,9 @@ void BondHybrid::settings(int narg, char **arg)
|
||||
// delete old lists, since cannot just change settings
|
||||
|
||||
if (nstyles) {
|
||||
for (int i = 0; i < nstyles; i++) delete styles[i];
|
||||
for (i = 0; i < nstyles; i++) delete styles[i];
|
||||
delete [] styles;
|
||||
for (int i = 0; i < nstyles; i++) delete [] keywords[i];
|
||||
for (i = 0; i < nstyles; i++) delete [] keywords[i];
|
||||
delete [] keywords;
|
||||
has_quartic = -1;
|
||||
}
|
||||
@ -194,7 +194,7 @@ void BondHybrid::settings(int narg, char **arg)
|
||||
memory->destroy(map);
|
||||
delete [] nbondlist;
|
||||
delete [] maxbond;
|
||||
for (int i = 0; i < nstyles; i++)
|
||||
for (i = 0; i < nstyles; i++)
|
||||
memory->destroy(bondlist[i]);
|
||||
delete [] bondlist;
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ void ChangeBox::command(int narg, char **arg)
|
||||
// compute scale factors if FINAL,DELTA used since they have distance units
|
||||
|
||||
int flag = 0;
|
||||
for (int i = 0; i < nops; i++)
|
||||
for (i = 0; i < nops; i++)
|
||||
if (ops[i].style == FINAL || ops[i].style == DELTA) flag = 1;
|
||||
|
||||
if (flag && scaleflag) {
|
||||
@ -295,7 +295,7 @@ void ChangeBox::command(int narg, char **arg)
|
||||
if (output->ndump)
|
||||
error->all(FLERR,
|
||||
"Cannot change box ortho/triclinic with dumps defined");
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
for (i = 0; i < modify->nfix; i++)
|
||||
if (modify->fix[i]->no_change_box)
|
||||
error->all(FLERR,
|
||||
"Cannot change box ortho/triclinic with "
|
||||
@ -310,7 +310,7 @@ void ChangeBox::command(int narg, char **arg)
|
||||
if (output->ndump)
|
||||
error->all(FLERR,
|
||||
"Cannot change box ortho/triclinic with dumps defined");
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
for (i = 0; i < modify->nfix; i++)
|
||||
if (modify->fix[i]->no_change_box)
|
||||
error->all(FLERR,
|
||||
"Cannot change box ortho/triclinic with "
|
||||
|
||||
@ -101,7 +101,7 @@ void ComputeAngmomChunk::compute_array()
|
||||
|
||||
// zero local per-chunk values
|
||||
|
||||
for (int i = 0; i < nchunk; i++) {
|
||||
for (i = 0; i < nchunk; i++) {
|
||||
massproc[i] = 0.0;
|
||||
com[i][0] = com[i][1] = com[i][2] = 0.0;
|
||||
angmom[i][0] = angmom[i][1] = angmom[i][2] = 0.0;
|
||||
@ -117,7 +117,7 @@ void ComputeAngmomChunk::compute_array()
|
||||
double *rmass = atom->rmass;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
index = ichunk[i]-1;
|
||||
if (index < 0) continue;
|
||||
@ -133,7 +133,7 @@ void ComputeAngmomChunk::compute_array()
|
||||
MPI_Allreduce(massproc,masstotal,nchunk,MPI_DOUBLE,MPI_SUM,world);
|
||||
MPI_Allreduce(&com[0][0],&comall[0][0],3*nchunk,MPI_DOUBLE,MPI_SUM,world);
|
||||
|
||||
for (int i = 0; i < nchunk; i++) {
|
||||
for (i = 0; i < nchunk; i++) {
|
||||
if (masstotal[i] > 0.0) {
|
||||
comall[i][0] /= masstotal[i];
|
||||
comall[i][1] /= masstotal[i];
|
||||
|
||||
@ -269,7 +269,7 @@ void ComputeCentroAtom::compute_peratom()
|
||||
delx = x[jj][0] + x[kk][0] - 2.0*xtmp;
|
||||
dely = x[jj][1] + x[kk][1] - 2.0*ytmp;
|
||||
delz = x[jj][2] + x[kk][2] - 2.0*ztmp;
|
||||
double rsq = delx*delx + dely*dely + delz*delz;
|
||||
rsq = delx*delx + dely*dely + delz*delz;
|
||||
pairs[n++] = rsq;
|
||||
|
||||
if (rsq < rsq2) {
|
||||
|
||||
@ -687,6 +687,7 @@ void ComputeChunkAtom::compute_ichunk()
|
||||
// or if idsflag = NFREQ and lock is in place and are on later timestep
|
||||
// else proceed to recalculate per-atom chunk assignments
|
||||
|
||||
const int nlocal = atom->nlocal;
|
||||
int restore = 0;
|
||||
if (idsflag == ONCE && invoked_ichunk >= 0) restore = 1;
|
||||
if (idsflag == NFREQ && lockfix && update->ntimestep > lockstart) restore = 1;
|
||||
@ -694,7 +695,6 @@ void ComputeChunkAtom::compute_ichunk()
|
||||
if (restore) {
|
||||
invoked_ichunk = update->ntimestep;
|
||||
double *vstore = fixstore->vstore;
|
||||
int nlocal = atom->nlocal;
|
||||
for (i = 0; i < nlocal; i++) ichunk[i] = static_cast<int> (vstore[i]);
|
||||
return;
|
||||
}
|
||||
@ -711,8 +711,6 @@ void ComputeChunkAtom::compute_ichunk()
|
||||
// compress chunk IDs via hash of the original uncompressed IDs
|
||||
// also apply discard rule except for binning styles which already did
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
if (compress) {
|
||||
if (binflag) {
|
||||
for (i = 0; i < nlocal; i++) {
|
||||
@ -761,8 +759,7 @@ void ComputeChunkAtom::compute_ichunk()
|
||||
|
||||
if (idsflag == ONCE || (idsflag == NFREQ && lockfix)) {
|
||||
double *vstore = fixstore->vstore;
|
||||
int nlocal = atom->nlocal;
|
||||
for (int i = 0; i < nlocal; i++) vstore[i] = ichunk[i];
|
||||
for (i = 0; i < nlocal; i++) vstore[i] = ichunk[i];
|
||||
}
|
||||
|
||||
// one-time check if which = MOLECULE and
|
||||
@ -897,7 +894,7 @@ void ComputeChunkAtom::assign_chunk_ids()
|
||||
|
||||
double **x = atom->x;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
const int nlocal = atom->nlocal;
|
||||
|
||||
if (regionflag) {
|
||||
for (i = 0; i < nlocal; i++) {
|
||||
|
||||
@ -119,7 +119,7 @@ void ComputeDipoleChunk::compute_array()
|
||||
|
||||
// zero local per-chunk values
|
||||
|
||||
for (int i = 0; i < nchunk; i++) {
|
||||
for (i = 0; i < nchunk; i++) {
|
||||
massproc[i] = chrgproc[i] = 0.0;
|
||||
com[i][0] = com[i][1] = com[i][2] = 0.0;
|
||||
dipole[i][0] = dipole[i][1] = dipole[i][2] = dipole[i][3] = 0.0;
|
||||
@ -138,7 +138,7 @@ void ComputeDipoleChunk::compute_array()
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
index = ichunk[i]-1;
|
||||
if (index < 0) continue;
|
||||
@ -159,7 +159,7 @@ void ComputeDipoleChunk::compute_array()
|
||||
MPI_Allreduce(chrgproc,chrgtotal,nchunk,MPI_DOUBLE,MPI_SUM,world);
|
||||
MPI_Allreduce(&com[0][0],&comall[0][0],3*nchunk,MPI_DOUBLE,MPI_SUM,world);
|
||||
|
||||
for (int i = 0; i < nchunk; i++) {
|
||||
for (i = 0; i < nchunk; i++) {
|
||||
if (masstotal[i] > 0.0) {
|
||||
comall[i][0] /= masstotal[i];
|
||||
comall[i][1] /= masstotal[i];
|
||||
|
||||
@ -74,14 +74,14 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
nvalues = 0;
|
||||
|
||||
for (iarg = 0; iarg < nargnew; iarg++) {
|
||||
ArgInfo argi(arg[iarg]);
|
||||
ArgInfo argi2(arg[iarg]);
|
||||
|
||||
which[nvalues] = argi.get_type();
|
||||
argindex[nvalues] = argi.get_index1();
|
||||
ids[nvalues] = argi.copy_name();
|
||||
which[nvalues] = argi2.get_type();
|
||||
argindex[nvalues] = argi2.get_index1();
|
||||
ids[nvalues] = argi2.copy_name();
|
||||
|
||||
if ((which[nvalues] == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE)
|
||||
|| (argi.get_dim() > 1))
|
||||
|| (argi2.get_dim() > 1))
|
||||
error->all(FLERR,"Illegal compute slice command");
|
||||
|
||||
nvalues++;
|
||||
|
||||
@ -109,18 +109,16 @@ double ComputeReduceRegion::compute_one(int m, int flag)
|
||||
|
||||
if (j == 0) {
|
||||
double *compute_vector = compute->vector_atom;
|
||||
int n = nlocal;
|
||||
if (flag < 0) {
|
||||
for (i = 0; i < n; i++)
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
|
||||
combine(one,compute_vector[i],i);
|
||||
} else one = compute_vector[flag];
|
||||
} else {
|
||||
double **compute_array = compute->array_atom;
|
||||
int n = nlocal;
|
||||
int jm1 = j - 1;
|
||||
if (flag < 0) {
|
||||
for (i = 0; i < n; i++)
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
|
||||
combine(one,compute_array[i][jm1],i);
|
||||
} else one = compute_array[flag][jm1];
|
||||
@ -134,17 +132,15 @@ double ComputeReduceRegion::compute_one(int m, int flag)
|
||||
|
||||
if (j == 0) {
|
||||
double *compute_vector = compute->vector_local;
|
||||
int n = compute->size_local_rows;
|
||||
if (flag < 0)
|
||||
for (i = 0; i < n; i++)
|
||||
for (i = 0; i < compute->size_local_rows; i++)
|
||||
combine(one,compute_vector[i],i);
|
||||
else one = compute_vector[flag];
|
||||
} else {
|
||||
double **compute_array = compute->array_local;
|
||||
int n = compute->size_local_rows;
|
||||
int jm1 = j - 1;
|
||||
if (flag < 0)
|
||||
for (i = 0; i < n; i++)
|
||||
for (i = 0; i < compute->size_local_rows; i++)
|
||||
combine(one,compute_array[i][jm1],i);
|
||||
else one = compute_array[flag][jm1];
|
||||
}
|
||||
@ -161,9 +157,8 @@ double ComputeReduceRegion::compute_one(int m, int flag)
|
||||
if (flavor[m] == PERATOM) {
|
||||
if (j == 0) {
|
||||
double *fix_vector = fix->vector_atom;
|
||||
int n = nlocal;
|
||||
if (flag < 0) {
|
||||
for (i = 0; i < n; i++)
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
|
||||
combine(one,fix_vector[i],i);
|
||||
} else one = fix_vector[flag];
|
||||
@ -180,17 +175,15 @@ double ComputeReduceRegion::compute_one(int m, int flag)
|
||||
} else if (flavor[m] == LOCAL) {
|
||||
if (j == 0) {
|
||||
double *fix_vector = fix->vector_local;
|
||||
int n = fix->size_local_rows;
|
||||
if (flag < 0)
|
||||
for (i = 0; i < n; i++)
|
||||
for (i = 0; i < fix->size_local_rows; i++)
|
||||
combine(one,fix_vector[i],i);
|
||||
else one = fix_vector[flag];
|
||||
} else {
|
||||
double **fix_array = fix->array_local;
|
||||
int n = fix->size_local_rows;
|
||||
int jm1 = j - 1;
|
||||
if (flag < 0)
|
||||
for (i = 0; i < n; i++)
|
||||
for (i = 0; i < fix->size_local_rows; i++)
|
||||
combine(one,fix_array[i][jm1],i);
|
||||
else one = fix_array[flag][jm1];
|
||||
}
|
||||
|
||||
@ -135,8 +135,8 @@ void ComputeTempSphere::dof_compute()
|
||||
// user should correct this via compute_modify if needed
|
||||
|
||||
double *radius = atom->radius;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
const int *mask = atom->mask;
|
||||
const int nlocal = atom->nlocal;
|
||||
|
||||
count = 0;
|
||||
if (domain->dimension == 3) {
|
||||
@ -170,9 +170,6 @@ void ComputeTempSphere::dof_compute()
|
||||
if (mode == ALL) dof -= tbias->dof_remove(-1) * natoms_temp;
|
||||
|
||||
} else if (tempbias == 2) {
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
tbias->dof_remove_pre();
|
||||
|
||||
count = 0;
|
||||
|
||||
@ -310,7 +310,7 @@ void CreateBonds::many()
|
||||
// recount bonds
|
||||
|
||||
bigint nbonds = 0;
|
||||
for (int i = 0; i < nlocal; i++) nbonds += num_bond[i];
|
||||
for (i = 0; i < nlocal; i++) nbonds += num_bond[i];
|
||||
|
||||
MPI_Allreduce(&nbonds,&atom->nbonds,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
if (!force->newton_bond) atom->nbonds /= 2;
|
||||
|
||||
@ -177,9 +177,9 @@ void DihedralHybrid::settings(int narg, char **arg)
|
||||
// delete old lists, since cannot just change settings
|
||||
|
||||
if (nstyles) {
|
||||
for (int i = 0; i < nstyles; i++) delete styles[i];
|
||||
for (i = 0; i < nstyles; i++) delete styles[i];
|
||||
delete [] styles;
|
||||
for (int i = 0; i < nstyles; i++) delete [] keywords[i];
|
||||
for (i = 0; i < nstyles; i++) delete [] keywords[i];
|
||||
delete [] keywords;
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ void DihedralHybrid::settings(int narg, char **arg)
|
||||
memory->destroy(map);
|
||||
delete [] ndihedrallist;
|
||||
delete [] maxdihedral;
|
||||
for (int i = 0; i < nstyles; i++)
|
||||
for (i = 0; i < nstyles; i++)
|
||||
memory->destroy(dihedrallist[i]);
|
||||
delete [] dihedrallist;
|
||||
}
|
||||
|
||||
@ -317,14 +317,14 @@ void DumpCustom::init_style()
|
||||
// check that fix frequency is acceptable
|
||||
|
||||
int icompute;
|
||||
for (int i = 0; i < ncompute; i++) {
|
||||
for (i = 0; i < ncompute; i++) {
|
||||
icompute = modify->find_compute(id_compute[i]);
|
||||
if (icompute < 0) error->all(FLERR,"Could not find dump custom compute ID");
|
||||
compute[i] = modify->compute[icompute];
|
||||
}
|
||||
|
||||
int ifix;
|
||||
for (int i = 0; i < nfix; i++) {
|
||||
for (i = 0; i < nfix; i++) {
|
||||
ifix = modify->find_fix(id_fix[i]);
|
||||
if (ifix < 0) error->all(FLERR,"Could not find dump custom fix ID");
|
||||
fix[i] = modify->fix[ifix];
|
||||
@ -333,7 +333,7 @@ void DumpCustom::init_style()
|
||||
}
|
||||
|
||||
int ivariable;
|
||||
for (int i = 0; i < nvariable; i++) {
|
||||
for (i = 0; i < nvariable; i++) {
|
||||
ivariable = input->variable->find(id_variable[i]);
|
||||
if (ivariable < 0)
|
||||
error->all(FLERR,"Could not find dump custom variable name");
|
||||
@ -341,7 +341,7 @@ void DumpCustom::init_style()
|
||||
}
|
||||
|
||||
int icustom;
|
||||
for (int i = 0; i < ncustom; i++) {
|
||||
for (i = 0; i < ncustom; i++) {
|
||||
icustom = atom->find_custom(id_custom[i],flag_custom[i]);
|
||||
if (icustom < 0)
|
||||
error->all(FLERR,"Could not find custom per-atom property ID");
|
||||
@ -546,7 +546,7 @@ int DumpCustom::count()
|
||||
|
||||
// grow choose and variable vbuf arrays if needed
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
const int nlocal = atom->nlocal;
|
||||
if (atom->nmax > maxlocal) {
|
||||
maxlocal = atom->nmax;
|
||||
|
||||
@ -620,7 +620,6 @@ int DumpCustom::count()
|
||||
double *values;
|
||||
double value;
|
||||
int nstride,lastflag;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int ithresh = 0; ithresh < nthresh; ithresh++) {
|
||||
|
||||
@ -1536,7 +1535,6 @@ int DumpCustom::parse_fields(int narg, char **arg)
|
||||
|
||||
default:
|
||||
return iarg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1042,7 +1042,7 @@ void DumpImage::create_image()
|
||||
// render outline of my sub-box, orthogonal or triclinic
|
||||
|
||||
if (subboxflag) {
|
||||
double diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
|
||||
diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
|
||||
if (domain->dimension == 3) diameter = MIN(diameter,boxzhi-boxzlo);
|
||||
diameter *= subboxdiam;
|
||||
|
||||
@ -1072,7 +1072,7 @@ void DumpImage::create_image()
|
||||
// render outline of simulation box, orthogonal or triclinic
|
||||
|
||||
if (boxflag) {
|
||||
double diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
|
||||
diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
|
||||
if (domain->dimension == 3) diameter = MIN(diameter,boxzhi-boxzlo);
|
||||
diameter *= boxdiam;
|
||||
|
||||
@ -1100,7 +1100,7 @@ void DumpImage::create_image()
|
||||
// offset by 10% of box size and scale by axeslen
|
||||
|
||||
if (axesflag) {
|
||||
double diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
|
||||
diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
|
||||
if (domain->dimension == 3) diameter = MIN(diameter,boxzhi-boxzlo);
|
||||
diameter *= axesdiam;
|
||||
|
||||
|
||||
@ -198,14 +198,14 @@ void DumpLocal::init_style()
|
||||
// check that fix frequency is acceptable
|
||||
|
||||
int icompute;
|
||||
for (int i = 0; i < ncompute; i++) {
|
||||
for (i = 0; i < ncompute; i++) {
|
||||
icompute = modify->find_compute(id_compute[i]);
|
||||
if (icompute < 0) error->all(FLERR,"Could not find dump local compute ID");
|
||||
compute[i] = modify->compute[icompute];
|
||||
}
|
||||
|
||||
int ifix;
|
||||
for (int i = 0; i < nfix; i++) {
|
||||
for (i = 0; i < nfix; i++) {
|
||||
ifix = modify->find_fix(id_fix[i]);
|
||||
if (ifix < 0) error->all(FLERR,"Could not find dump local fix ID");
|
||||
fix[i] = modify->fix[ifix];
|
||||
@ -332,14 +332,14 @@ int DumpLocal::count()
|
||||
|
||||
nmine = -1;
|
||||
|
||||
for (int i = 0; i < ncompute; i++) {
|
||||
for (i = 0; i < ncompute; i++) {
|
||||
if (nmine < 0) nmine = compute[i]->size_local_rows;
|
||||
else if (nmine != compute[i]->size_local_rows)
|
||||
error->one(FLERR,
|
||||
"Dump local count is not consistent across input fields");
|
||||
}
|
||||
|
||||
for (int i = 0; i < nfix; i++) {
|
||||
for (i = 0; i < nfix; i++) {
|
||||
if (nmine < 0) nmine = fix[i]->size_local_rows;
|
||||
else if (nmine != fix[i]->size_local_rows)
|
||||
error->one(FLERR,
|
||||
|
||||
@ -488,7 +488,7 @@ void FixAveChunk::init()
|
||||
|
||||
for (int m = 0; m < nvalues; m++) {
|
||||
if (which[m] == ArgInfo::COMPUTE) {
|
||||
int icompute = modify->find_compute(ids[m]);
|
||||
icompute = modify->find_compute(ids[m]);
|
||||
if (icompute < 0)
|
||||
error->all(FLERR,"Compute ID for fix ave/chunk does not exist");
|
||||
value2index[m] = icompute;
|
||||
@ -984,7 +984,6 @@ void FixAveChunk::end_of_step()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int j;
|
||||
if (ncoord == 0) {
|
||||
for (m = 0; m < nchunk; m++) {
|
||||
fprintf(fp," %d %d %g",m+1,chunkID[m],count_total[m]/normcount);
|
||||
|
||||
Reference in New Issue
Block a user