Cleanup: s/fix/compute/ and properly increment size_vector

This commit is contained in:
Andrew Schultz 2019-06-14 14:11:15 -04:00
parent db3de8a31b
commit 343bc728e2
1 changed files with 6 additions and 3 deletions

View File

@ -107,13 +107,15 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) :
if (computeU>-1) continue; if (computeU>-1) continue;
computeU = size_vector; computeU = size_vector;
extlist[size_vector] = 1; extlist[size_vector] = 1;
size_vector++;
} }
else if (!strcmp(arg[iarg], "p")) { else if (!strcmp(arg[iarg], "p")) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix hma command"); if (iarg+2 > narg) error->all(FLERR,"Illegal compute hma command");
if (computeP>-1) continue; if (computeP>-1) continue;
computeP = size_vector; computeP = size_vector;
deltaPcap = force->numeric(FLERR, arg[iarg+1]); deltaPcap = force->numeric(FLERR, arg[iarg+1]);
extlist[size_vector] = 0; extlist[size_vector] = 0;
size_vector++;
iarg++; iarg++;
} }
else if (!strcmp(arg[iarg], "cv")) { else if (!strcmp(arg[iarg], "cv")) {
@ -121,18 +123,19 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) :
computeCv = size_vector; computeCv = size_vector;
comm_forward = 3; comm_forward = 3;
extlist[size_vector] = 1; extlist[size_vector] = 1;
size_vector++;
} }
else if (!strcmp(arg[iarg], "anharmonic")) { else if (!strcmp(arg[iarg], "anharmonic")) {
// the first time we're called, we'll grab lattice pressure and energy // the first time we're called, we'll grab lattice pressure and energy
returnAnharmonic = -1; returnAnharmonic = -1;
} }
else { else {
error->all(FLERR,"Illegal fix hma command"); error->all(FLERR,"Illegal compute hma command");
} }
} }
if (size_vector == 0) { if (size_vector == 0) {
error->all(FLERR,"Illegal fix hma command"); error->all(FLERR,"Illegal compute hma command");
} }
if (size_vector<3) { if (size_vector<3) {
memory->grow(extlist, size_vector, "hma:extlist"); memory->grow(extlist, size_vector, "hma:extlist");