make calls to virtual functions from constructors explicit

This commit is contained in:
Axel Kohlmeyer
2021-08-13 05:50:44 -04:00
parent 0928c912c0
commit 3e99e24f41
6 changed files with 8 additions and 13 deletions

View File

@ -437,7 +437,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
// register with Atom class
history_one = nullptr;
grow_arrays(atom->nmax);
FixWallGran::grow_arrays(atom->nmax);
atom->add_callback(Atom::GROW);
atom->add_callback(Atom::RESTART);
@ -1555,8 +1555,7 @@ double FixWallGran::memory_usage()
void FixWallGran::grow_arrays(int nmax)
{
if (use_history) memory->grow(history_one,nmax,size_history,
"fix_wall_gran:history_one");
if (use_history) memory->grow(history_one,nmax,size_history,"fix_wall_gran:history_one");
if (peratom_flag) {
memory->grow(array_atom,nmax,size_peratom_cols,"fix_wall_gran:array_atom");
}

View File

@ -62,7 +62,7 @@ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) :
ncontact = nullptr;
walls = nullptr;
history_many = nullptr;
grow_arrays(atom->nmax);
FixWallGranRegion::grow_arrays(atom->nmax);
// initialize shear history as if particle is not touching region
@ -355,8 +355,7 @@ void FixWallGranRegion::grow_arrays(int nmax)
if (use_history) {
memory->grow(ncontact,nmax,"fix_wall_gran:ncontact");
memory->grow(walls,nmax,tmax,"fix_wall_gran:walls");
memory->grow(history_many,nmax,tmax,size_history,
"fix_wall_gran:history_many");
memory->grow(history_many,nmax,tmax,size_history,"fix_wall_gran:history_many");
}
if (peratom_flag)
memory->grow(array_atom,nmax,size_peratom_cols,"fix_wall_gran:array_atom");

View File

@ -91,7 +91,7 @@ PairTersoffTable::~PairTersoffTable()
memory->destroy(cutsq);
}
deallocateGrids();
deallocatePreLoops();
PairTersoffTable::deallocatePreLoops();
}
/* ---------------------------------------------------------------------- */

View File

@ -53,7 +53,7 @@ PairTersoffTableOMP::PairTersoffTableOMP(LAMMPS *lmp) :
PairTersoffTableOMP::~PairTersoffTableOMP()
{
if (allocated) {
deallocatePreLoops();
PairTersoffTableOMP::deallocatePreLoops();
}
}

View File

@ -165,7 +165,7 @@ FixQEqReaxFF::~FixQEqReaxFF()
memory->destroy(s_hist);
memory->destroy(t_hist);
deallocate_storage();
FixQEqReaxFF::deallocate_storage();
deallocate_matrix();
memory->destroy(shld);

View File

@ -29,7 +29,7 @@ enum { MASSCENTER, GEOMCENTER };
ComputeDipole::ComputeDipole(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg)
{
if (narg != 3) error->all(FLERR, "Illegal compute com command");
if ((narg < 3) || (narg > 4)) error->all(FLERR, "Illegal compute dipole command");
scalar_flag = 1;
vector_flag = 1;
@ -39,11 +39,8 @@ ComputeDipole::ComputeDipole(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, n
vector = new double[size_vector];
vector[0] = vector[1] = vector[2] = 0.0;
usecenter = MASSCENTER;
if ((narg != 3) && (narg != 4)) error->all(FLERR, "Illegal compute dipole command");
if (narg == 4) {
if (utils::strmatch(arg[3], "^geom"))
usecenter = GEOMCENTER;