use explicit scoping when virtual dispatch is not available.
This commit is contained in:
@ -78,7 +78,7 @@ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg),
|
||||
yf = &coords[1*natoms];
|
||||
zf = &coords[2*natoms];
|
||||
|
||||
openfile();
|
||||
DumpDCD::openfile();
|
||||
headerflag = 0;
|
||||
nevery_save = 0;
|
||||
ntotal = 0;
|
||||
|
||||
@ -92,7 +92,7 @@ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg),
|
||||
"format conventions possible for units lj");
|
||||
}
|
||||
|
||||
openfile();
|
||||
DumpXTC::openfile();
|
||||
nevery_save = 0;
|
||||
ntotal = 0;
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
|
||||
// allocates space for temporaries
|
||||
ffl_tmp1=ffl_tmp2=nullptr;
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
FixFFL::grow_arrays(atom->nmax);
|
||||
|
||||
// add callbacks to enable restarts
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
@ -155,7 +155,7 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) :
|
||||
shake_atom = nullptr;
|
||||
shake_type = nullptr;
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
FixFilterCorotate::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW); //calls grow_arrays
|
||||
|
||||
x_store = nullptr;
|
||||
|
||||
@ -91,7 +91,7 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) :
|
||||
memory->create(prony_tau, prony_terms, "gld:prony_tau");
|
||||
// allocate memory for Prony series extended variables
|
||||
s_gld = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixGLD::grow_arrays(atom->nmax);
|
||||
// add callbacks to enable restarts
|
||||
atom->add_callback(Atom::GROW);
|
||||
atom->add_callback(Atom::RESTART);
|
||||
|
||||
@ -350,7 +350,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) :
|
||||
// allocates space for temporaries
|
||||
gle_tmp1=gle_tmp2=nullptr;
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
FixGLE::grow_arrays(atom->nmax);
|
||||
init_gles();
|
||||
|
||||
// add callbacks to enable restarts
|
||||
|
||||
@ -77,7 +77,7 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) :
|
||||
// Perform initial allocation of atom-based array
|
||||
// Register with Atom class
|
||||
xoriginal = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixTISpring::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
atom->add_callback(Atom::RESTART);
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ nfileevery(0), fp(nullptr), xf(nullptr), xold(nullptr)
|
||||
// perform initial allocation of atom-based arrays
|
||||
// register with Atom class
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
FixTMD::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
// make sure an atom map exists before reading in target coordinates
|
||||
|
||||
@ -142,7 +142,7 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
|
||||
// allocate per-atom flangevin and zero it
|
||||
|
||||
flangevin = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixTTM::grow_arrays(atom->nmax);
|
||||
|
||||
for (int i = 0; i < atom->nmax; i++) {
|
||||
flangevin[i][0] = 0.0;
|
||||
@ -173,7 +173,7 @@ FixTTM::~FixTTM()
|
||||
|
||||
memory->destroy(flangevin);
|
||||
|
||||
if (!deallocate_flag) deallocate_grid();
|
||||
if (!deallocate_flag) FixTTM::deallocate_grid();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -55,7 +55,7 @@ FixTTMGrid::FixTTMGrid(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
FixTTMGrid::~FixTTMGrid()
|
||||
{
|
||||
deallocate_grid();
|
||||
FixTTMGrid::deallocate_grid();
|
||||
deallocate_flag = 1;
|
||||
}
|
||||
|
||||
|
||||
@ -174,9 +174,9 @@ PPPM::~PPPM()
|
||||
if (copymode) return;
|
||||
|
||||
delete [] factors;
|
||||
deallocate();
|
||||
if (peratom_allocate_flag) deallocate_peratom();
|
||||
if (group_allocate_flag) deallocate_groups();
|
||||
PPPM::deallocate();
|
||||
if (peratom_allocate_flag) PPPM::deallocate_peratom();
|
||||
if (group_allocate_flag) PPPM::deallocate_groups();
|
||||
memory->destroy(part2grid);
|
||||
memory->destroy(acons);
|
||||
}
|
||||
|
||||
@ -88,8 +88,8 @@ PPPMDipole::~PPPMDipole()
|
||||
{
|
||||
if (copymode) return;
|
||||
|
||||
deallocate();
|
||||
if (peratom_allocate_flag) deallocate_peratom();
|
||||
PPPMDipole::deallocate();
|
||||
if (peratom_allocate_flag) PPPMDipole::deallocate_peratom();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -245,8 +245,8 @@ PPPMDisp::~PPPMDisp()
|
||||
cii = nullptr;
|
||||
delete [] csumi;
|
||||
csumi = nullptr;
|
||||
deallocate();
|
||||
deallocate_peratom();
|
||||
PPPMDisp::deallocate();
|
||||
PPPMDisp::deallocate_peratom();
|
||||
memory->destroy(part2grid);
|
||||
memory->destroy(part2grid_6);
|
||||
part2grid = part2grid_6 = nullptr;
|
||||
|
||||
@ -57,7 +57,7 @@ FixSRP::FixSRP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
|
||||
// initial allocation of atom-based array
|
||||
// register with Atom class
|
||||
array = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixSRP::grow_arrays(atom->nmax);
|
||||
|
||||
// extends pack_exchange()
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
@ -112,7 +112,7 @@ FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) :
|
||||
crossterm_atom5 = nullptr;
|
||||
|
||||
nmax_previous = 0;
|
||||
grow_arrays(atom->nmax);
|
||||
FixCMAP::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
atom->add_callback(Atom::RESTART);
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
|
||||
|
||||
scale = 1.0;
|
||||
scalingmask = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixEHEX::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ FixRattle::FixRattle(LAMMPS *lmp, int narg, char **arg) :
|
||||
// allocate memory for unconstrained velocity update
|
||||
|
||||
vp = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixRattle::grow_arrays(atom->nmax);
|
||||
|
||||
// default communication mode
|
||||
// necessary for compatibility with SHAKE
|
||||
|
||||
@ -82,7 +82,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
|
||||
eflags = nullptr;
|
||||
orient = nullptr;
|
||||
dorient = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixRigid::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
// parse args for rigid body specification
|
||||
|
||||
@ -89,7 +89,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
|
||||
eflags = nullptr;
|
||||
orient = nullptr;
|
||||
dorient = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixRigidSmall::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
// parse args for rigid body specification
|
||||
|
||||
@ -84,7 +84,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) :
|
||||
ftmp = nullptr;
|
||||
vtmp = nullptr;
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
FixShake::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
// set comm size needed by this fix
|
||||
|
||||
@ -351,7 +351,7 @@ Atom::~Atom()
|
||||
|
||||
// delete mapping data structures
|
||||
|
||||
map_delete();
|
||||
Atom::map_delete();
|
||||
|
||||
delete unique_tags;
|
||||
}
|
||||
|
||||
@ -60,14 +60,14 @@ CommBrick::CommBrick(LAMMPS *lmp) :
|
||||
|
||||
CommBrick::~CommBrick()
|
||||
{
|
||||
free_swap();
|
||||
CommBrick::free_swap();
|
||||
if (mode == Comm::MULTI) {
|
||||
free_multi();
|
||||
CommBrick::free_multi();
|
||||
memory->destroy(cutghostmulti);
|
||||
}
|
||||
|
||||
if (mode == Comm::MULTIOLD) {
|
||||
free_multiold();
|
||||
CommBrick::free_multiold();
|
||||
memory->destroy(cutghostmultiold);
|
||||
}
|
||||
|
||||
@ -112,12 +112,12 @@ void CommBrick::init_buffers()
|
||||
|
||||
buf_send = buf_recv = nullptr;
|
||||
maxsend = maxrecv = BUFMIN;
|
||||
grow_send(maxsend,2);
|
||||
CommBrick::grow_send(maxsend,2);
|
||||
memory->create(buf_recv,maxrecv,"comm:buf_recv");
|
||||
|
||||
nswap = 0;
|
||||
maxswap = 6;
|
||||
allocate_swap(maxswap);
|
||||
CommBrick::allocate_swap(maxswap);
|
||||
|
||||
sendlist = (int **) memory->smalloc(maxswap*sizeof(int *),"comm:sendlist");
|
||||
memory->create(maxsendlist,maxswap,"comm:maxsendlist");
|
||||
|
||||
@ -177,7 +177,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
// perform initial allocation of atom-based array
|
||||
// register with Atom class
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
FixAveAtom::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
// zero the array since dump may access it on timestep 0
|
||||
|
||||
@ -61,7 +61,7 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) :
|
||||
// perform initial allocation of atom-based array
|
||||
// register with Atom class
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
FixExternal::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
user_energy = 0.0;
|
||||
|
||||
@ -178,7 +178,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
|
||||
// no need to set peratom_flag, b/c data is for internal use only
|
||||
|
||||
if (gjfflag) {
|
||||
grow_arrays(atom->nmax);
|
||||
FixLangevin::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
// initialize franprev to zero
|
||||
|
||||
@ -246,7 +246,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
|
||||
// perform initial allocation of atom-based array
|
||||
// register with Atom class
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
FixMove::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
atom->add_callback(Atom::RESTART);
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) :
|
||||
// perform initial allocation of atom-based arrays
|
||||
// register with atom class
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
FixNeighHistory::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
atom->add_callback(Atom::RESTART);
|
||||
|
||||
|
||||
@ -181,7 +181,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
// register with Atom class
|
||||
|
||||
nmax_old = 0;
|
||||
if (!lmp->kokkos) grow_arrays(atom->nmax);
|
||||
if (!lmp->kokkos) FixPropertyAtom::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
atom->add_callback(Atom::RESTART);
|
||||
if (border) atom->add_callback(Atom::BORDER);
|
||||
|
||||
@ -32,7 +32,7 @@ FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) :
|
||||
// perform initial allocation of atom-based array
|
||||
// register with Atom class
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
FixReadRestart::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
|
||||
// extra = copy of atom->extra
|
||||
|
||||
@ -44,7 +44,7 @@ FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
f_level = nullptr;
|
||||
t_level = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixRespa::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
}
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) :
|
||||
// register with Atom class
|
||||
|
||||
xoriginal = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixSpringSelf::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
atom->add_callback(Atom::RESTART);
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ vstore(nullptr), astore(nullptr), rbuf(nullptr)
|
||||
memory->create(rbuf,nrow*ncol+2,"fix/store:rbuf");
|
||||
}
|
||||
if (flavor == PERATOM) {
|
||||
grow_arrays(atom->nmax);
|
||||
FixStore::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
if (restart_peratom) atom->add_callback(Atom::RESTART);
|
||||
rbuf = nullptr;
|
||||
|
||||
@ -338,7 +338,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
|
||||
// register with Atom class
|
||||
|
||||
values = nullptr;
|
||||
grow_arrays(atom->nmax);
|
||||
FixStoreState::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
atom->add_callback(Atom::RESTART);
|
||||
|
||||
@ -354,7 +354,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
kflag = 1;
|
||||
cfv_flag = 0;
|
||||
end_of_step();
|
||||
FixStoreState::end_of_step();
|
||||
firstflag = 1;
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ Region::Region(LAMMPS *lmp, int /*narg*/, char **arg) :
|
||||
dx = dy = dz = 0.0;
|
||||
|
||||
size_restart = 5;
|
||||
reset_vel();
|
||||
Region::reset_vel();
|
||||
copymode = 0;
|
||||
list = nullptr;
|
||||
nregion = 1;
|
||||
|
||||
@ -117,7 +117,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
if (varshape) {
|
||||
variable_check();
|
||||
shape_update();
|
||||
RegCylinder::shape_update();
|
||||
}
|
||||
|
||||
if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
|
||||
|
||||
@ -74,7 +74,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
if (varshape) {
|
||||
variable_check();
|
||||
shape_update();
|
||||
RegSphere::shape_update();
|
||||
}
|
||||
|
||||
// error check
|
||||
|
||||
Reference in New Issue
Block a user