various little cleanups to silence compiler warnings

clarify/simplify some code and initialize variables where needed.
also remove dead code and unused class members
This commit is contained in:
Axel Kohlmeyer
2014-04-10 18:21:12 +02:00
parent 5bb50f8841
commit 5fcfc9f575
39 changed files with 94 additions and 119 deletions

View File

@ -57,8 +57,8 @@ public:
/// implementation
cvm::rvector grad;
/// \brief Default constructor, setting id and index to invalid numbers
atom() : id (-1), index (-1) { reset_data(); }
/// \brief Default constructor, setting index and id to invalid numbers
atom() : index (-1), id (-1) { reset_data(); }
/// \brief Initialize an atom for collective variable calculation
/// and get its internal identifier \param atom_number Atom index in

View File

@ -32,7 +32,7 @@ class FixWallColloid : public FixWall {
void wall_particle(int, int, double);
private:
double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6];
double coeff1[6],coeff2[6],coeff3[6],coeff4[6];
};
}

View File

@ -209,7 +209,8 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
// volume_one = volume of inserted particle (with max possible radius)
// in 3d, insure dy >= 1, for quasi-2d simulations
double volume,volume_one;
double volume,volume_one=0.0;
dstyle = -1;
if (domain->dimension == 3) {
if (region_style == 1) {
double dy = yhi - ylo;

View File

@ -1277,7 +1277,7 @@ void PPPMDisp::init_coeffs() // local pair coeffs
err = bmax/amax;
if (err > 1.0e-4) {
char str[128];
sprintf(str,"Error in splitting of dispersion coeffs is estimated %g%",err);
sprintf(str,"Estimated error in splitting of dispersion coeffs is %g",err);
error->warning(FLERR, str);
}
// set B

View File

@ -248,7 +248,6 @@ void FixDeposit::pre_exchange()
{
int i,j,m,n,nlocalprev,flag,flagall;
double coord[3],lamda[3],delx,dely,delz,rsq;
double alpha,beta,gamma;
double r[3],vnew[3],rotmat[3][3],quat[4];
double *newcoord;

View File

@ -36,7 +36,6 @@ class ComputeTempEff : public Compute {
private:
int fix_dof;
double tfactor;
double *inertia;
void dof_compute();
};

View File

@ -342,7 +342,7 @@ void PairCDEAM::compute(int eflag, int vflag)
x_j = rhoB[j]/rho[j];
ASSERT(x_j >= 0 && x_j<=1.0);
double D_j;
double D_j=0.0;
if(cdeamVersion == 1) {
// Calculate derivative of h(x_j) polynomial function.
double h_prime_j = evalHprime(x_j);
@ -375,7 +375,7 @@ void PairCDEAM::compute(int eflag, int vflag)
}
else {
// We have a concentration dependence for the i-j interaction.
double h;
double h=0.0;
if(cdeamVersion == 1) {
// Calculate h(x_i) polynomial function.
double h_i = evalH(x_i);

View File

@ -173,33 +173,6 @@ extern "C" {
return pte_vdw_radius[idx];
}
static int get_pte_idx(const char *label)
{
int i;
char atom[3];
/* zap string */
atom[0] = (char) 0;
atom[1] = (char) 0;
atom[2] = (char) 0;
/* if we don't have a null-pointer, there must be at least two
* chars, which is all we need. we convert to the capitalization
* convention of the table above during assignment. */
if (label != NULL) {
atom[0] = (char) toupper((int) label[0]);
atom[1] = (char) tolower((int) label[1]);
}
/* discard numbers in atom label */
if (isdigit(atom[1])) atom[1] = (char) 0;
for (i=0; i < nr_pte_entries; ++i) {
if ( (pte_label[i][0] == atom[0])
&& (pte_label[i][1] == atom[1]) ) return i;
}
return 0;
}
static int get_pte_idx_from_string(const char *label) {
int i, ind;
char atom[3];
@ -296,15 +269,6 @@ extern "C" {
return (void *)LoadLibrary(fname);
}
// report error message from dlopen
static const char *my_dlerror(void) {
static CHAR szBuf[80];
DWORD dw = GetLastError();
sprintf(szBuf, "my_dlopen failed: GetLastError returned %u\n", dw);
return szBuf;
}
// resolve a symbol in shared object
static void *my_dlsym(void *h, const char *sym) {
return (void *)GetProcAddress((HINSTANCE)h, sym);
@ -377,11 +341,6 @@ extern "C" {
return dlopen(fname, RTLD_NOW);
}
// report error message from dlopen
static const char *my_dlerror(void) {
return dlerror();
}
// resolve a symbol in shared object
static void *my_dlsym(void *h, const char *sym) {
return dlsym(h, sym);

View File

@ -98,6 +98,7 @@ void AngleClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a;

View File

@ -95,6 +95,7 @@ void AngleCosineDeltaOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a;

View File

@ -95,6 +95,7 @@ void AngleCosineOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a;

View File

@ -98,6 +98,7 @@ void AngleCosinePeriodicOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a;

View File

@ -96,6 +96,7 @@ void AngleCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a;

View File

@ -96,6 +96,7 @@ void AngleCosineSquaredOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a;

View File

@ -95,6 +95,7 @@ void AngleDipoleOMP::eval(int nfrom, int nto, ThrData * const thr)
const int nlocal = atom->nlocal;
const double f1[3] = {0.0, 0.0, 0.0};
const double f3[3] = {0.0, 0.0, 0.0};
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
iDip = anglelist[n][0]; // dipole whose orientation is to be restrained

View File

@ -96,6 +96,7 @@ void AngleFourierSimpleOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a;

View File

@ -96,6 +96,7 @@ void AngleQuarticOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a;

View File

@ -98,6 +98,7 @@ void AngleSDKOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a;

View File

@ -96,6 +96,7 @@ void AngleTableOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a;

View File

@ -90,6 +90,7 @@ void BondClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0];
const int nlocal = atom->nlocal;
ebond = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = bondlist[n].a;

View File

@ -93,6 +93,7 @@ void BondFENEExpandOMP::eval(int nfrom, int nto, ThrData * const thr)
const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0];
const int nlocal = atom->nlocal;
const int tid = thr->get_tid();
ebond = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = bondlist[n].a;

View File

@ -92,6 +92,7 @@ void BondFENEOMP::eval(int nfrom, int nto, ThrData * const thr)
const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0];
const int nlocal = atom->nlocal;
const int tid = thr->get_tid();
ebond = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = bondlist[n].a;

View File

@ -89,6 +89,7 @@ void BondHarmonicShiftCutOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0];
const int nlocal = atom->nlocal;
ebond = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = bondlist[n].a;

View File

@ -89,6 +89,7 @@ void BondMorseOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0];
const int nlocal = atom->nlocal;
ebond = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = bondlist[n].a;

View File

@ -90,6 +90,7 @@ void BondTableOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0];
const int nlocal = atom->nlocal;
ebond = 0.0;
for (n = nfrom; n < nto; n++) {
i1 = bondlist[n].a;

View File

@ -143,7 +143,7 @@ void Neighbor::respa_nsq_no_newton_omp(NeighList *list)
tag[j]-tagprev);
else which = 0;
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
else if ((minchange = domain->minimum_image_check(delx,dely,delz)))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
@ -328,7 +328,7 @@ void Neighbor::respa_nsq_newton_omp(NeighList *list)
tag[j]-tagprev);
else which = 0;
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
else if ((minchange = domain->minimum_image_check(delx,dely,delz)))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
@ -506,7 +506,7 @@ void Neighbor::respa_bin_no_newton_omp(NeighList *list)
tag[j]-tagprev);
else which = 0;
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
else if ((minchange = domain->minimum_image_check(delx,dely,delz)))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
@ -688,7 +688,7 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
tag[j]-tagprev);
else which = 0;
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
else if ((minchange = domain->minimum_image_check(delx,dely,delz)))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
@ -732,7 +732,7 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
tag[j]-tagprev);
else which = 0;
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
else if ((minchange = domain->minimum_image_check(delx,dely,delz)))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
@ -919,7 +919,7 @@ void Neighbor::respa_bin_newton_tri_omp(NeighList *list)
tag[j]-tagprev);
else which = 0;
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
else if ((minchange = domain->minimum_image_check(delx,dely,delz)))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;

