use dynamic cast instead of c-style cast when casting from base type to derived class

This commit is contained in:
Axel Kohlmeyer
2022-04-10 18:18:06 -04:00
parent 39b316729b
commit 200b4f13c7
262 changed files with 669 additions and 676 deletions

View File

@ -95,7 +95,7 @@ void AtomVecSphere::init()
for (int i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"adapt") == 0) {
FixAdapt *fix = (FixAdapt *) modify->fix[i];
auto fix = dynamic_cast<FixAdapt *>( modify->fix[i]);
if (fix->diamflag && radvary == 0)
error->all(FLERR,"Fix adapt changes particle radii "
"but atom_style sphere is not dynamic");