diff --git a/src/atom.cpp b/src/atom.cpp index ecebf7a52b..00334ca3b5 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1336,7 +1336,7 @@ void Atom::first_reorder() void Atom::sort() { - int i,m,n,ix,iy,iz,ibin,empty,ndone; + int i,m,n,ix,iy,iz,ibin,empty; // re-setup sort bins if needed diff --git a/src/change_box.cpp b/src/change_box.cpp index 9b9d477c2a..2bb5ad45fe 100644 --- a/src/change_box.cpp +++ b/src/change_box.cpp @@ -38,6 +38,7 @@ void ChangeBox::command(int narg, char **arg) int style; if (strcmp(arg[0],"ortho") == 0) style = ORTHO; else if (strcmp(arg[0],"triclinic") == 0) style = TRICLINIC; + else error->all("Illegal change_box command"); if (style == ORTHO && domain->triclinic == 0) error->all("Change_box operation is invalid"); diff --git a/src/compute_erotate_sphere.cpp b/src/compute_erotate_sphere.cpp index 7e6b46528d..1558196cce 100644 --- a/src/compute_erotate_sphere.cpp +++ b/src/compute_erotate_sphere.cpp @@ -102,12 +102,14 @@ double ComputeERotateSphere::compute_scalar() omega[i][2]*omega[i][2]) * radius[i]*radius[i]*rmass[i]; } else { for (i = 0; i < nlocal; i++) - if (mask[i] & groupbit) + if (mask[i] & groupbit) { + itype = type[i]; erotate += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] + omega[i][2]*omega[i][2]) * radius[i]*radius[i]*mass[itype]; + } } - + } else { if (rmass) { for (i = 0; i < nlocal; i++) diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp index 1ac5d84c93..00153b66ac 100644 --- a/src/compute_improper_local.cpp +++ b/src/compute_improper_local.cpp @@ -117,7 +117,6 @@ int ComputeImproperLocal::compute_impropers(int flag) int **improper_atom2 = atom->improper_atom2; int **improper_atom3 = atom->improper_atom3; int **improper_atom4 = atom->improper_atom4; - int **improper_type = atom->improper_type; int *tag = atom->tag; int *mask = atom->mask; int nlocal = atom->nlocal; diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index 392bfef96e..d7c814eafb 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -281,7 +281,7 @@ int ComputePropertyLocal::count_pairs(int allflag, int forceflag) { int i,j,m,n,ii,jj,inum,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz; - double rsq,eng,fpair,factor_coul,factor_lj; + double rsq,factor_coul,factor_lj; int *ilist,*jlist,*numneigh,**firstneigh; double **x = atom->x; @@ -306,7 +306,6 @@ int ComputePropertyLocal::count_pairs(int allflag, int forceflag) // loop over neighbors of my atoms // skip if I or J are not in group - Pair *pair = force->pair; double **cutsq = force->pair->cutsq; m = n = 0; @@ -453,7 +452,6 @@ int ComputePropertyLocal::count_dihedrals(int flag) int **dihedral_atom2 = atom->dihedral_atom2; int **dihedral_atom3 = atom->dihedral_atom3; int **dihedral_atom4 = atom->dihedral_atom4; - int **dihedral_type = atom->dihedral_type; int *tag = atom->tag; int *mask = atom->mask; int nlocal = atom->nlocal; @@ -497,7 +495,6 @@ int ComputePropertyLocal::count_impropers(int flag) int **improper_atom2 = atom->improper_atom2; int **improper_atom3 = atom->improper_atom3; int **improper_atom4 = atom->improper_atom4; - int **improper_type = atom->improper_type; int *tag = atom->tag; int *mask = atom->mask; int nlocal = atom->nlocal; diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index 7e98a8145f..6d3bb452a4 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -171,7 +171,6 @@ double ComputeTempProfile::compute_scalar() bin_average(); - double **x = atom->x; double **v = atom->v; double *mass = atom->mass; double *rmass = atom->rmass; @@ -215,7 +214,6 @@ void ComputeTempProfile::compute_vector() bin_average(); - double **x = atom->x; double **v = atom->v; double *mass = atom->mass; double *rmass = atom->rmass; @@ -277,7 +275,6 @@ void ComputeTempProfile::remove_bias(int i, double *v) void ComputeTempProfile::remove_bias_all() { - double **x = atom->x; double **v = atom->v; int *mask = atom->mask; int nlocal = atom->nlocal; @@ -367,7 +364,6 @@ void ComputeTempProfile::bin_average() // sum each particle's velocity to appropriate bin - double **x = atom->x; double **v = atom->v; int *mask = atom->mask; int nlocal = atom->nlocal; diff --git a/src/read_restart.cpp b/src/read_restart.cpp index 33a3e01d3e..bf908caaba 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -481,10 +481,6 @@ void ReadRestart::header() } } - int flag = 0; - if ((xperiodic != domain->xperiodic || yperiodic != domain->yperiodic || - zperiodic != domain->zperiodic)) flag = 1; - domain->boundary[0][0] = boundary[0][0]; domain->boundary[0][1] = boundary[0][1]; domain->boundary[1][0] = boundary[1][0]; diff --git a/src/region.cpp b/src/region.cpp index bb41c50f04..e67a2b71c5 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -181,8 +181,6 @@ int Region::dynamic_check() int Region::match(double x, double y, double z) { - double a[3],b[3],c[3],d[3]; - if (dynamic) { double delta = (update->ntimestep - time_origin) * dt; if (dynamic == VELOCITY) { diff --git a/src/region_block.cpp b/src/region_block.cpp index 21321d25c5..dada041049 100644 --- a/src/region_block.cpp +++ b/src/region_block.cpp @@ -197,7 +197,6 @@ int RegBlock::surface_interior(double *x, double cutoff) int RegBlock::surface_exterior(double *x, double cutoff) { double xp,yp,zp; - double delta; // x is far enough from block that there is no contact // x is interior to block diff --git a/src/region_cone.cpp b/src/region_cone.cpp index 0c45de6adb..c6b94c295c 100644 --- a/src/region_cone.cpp +++ b/src/region_cone.cpp @@ -262,18 +262,18 @@ int RegCone::surface_interior(double *x, double cutoff) } } else if (axis == 'y') { - delx = x[0] - c1; - delz = x[2] - c2; - r = sqrt(delx*delx + delz*delz); + del1 = x[0] - c1; + del2 = x[2] - c2; + r = sqrt(del1*del1 + del2*del2); currentradius = radiuslo + (x[1]-lo)*(radiushi-radiuslo)/(hi-lo); - // x is exterior to cone + // y is exterior to cone if (r > currentradius || x[1] < lo || x[1] > hi) return 0; - // x is interior to cone or on its surface - // surflo = pt on outer circle of bottom end plane, same dir as x vs axis - // surfhi = pt on outer circle of top end plane, same dir as x vs axis + // y is interior to cone or on its surface + // surflo = pt on outer circle of bottom end plane, same dir as y vs axis + // surfhi = pt on outer circle of top end plane, same dir as y vs axis if (r > 0.0) { surflo[0] = c1 + del1*radiuslo/r; @@ -312,18 +312,18 @@ int RegCone::surface_interior(double *x, double cutoff) } } else { - delx = x[0] - c1; - dely = x[1] - c2; - r = sqrt(delx*delx + dely*dely); + del1 = x[0] - c1; + del2 = x[1] - c2; + r = sqrt(del1*del1 + del2*del2); currentradius = radiuslo + (x[2]-lo)*(radiushi-radiuslo)/(hi-lo); // x is exterior to cone if (r > currentradius || x[2] < lo || x[2] > hi) return 0; - // x is interior to cone or on its surface - // surflo = pt on outer circle of bottom end plane, same dir as x vs axis - // surfhi = pt on outer circle of top end plane, same dir as x vs axis + // z is interior to cone or on its surface + // surflo = pt on outer circle of bottom end plane, same dir as z vs axis + // surfhi = pt on outer circle of top end plane, same dir as z vs axis if (r > 0.0) { surflo[0] = c1 + del1*radiuslo/r; @@ -427,17 +427,17 @@ int RegCone::surface_exterior(double *x, double cutoff) r = sqrt(del1*del1 + del2*del2); currentradius = radiuslo + (x[1]-lo)*(radiushi-radiuslo)/(hi-lo); - // x is far enough from cone that there is no contact - // x is interior to cone + // y is far enough from cone that there is no contact + // y is interior to cone if (r >= maxradius+cutoff || x[1] <= lo-cutoff || x[1] >= hi+cutoff) return 0; if (r < currentradius && x[1] > lo && x[1] < hi) return 0; - // x is exterior to cone or on its surface - // corner1234 = 4 corner pts of half trapezoid = cone surf in plane of x + // y is exterior to cone or on its surface + // corner1234 = 4 corner pts of half trapezoid = cone surf in plane of y // project x to 3 line segments in half trapezoid (4th is axis of cone) - // nearest = point on surface of cone that x is closest to + // nearest = point on surface of cone that y is closest to // could be edge of cone // do not add contact point if r >= cutoff @@ -472,17 +472,17 @@ int RegCone::surface_exterior(double *x, double cutoff) r = sqrt(del1*del1 + del2*del2); currentradius = radiuslo + (x[2]-lo)*(radiushi-radiuslo)/(hi-lo); - // x is far enough from cone that there is no contact - // x is interior to cone + // z is far enough from cone that there is no contact + // z is interior to cone if (r >= maxradius+cutoff || x[2] <= lo-cutoff || x[2] >= hi+cutoff) return 0; if (r < currentradius && x[2] > lo && x[2] < hi) return 0; - // x is exterior to cone or on its surface - // corner1234 = 4 corner pts of half trapezoid = cone surf in plane of x + // z is exterior to cone or on its surface + // corner1234 = 4 corner pts of half trapezoid = cone surf in plane of z // project x to 3 line segments in half trapezoid (4th is axis of cone) - // nearest = point on surface of cone that x is closest to + // nearest = point on surface of cone that z is closest to // could be edge of cone // do not add contact point if r >= cutoff diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index 1c342052e1..58bb51f212 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -231,11 +231,11 @@ int RegCylinder::surface_interior(double *x, double cutoff) del2 = x[2] - c2; r = sqrt(del1*del1 + del2*del2); - // x is exterior to cylinder + // y is exterior to cylinder if (r > radius || x[1] < lo || x[1] > hi) return 0; - // x is interior to cylinder or on its surface + // y is interior to cylinder or on its surface delta = radius - r; if (delta < cutoff && r > 0.0) { @@ -265,11 +265,11 @@ int RegCylinder::surface_interior(double *x, double cutoff) del2 = x[1] - c2; r = sqrt(del1*del1 + del2*del2); - // x is exterior to cylinder + // z is exterior to cylinder if (r > radius || x[2] < lo || x[2] > hi) return 0; - // x is interior to cylinder or on its surface + // z is interior to cylinder or on its surface delta = radius - r; if (delta < cutoff && r > 0.0) { @@ -306,7 +306,7 @@ int RegCylinder::surface_interior(double *x, double cutoff) int RegCylinder::surface_exterior(double *x, double cutoff) { - double del1,del2,r,delta; + double del1,del2,r; double xp,yp,zp; if (axis == 'x') { @@ -345,13 +345,13 @@ int RegCylinder::surface_exterior(double *x, double cutoff) del2 = x[2] - c2; r = sqrt(del1*del1 + del2*del2); - // x is far enough from cylinder that there is no contact - // x is interior to cylinder + // y is far enough from cylinder that there is no contact + // y is interior to cylinder if (r >= radius+cutoff || x[1] <= lo-cutoff || x[1] >= hi+cutoff) return 0; if (r < radius && x[1] > lo && x[1] < hi) return 0; - // x is exterior to cylinder or on its surface + // y is exterior to cylinder or on its surface // xp,yp,zp = point on surface of cylinder that x is closest to // could be edge of cylinder // do not add contact point if r >= cutoff @@ -376,13 +376,13 @@ int RegCylinder::surface_exterior(double *x, double cutoff) del2 = x[1] - c2; r = sqrt(del1*del1 + del2*del2); - // x is far enough from cylinder that there is no contact - // x is interior to cylinder + // z is far enough from cylinder that there is no contact + // z is interior to cylinder if (r >= radius+cutoff || x[2] <= lo-cutoff || x[2] >= hi+cutoff) return 0; if (r < radius && x[2] > lo && x[2] < hi) return 0; - // x is exterior to cylinder or on its surface + // z is exterior to cylinder or on its surface // xp,yp,zp = point on surface of cylinder that x is closest to // could be edge of cylinder // do not add contact point if r >= cutoff diff --git a/src/region_prism.cpp b/src/region_prism.cpp index 0be3a83b94..26d65ab4f7 100644 --- a/src/region_prism.cpp +++ b/src/region_prism.cpp @@ -304,7 +304,7 @@ int RegPrism::surface_interior(double *x, double cutoff) int RegPrism::surface_exterior(double *x, double cutoff) { int i; - double dot,delta; + double dot; double *corner; double xp,yp,zp; diff --git a/src/special.cpp b/src/special.cpp index f786257efa..e23afc8005 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -705,7 +705,6 @@ void Special::dihedral_trim() MPI_Request request; MPI_Status status; - int *tag = atom->tag; int *num_dihedral = atom->num_dihedral; int **dihedral_atom1 = atom->dihedral_atom1; int **dihedral_atom4 = atom->dihedral_atom4; diff --git a/src/temper.cpp b/src/temper.cpp index ded3111764..ef4ba79d79 100644 --- a/src/temper.cpp +++ b/src/temper.cpp @@ -176,7 +176,7 @@ void Temper::command(int narg, char **arg) // setup tempering runs int i,which,partner,swap,partner_set_temp,partner_world; - double pe,pe_partner,ke,boltz_factor,new_temp; + double pe,pe_partner,boltz_factor,new_temp; MPI_Status status; if (me_universe == 0 && universe->uscreen)