diff --git a/src/BODY/body_nparticle.h b/src/BODY/body_nparticle.h index 22f15ee4fa..90897cb2f6 100644 --- a/src/BODY/body_nparticle.h +++ b/src/BODY/body_nparticle.h @@ -29,11 +29,11 @@ class BodyNparticle : public Body { public: BodyNparticle(class LAMMPS *, int, char **); ~BodyNparticle(); - int nsub(class AtomVecBody::Bonus *); - double *coords(class AtomVecBody::Bonus *); + int nsub(struct AtomVecBody::Bonus *); + double *coords(struct AtomVecBody::Bonus *); - int pack_border_body(class AtomVecBody::Bonus *, double *); - int unpack_border_body(class AtomVecBody::Bonus *, double *); + int pack_border_body(struct AtomVecBody::Bonus *, double *); + int unpack_border_body(struct AtomVecBody::Bonus *, double *); void data_body(int, int, int, char **, char **); int noutrow(int); diff --git a/src/DIPOLE/atom_vec_dipole.h b/src/DIPOLE/atom_vec_dipole.h index ebc20a6448..c6ee23def1 100644 --- a/src/DIPOLE/atom_vec_dipole.h +++ b/src/DIPOLE/atom_vec_dipole.h @@ -63,7 +63,7 @@ class AtomVecDipole : public AtomVec { int *type,*mask; imageint *image; double **x,**v,**f; - double *q,**mu,**omega,**torque; + double *q,**mu; }; } diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index 722dc04854..bdf5cb4e05 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -495,7 +495,7 @@ int FixOrientFCC::pack_comm(int n, int *list, double *buf, buf[m++] = nbr[k].duxi; for (j = 0; j < num; j++) { - if (use_xismooth) buf[m++] = nbr[m].xismooth[j]; + if (use_xismooth) buf[m++] = nbr[k].xismooth[j]; buf[m++] = nbr[k].dxi[j][0]; buf[m++] = nbr[k].dxi[j][1]; buf[m++] = nbr[k].dxi[j][2]; diff --git a/src/PERI/atom_vec_peri.h b/src/PERI/atom_vec_peri.h index 7861a70f68..52af603365 100644 --- a/src/PERI/atom_vec_peri.h +++ b/src/PERI/atom_vec_peri.h @@ -63,7 +63,7 @@ class AtomVecPeri : public AtomVec { int *type,*mask; imageint *image; double **x,**v,**f; - double *vfrac,*density,*rmass,*s0,**x0; + double *vfrac,*rmass,*s0,**x0; }; } diff --git a/src/USER-OMP/dihedral_fourier_omp.cpp b/src/USER-OMP/dihedral_fourier_omp.cpp index c84dda7da2..1aa80c578b 100644 --- a/src/USER-OMP/dihedral_fourier_omp.cpp +++ b/src/USER-OMP/dihedral_fourier_omp.cpp @@ -158,7 +158,9 @@ void DihedralFourierOMP::eval(int nfrom, int nto, ThrData * const thr) if (screen) { char str[128]; - sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d", + sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " " + TAGINT_FORMAT " " TAGINT_FORMAT " " + TAGINT_FORMAT " " TAGINT_FORMAT, me,thr->get_tid(),update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); error->warning(FLERR,str,0); diff --git a/src/USER-OMP/dihedral_helix_omp.cpp b/src/USER-OMP/dihedral_helix_omp.cpp index 61f25c2833..316fbfcb3f 100644 --- a/src/USER-OMP/dihedral_helix_omp.cpp +++ b/src/USER-OMP/dihedral_helix_omp.cpp @@ -192,7 +192,9 @@ void DihedralHelixOMP::eval(int nfrom, int nto, ThrData * const thr) if (screen) { char str[128]; - sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d", + sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " " + TAGINT_FORMAT " " TAGINT_FORMAT " " + TAGINT_FORMAT " " TAGINT_FORMAT, me,thr->get_tid(),update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); error->warning(FLERR,str,0); diff --git a/src/USER-OMP/improper_class2_omp.cpp b/src/USER-OMP/improper_class2_omp.cpp index bb8b1e3a3e..2cf71f675c 100644 --- a/src/USER-OMP/improper_class2_omp.cpp +++ b/src/USER-OMP/improper_class2_omp.cpp @@ -170,8 +170,9 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr) int me = comm->me; if (screen) { char str[128]; - sprintf(str, - "Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d", + sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " " + TAGINT_FORMAT " " TAGINT_FORMAT " " + TAGINT_FORMAT " " TAGINT_FORMAT, me, thr->get_tid(),update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); error->warning(FLERR,str,0); diff --git a/src/USER-OMP/improper_harmonic_omp.cpp b/src/USER-OMP/improper_harmonic_omp.cpp index 83e5f55131..e323b75e3f 100644 --- a/src/USER-OMP/improper_harmonic_omp.cpp +++ b/src/USER-OMP/improper_harmonic_omp.cpp @@ -152,7 +152,9 @@ void ImproperHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr) if (screen) { char str[128]; - sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d", + sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " " + TAGINT_FORMAT " " TAGINT_FORMAT " " + TAGINT_FORMAT " " TAGINT_FORMAT, me,thr->get_tid(),update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); error->warning(FLERR,str,0); diff --git a/src/finish.cpp b/src/finish.cpp index c63f1377f5..4cb49f3687 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -543,7 +543,7 @@ void Finish::end(int flag) // print thread breakdown only with full timer detail if ((ifix >= 0) && timer->has_full() && me == 0) { - double thr_total; + double thr_total = 0.0; ThrData *td; FixOMP *fixomp = static_cast(lmp->modify->fix[ifix]); for (i=0; i < nthreads; ++i) { diff --git a/src/fix_nve_limit.h b/src/fix_nve_limit.h index cead4f186e..0ce22d6dbb 100644 --- a/src/fix_nve_limit.h +++ b/src/fix_nve_limit.h @@ -39,7 +39,7 @@ class FixNVELimit : public Fix { private: double dtv,dtf; double *step_respa; - int mass_require,ncount; + int ncount; double xlimit,vlimitsq; }; diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 115750e271..0c573fba10 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -525,8 +525,8 @@ int FixPropertyAtom::pack_restart(int i, double *buf) for (int j = 0; j < nvalue; j++) { if (style[j] == MOLECULE) buf[m++] = ubuf(atom->molecule[i]).d; else if (style[j] == CHARGE) buf[m++] = atom->q[i]; - else if (style[j] == INTEGER) buf[m++] = ubuf(atom->ivector[index[m]][i]).d; - else if (style[j] == DOUBLE) buf[m++] = atom->dvector[index[m]][i]; + else if (style[j] == INTEGER) buf[m++] = ubuf(atom->ivector[index[j]][i]).d; + else if (style[j] == DOUBLE) buf[m++] = atom->dvector[index[j]][i]; } return nvalue+1; @@ -552,9 +552,9 @@ void FixPropertyAtom::unpack_restart(int nlocal, int nth) else if (style[i] == CHARGE) atom->q[nlocal] = extra[nlocal][m++]; else if (style[i] == INTEGER) - atom->ivector[index[m]][nlocal] = (int) ubuf(extra[nlocal][m++]).i; + atom->ivector[index[i]][nlocal] = (int) ubuf(extra[nlocal][m++]).i; else if (style[i] == DOUBLE) - atom->dvector[index[m]][nlocal] = extra[nlocal][m++]; + atom->dvector[index[i]][nlocal] = extra[nlocal][m++]; } } diff --git a/src/pair.cpp b/src/pair.cpp index df3346a4ed..8670b34737 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -42,7 +42,7 @@ using namespace LAMMPS_NS; #define EWALD_F 1.12837917 -enum{RLINEAR,RSQ,BMP}; +enum{NONE,RLINEAR,RSQ,BMP}; /* ---------------------------------------------------------------------- */ @@ -627,15 +627,14 @@ void Pair::free_disp_tables() double Pair::mix_energy(double eps1, double eps2, double sig1, double sig2) { - double value; if (mix_flag == GEOMETRIC) - value = sqrt(eps1*eps2); + return sqrt(eps1*eps2); else if (mix_flag == ARITHMETIC) - value = sqrt(eps1*eps2); + return sqrt(eps1*eps2); else if (mix_flag == SIXTHPOWER) - value = 2.0 * sqrt(eps1*eps2) * - pow(sig1,3.0) * pow(sig2,3.0) / (pow(sig1,6.0) + pow(sig2,6.0)); - return value; + return (2.0 * sqrt(eps1*eps2) * + pow(sig1,3.0) * pow(sig2,3.0) / (pow(sig1,6.0) + pow(sig2,6.0))); + else return 0.0; } /* ---------------------------------------------------------------------- @@ -644,14 +643,13 @@ double Pair::mix_energy(double eps1, double eps2, double sig1, double sig2) double Pair::mix_distance(double sig1, double sig2) { - double value; if (mix_flag == GEOMETRIC) - value = sqrt(sig1*sig2); + return sqrt(sig1*sig2); else if (mix_flag == ARITHMETIC) - value = 0.5 * (sig1+sig2); + return (0.5 * (sig1+sig2)); else if (mix_flag == SIXTHPOWER) - value = pow((0.5 * (pow(sig1,6.0) + pow(sig2,6.0))),1.0/6.0); - return value; + return pow((0.5 * (pow(sig1,6.0) + pow(sig2,6.0))),1.0/6.0); + else return 0.0; } /* ---------------------------------------------------------------------- */ @@ -1459,7 +1457,7 @@ void Pair::write_file(int narg, char **arg) int n = force->inumeric(FLERR,arg[2]); - int style; + int style = NONE; if (strcmp(arg[3],"r") == 0) style = RLINEAR; else if (strcmp(arg[3],"rsq") == 0) style = RSQ; else if (strcmp(arg[3],"bitmap") == 0) style = BMP;