use dynamic cast instead of c-style cast when casting from base type to derived class
This commit is contained in:
@ -210,7 +210,7 @@ void FixEfield::init()
|
||||
error->all(FLERR,"Must use variable energy with fix efield");
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
ilevel_respa = ((Respa *) update->integrate)->nlevels-1;
|
||||
ilevel_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels-1;
|
||||
if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa);
|
||||
}
|
||||
}
|
||||
@ -222,9 +222,9 @@ void FixEfield::setup(int vflag)
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
post_force(vflag);
|
||||
else {
|
||||
((Respa *) update->integrate)->copy_flevel_f(ilevel_respa);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_flevel_f(ilevel_respa);
|
||||
post_force_respa(vflag,ilevel_respa,0);
|
||||
((Respa *) update->integrate)->copy_f_flevel(ilevel_respa);
|
||||
(dynamic_cast<Respa *>( update->integrate))->copy_f_flevel(ilevel_respa);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user