diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index a43af733ed..63df8d2a5c 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -59,6 +59,7 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : restart_peratom = 1; create_attribute = 1; + wallstyle = -1; // wall/particle coefficients @@ -96,7 +97,7 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : lo = hi = 0.0; cylradius = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; - } + } else error->all(FLERR,fmt::format("Unknown wall style {}",arg[iarg])); // check for trailing keyword/values diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 8c9ea7a1fe..e78bf7fb24 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; -enum{XPLANE=0,YPLANE=1,ZPLANE}; // XYZ PLANE need to be 0,1,2 +enum{XPLANE=0,YPLANE=1,ZPLANE=2}; // XYZ PLANE need to be 0,1,2 enum{HOOKE,HOOKE_HISTORY}; enum {INVALID=0,NONE=1,VERTEX=2}; @@ -59,6 +59,7 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) restart_peratom = 1; create_attribute = 1; + wallstyle = -1; // wall/particle coefficients diff --git a/src/COLLOID/pair_colloid.cpp b/src/COLLOID/pair_colloid.cpp index 73d1302694..f71ad922a0 100644 --- a/src/COLLOID/pair_colloid.cpp +++ b/src/COLLOID/pair_colloid.cpp @@ -473,6 +473,7 @@ double PairColloid::single(int /*i*/, int /*j*/, int itype, int jtype, double rs double K[9],h[4],g[4]; double r,r2inv,r6inv,forcelj,c1,c2,phi,fR,dUR,dUA; + phi = 0.0; switch (form[itype][jtype]) { case SMALL_SMALL: r2inv = 1.0/rsq; diff --git a/src/MC/fix_tfmc.cpp b/src/MC/fix_tfmc.cpp index 5129f2d348..4d481e7d68 100644 --- a/src/MC/fix_tfmc.cpp +++ b/src/MC/fix_tfmc.cpp @@ -56,6 +56,7 @@ FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : comflag = 0; rotflag = 0; + xflag = yflag = zflag = 0; int iarg = 6; while (iarg < narg) { diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp index 58e054bda3..8887139ee2 100644 --- a/src/SHOCK/fix_append_atoms.cpp +++ b/src/SHOCK/fix_append_atoms.cpp @@ -49,6 +49,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : scaleflag = 1; spatflag=0; spatialid = nullptr; + size = 0.0; xloflag = xhiflag = yloflag = yhiflag = zloflag = zhiflag = 0; tempflag = 0; diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp index 66c97bccda..0111214ae9 100644 --- a/src/SHOCK/fix_wall_piston.cpp +++ b/src/SHOCK/fix_wall_piston.cpp @@ -43,6 +43,7 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) : tempflag = 0; scaleflag = 1; roughflag = 0; + roughdist = 0.0; rampflag = 0; rampNL1flag = 0; rampNL2flag = 0; diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index 057c6f02eb..2800c9129b 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -386,7 +386,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : // apply scaling factors and cylinder dims orthogonal to axis if (binflag) { - double scale; + double scale = 1.0; if (which == ArgInfo::BIN1D || which == ArgInfo::BIN2D || which == ArgInfo::BIN3D || which == ArgInfo::BINCYLINDER) { if (which == ArgInfo::BIN1D || which == ArgInfo::BINCYLINDER) ndim = 1; diff --git a/src/compute_global_atom.cpp b/src/compute_global_atom.cpp index 8745ef82b4..e49ee69b07 100644 --- a/src/compute_global_atom.cpp +++ b/src/compute_global_atom.cpp @@ -50,7 +50,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : indexref = argi.get_index1(); idref = argi.copy_name(); - if ((whichref == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE) + if ((whichref == ArgInfo::UNKNOWN) || (whichref == ArgInfo::NONE) || (argi.get_dim() > 1)) error->all(FLERR,"Illegal compute global/atom command"); diff --git a/src/fix_ave_histo_weight.cpp b/src/fix_ave_histo_weight.cpp index ae83d80845..27412cf9ef 100644 --- a/src/fix_ave_histo_weight.cpp +++ b/src/fix_ave_histo_weight.cpp @@ -51,7 +51,7 @@ FixAveHistoWeight::FixAveHistoWeight(LAMMPS *lmp, int narg, char **arg) : // check that length of 2 values is the same - int size[2]; + int size[2] = {0,0}; for (int i = 0; i < nvalues; i++) { if (which[i] == ArgInfo::X || which[i] == ArgInfo::V || which[i] == ArgInfo::F) { diff --git a/src/update.cpp b/src/update.cpp index d52e5a742f..7c4b6b888e 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -54,6 +54,7 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp) eflag_atom = vflag_atom = 0; dt_default = 1; + dt = 0.0; unit_style = nullptr; set_units("lj");