diff --git a/src/molecule.cpp b/src/molecule.cpp index 6bbc5d4a58..be5551e9b6 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -356,7 +356,6 @@ void Molecule::from_json(const std::string &molid, const json &moldata) if (moldata.contains("body") && (moldata["body"].size() == 2)) { bodyflag = 1; - const double scale5 = powint(sizescale, 5); avec_body = dynamic_cast(atom->style_match("body")); if (!avec_body) error->all(FLERR, Error::NOLASTLINE, @@ -2709,7 +2708,6 @@ void Molecule::special_generate() if (newton_bond) { for (int i = 0; i < natoms; i++) { for (int j = 0; j < num_bond[i]; j++) { - atom1 = i; atom2 = bond_atom[i][j] - 1; nspecial[i][0]++; nspecial[atom2][0]++; diff --git a/src/set.cpp b/src/set.cpp index f42dd175ab..4cb886a422 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -658,7 +658,7 @@ void Set::setrandom(int keyword, Action *action) bigint allcount; MPI_Allreduce(&bcount,&allcount,1,MPI_LMP_BIGINT,MPI_SUM,world); - bigint nsubset; + bigint nsubset = 0; if (keyword == TYPE_RATIO) { double fraction = action->dvalue1; nsubset = static_cast (fraction * allcount); @@ -2328,8 +2328,6 @@ void Set::process_spin_electron(int &iarg, int narg, char **arg, Action *action) void Set::invoke_spin_electron(Action *action) { int nlocal = atom->nlocal; - int *spin = atom->spin; - int varflag = action->varflag; int ispin; if (!action->varflag1) ispin = action->ivalue1; @@ -2457,8 +2455,6 @@ void Set::process_tri(int &iarg, int narg, char **arg, Action *action) void Set::invoke_tri(Action *action) { int nlocal = atom->nlocal; - int *tri = atom->tri; - auto avec_tri = dynamic_cast(atom->style_match("tri")); int varflag = action->varflag; @@ -2510,16 +2506,16 @@ void Set::invoke_type(Action *action) int *type = atom->type; int varflag = action->varflag; - int itype; + int itype = 0; if (!action->varflag1) itype = action->ivalue1; for (int i = 0; i < nlocal; i++) { if (!select[i]) continue; - if (action->varflag) { + if (varflag) { itype = static_cast (vec1[i]); if (itype <= 0 || itype > atom->ntypes) - error->one(FLERR,"Invalid atom type in set command"); + error->one(FLERR, Error::NOLASTLINE, "Invalid atom type in set command"); } type[i] = itype;