View File

@ -73,7 +73,7 @@ class AtomVecSphere : public AtomVec {
int *type,*mask;
imageint *image;
double **x,**v,**f;
double *radius,*density,*rmass;
double *radius,*rmass;
double **omega,**torque;
int radvary;
};

View File

@ -11,6 +11,8 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
//#define BALANCE_DEBUG 1
#include "lmptype.h"
#include "mpi.h"
#include "math.h"
@ -31,8 +33,6 @@ using namespace LAMMPS_NS;
enum{NONE,UNIFORM,USER,DYNAMIC};
enum{X,Y,Z};
//#define BALANCE_DEBUG 1
/* ---------------------------------------------------------------------- */
Balance::Balance(LAMMPS *lmp) : Pointers(lmp)
@ -434,7 +434,7 @@ void Balance::static_setup(char *str)
ndim = strlen(str);
bdim = new int[ndim];
for (int i = 0; i < strlen(str); i++) {
for (int i = 0; i < ndim; i++) {
if (str[i] == 'x') bdim[i] = X;
if (str[i] == 'y') bdim[i] = Y;
if (str[i] == 'z') bdim[i] = Z;
@ -867,11 +867,11 @@ void Balance::dumpout(bigint tstep, FILE *bfp)
debug output for Idim and count
only called by proc 0
------------------------------------------------------------------------- */
#ifdef BALANCE_DEBUG
void Balance::debug_output(int idim, int m, int np, double *split)
{
int i;
const char *dim;
const char *dim = NULL;
double *boxlo = domain->boxlo;
double *prd = domain->prd;
@ -879,41 +879,42 @@ void Balance::debug_output(int idim, int m, int np, double *split)
if (bdim[idim] == X) dim = "X";
else if (bdim[idim] == Y) dim = "Y";
else if (bdim[idim] == Z) dim = "Z";
printf("Dimension %s, Iteration %d\n",dim,m);
fprintf(stderr,"Dimension %s, Iteration %d\n",dim,m);
printf(" Count:");
for (i = 0; i < np; i++) printf(" " BIGINT_FORMAT,count[i]);
printf("\n");
printf(" Sum:");
for (i = 0; i <= np; i++) printf(" " BIGINT_FORMAT,sum[i]);
printf("\n");
printf(" Target:");
for (i = 0; i <= np; i++) printf(" " BIGINT_FORMAT,target[i]);
printf("\n");
printf(" Actual cut:");
fprintf(stderr," Count:");
for (i = 0; i < np; i++) fprintf(stderr," " BIGINT_FORMAT,count[i]);
fprintf(stderr,"\n");
fprintf(stderr," Sum:");
for (i = 0; i <= np; i++) fprintf(stderr," " BIGINT_FORMAT,sum[i]);
fprintf(stderr,"\n");
fprintf(stderr," Target:");
for (i = 0; i <= np; i++) fprintf(stderr," " BIGINT_FORMAT,target[i]);
fprintf(stderr,"\n");
fprintf(stderr," Actual cut:");
for (i = 0; i <= np; i++)
printf(" %g",boxlo[bdim[idim]] + split[i]*prd[bdim[idim]]);
printf("\n");
printf(" Split:");
for (i = 0; i <= np; i++) printf(" %g",split[i]);
printf("\n");
printf(" Low:");
for (i = 0; i <= np; i++) printf(" %g",lo[i]);
printf("\n");
printf(" Low-sum:");
for (i = 0; i <= np; i++) printf(" " BIGINT_FORMAT,losum[i]);
printf("\n");
printf(" Hi:");
for (i = 0; i <= np; i++) printf(" %g",hi[i]);
printf("\n");
printf(" Hi-sum:");
for (i = 0; i <= np; i++) printf(" " BIGINT_FORMAT,hisum[i]);
printf("\n");
printf(" Delta:");
for (i = 0; i < np; i++) printf(" %g",split[i+1]-split[i]);
printf("\n");
fprintf(stderr," %g",boxlo[bdim[idim]] + split[i]*prd[bdim[idim]]);
fprintf(stderr,"\n");
fprintf(stderr," Split:");
for (i = 0; i <= np; i++) fprintf(stderr," %g",split[i]);
fprintf(stderr,"\n");
fprintf(stderr," Low:");
for (i = 0; i <= np; i++) fprintf(stderr," %g",lo[i]);
fprintf(stderr,"\n");
fprintf(stderr," Low-sum:");
for (i = 0; i <= np; i++) fprintf(stderr," " BIGINT_FORMAT,losum[i]);
fprintf(stderr,"\n");
fprintf(stderr," Hi:");
for (i = 0; i <= np; i++) fprintf(stderr," %g",hi[i]);
fprintf(stderr,"\n");
fprintf(stderr," Hi-sum:");
for (i = 0; i <= np; i++) fprintf(stderr," " BIGINT_FORMAT,hisum[i]);
fprintf(stderr,"\n");
fprintf(stderr," Delta:");
for (i = 0; i < np; i++) fprintf(stderr," %g",split[i+1]-split[i]);
fprintf(stderr,"\n");
bigint max = 0;
for (i = 0; i < np; i++) max = MAX(max,count[i]);
printf(" Imbalance factor: %g\n",1.0*max*np/target[np]);
fprintf(stderr," Imbalance factor: %g\n",1.0*max*np/target[np]);
}
#endif

View File

@ -69,7 +69,9 @@ class Balance : protected Pointers {
void tally(int, int, double *);
int adjust(int, double *);
int binary(double, int, double *);
#ifdef BALANCE_DEBUG
void debug_output(int, int, int, double *);
#endif
};
}

View File

@ -45,7 +45,7 @@ enum{PERATOM,LOCAL};
ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
int iarg;
int iarg = 0;
if (strcmp(style,"reduce") == 0) {
if (narg < 5) error->all(FLERR,"Illegal compute reduce command");
idregion = NULL;
@ -59,7 +59,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
idregion = new char[n];
strcpy(idregion,arg[3]);
iarg = 4;
}
} else error->all(FLERR,"Unkown derived compute reduce style");
if (strcmp(arg[iarg],"sum") == 0) mode = SUM;
else if (strcmp(arg[iarg],"min") == 0) mode = MINN;

