diff --git a/src/USER-HMA/compute_hma.cpp b/src/USER-HMA/compute_hma.cpp index ad86577ba1..8edff5aa59 100644 --- a/src/USER-HMA/compute_hma.cpp +++ b/src/USER-HMA/compute_hma.cpp @@ -11,9 +11,9 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#include +#include #include -#include -#include #include "compute_hma.h" #include "atom.h" #include "update.h" @@ -100,25 +100,29 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) : computeU = computeP = computeCv = -1; returnAnharmonic = 0; - std::vector extvec; + size_vector = 0; + memory->create(extlist, 3, "hma:extlist"); for (int iarg=4; iarg-1) continue; + computeU = size_vector; + extlist[size_vector] = 1; } - else if (!strcasecmp(arg[iarg], "p")) { + else if (!strcmp(arg[iarg], "p")) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix hma command"); - computeP = extvec.size(); + if (computeP>-1) continue; + computeP = size_vector; deltaPcap = force->numeric(FLERR, arg[iarg+1]); - extvec.push_back(0); + extlist[size_vector] = 0; iarg++; } - else if (!strcasecmp(arg[iarg], "cv")) { - computeCv = extvec.size(); + else if (!strcmp(arg[iarg], "cv")) { + if (computeCv>-1) continue; + computeCv = size_vector; comm_forward = 3; - extvec.push_back(1); + extlist[size_vector] = 1; } - else if (!strcasecmp(arg[iarg], "anharmonic")) { + else if (!strcmp(arg[iarg], "anharmonic")) { // the first time we're called, we'll grab lattice pressure and energy returnAnharmonic = -1; } @@ -127,18 +131,16 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) : } } - if (extvec.size() == 0) { + if (size_vector == 0) { error->all(FLERR,"Illegal fix hma command"); } - size_vector = extvec.size(); - memory->create(vector, size_vector, "hma::vector"); - extlist = new int[size_vector]; - for (int i=0; igrow(extlist, size_vector, "hma:extlist"); } + memory->create(vector, size_vector, "hma:vector"); if (computeU>-1 || computeCv>-1) { - peflag = 1; + peflag = 1; } if (computeP>-1) { pressflag = 1; @@ -156,7 +158,7 @@ ComputeHMA::~ComputeHMA() delete [] id_fix; delete [] id_temp; - delete [] extlist; + memory->destroy(extlist); memory->destroy(vector); memory->destroy(deltaR); } @@ -184,11 +186,10 @@ void ComputeHMA::setup() if (temperat==NULL) error->all(FLERR,"Could not find compute hma temperature ID"); finaltemp = * temperat; - // set fix which stores original atom coords int ifix2 = modify->find_fix(id_fix); - if (ifix2 < 0) error->all(FLERR,"Could not find compute hma ID"); + if (ifix2 < 0) error->all(FLERR,"Could not find hma store fix ID"); fix = (FixStore *) modify->fix[ifix2]; } diff --git a/src/pair.cpp b/src/pair.cpp index c393e7b12b..15efa62c59 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -307,7 +307,7 @@ void Pair::init_style() specific pair style can override this function ------------------------------------------------------------------------- */ -void Pair::init_list(int which, NeighList *ptr) +void Pair::init_list(int /*which*/, NeighList *ptr) { list = ptr; } diff --git a/src/pair_lj_smooth_linear.cpp b/src/pair_lj_smooth_linear.cpp index 370caeddf7..d2bb6a1cc4 100644 --- a/src/pair_lj_smooth_linear.cpp +++ b/src/pair_lj_smooth_linear.cpp @@ -325,7 +325,7 @@ void PairLJSmoothLinear::read_restart_settings(FILE *fp) /* ---------------------------------------------------------------------- */ -double PairLJSmoothLinear::single(int i, int j, int itype, int jtype, +double PairLJSmoothLinear::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq, double factor_coul, double factor_lj, double &fforce) @@ -347,7 +347,7 @@ double PairLJSmoothLinear::single(int i, int j, int itype, int jtype, return factor_lj*philj; } -double PairLJSmoothLinear::single2(int i, int j, int itype, int jtype, double rsq, +double PairLJSmoothLinear::single2(int /*i*/, int /*j*/, int itype, int jtype, double rsq, double delr[3], double factor_coul, double factor_lj, double &fforce, double d2u[6]) {