View File

@ -43,7 +43,7 @@ class ComputeTempRamp : public Compute {
private:
int coord_dim;
double coord_lo,coord_hi,inv_coord_delta;
double coord_lo,coord_hi;
int v_dim;
double v_lo,v_hi;
int scaleflag,fix_dof;

View File

@ -63,7 +63,7 @@ void DeleteBonds::command(int narg, char **arg)
// set style and which = type value
int style;
int style = -1;
if (strcmp(arg[1],"multi") == 0) style = MULTI;
else if (strcmp(arg[1],"atom") == 0) style = ATOM;
else if (strcmp(arg[1],"bond") == 0) style = BOND;

View File

@ -58,7 +58,7 @@ void DisplaceAtoms::command(int narg, char **arg)
if (igroup == -1) error->all(FLERR,"Could not find displace_atoms group ID");
int groupbit = group->bitmask[igroup];
int style;
int style=-1;
if (strcmp(arg[1],"move") == 0) style = MOVE;
else if (strcmp(arg[1],"ramp") == 0) style = RAMP;
else if (strcmp(arg[1],"random") == 0) style = RANDOM;

View File

@ -730,10 +730,12 @@ void FixAveSpatial::end_of_step()
MPI_DOUBLE,MPI_SUM,world);
for (m = 0; m < nbins; m++) {
if (count_sum[m] > 0.0)
for (j = 0; j < nvalues; j++)
for (j = 0; j < nvalues; j++) {
if (which[j] == DENSITY_NUMBER) values_sum[m][j] /= repeat;
else if (which[j] == DENSITY_MASS) values_sum[m][j] *= mv2d/repeat;
else values_sum[m][j] /= count_sum[m];
else if (which[j] == DENSITY_MASS) {
values_sum[m][j] *= mv2d/repeat;
} else values_sum[m][j] /= count_sum[m];
}
count_sum[m] /= repeat;
}
} else {

View File

@ -55,12 +55,13 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) :
if (nevery < 0 || nitermax <= 0 || thresh < 1.0)
error->all(FLERR,"Illegal fix balance command");
for (int i = 0; i < strlen(bstr); i++) {
int blen = strlen(bstr);
for (int i = 0; i < blen; i++) {
if (bstr[i] != 'x' && bstr[i] != 'y' && bstr[i] != 'z')
error->all(FLERR,"Fix balance string is invalid");
if (bstr[i] == 'z' && dimension == 2)
error->all(FLERR,"Fix balance string is invalid for 2d simulation");
for (int j = i+1; j < strlen(bstr); j++)
for (int j = i+1; j < blen; j++)
if (bstr[i] == bstr[j])
error->all(FLERR,"Fix balance string is invalid");
}

View File

@ -37,7 +37,7 @@ class FixVector : public Fix {
private:
int nvalues;
int *which,*argindex,*value2index,*offcol;
int *which,*argindex,*value2index;
char **ids;
int ncount; // # of values currently in growing vector or array

View File

@ -187,7 +187,7 @@ void Group::assign(int narg, char **arg)
strcmp(arg[2],"<=") == 0 || strcmp(arg[2],">=") == 0 ||
strcmp(arg[2],"<>") == 0)) {
int condition;
int condition = -1;
if (strcmp(arg[2],"<") == 0) condition = LT;
else if (strcmp(arg[2],"<=") == 0) condition = LE;
else if (strcmp(arg[2],">") == 0) condition = GT;

View File

@ -895,7 +895,7 @@ void Input::partition()
{
if (narg < 3) error->all(FLERR,"Illegal partition command");
int yesflag;
int yesflag=-1;
if (strcmp(arg[0],"yes") == 0) yesflag = 1;
else if (strcmp(arg[0],"no") == 0) yesflag = 0;
else error->all(FLERR,"Illegal partition command");
@ -1349,7 +1349,7 @@ void Input::neighbor_command()
void Input::newton()
{
int newton_pair,newton_bond;
int newton_pair=1,newton_bond=1;
if (narg == 1) {
if (strcmp(arg[0],"off") == 0) newton_pair = newton_bond = 0;
@ -1366,15 +1366,9 @@ void Input::newton()
force->newton_pair = newton_pair;
if (newton_bond == 0) {
if (domain->box_exist && force->newton_bond == 1)
error->all(FLERR,"Newton bond change after simulation box is defined");
force->newton_bond = 0;
} else {
if (domain->box_exist && force->newton_bond == 0)
error->all(FLERR,"Newton bond change after simulation box is defined");
force->newton_bond = 1;
}
if (domain->box_exist && (newton_bond != force->newton_bond))
error->all(FLERR,"Newton bond change after simulation box is defined");
force->newton_bond = newton_bond;
if (newton_pair || newton_bond) force->newton = 1;
else force->newton = 0;

View File

@ -153,12 +153,12 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
} else if (strcmp(arg[iarg],"orient") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal lattice command");
int dim;
int dim = -1;
if (strcmp(arg[iarg+1],"x") == 0) dim = 0;
else if (strcmp(arg[iarg+1],"y") == 0) dim = 1;
else if (strcmp(arg[iarg+1],"z") == 0) dim = 2;
else error->all(FLERR,"Illegal lattice command");
int *orient;
int *orient = NULL;
if (dim == 0) orient = orientx;
else if (dim == 1) orient = orienty;
else if (dim == 2) orient = orientz;