use dynamic cast instead of c-style cast when casting from base type to derived class
This commit is contained in:
@ -115,7 +115,7 @@ void PairHybrid::compute(int eflag, int vflag)
|
||||
Respa *respa = nullptr;
|
||||
respaflag = 0;
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
respa = (Respa *) update->integrate;
|
||||
respa = dynamic_cast<Respa *>( update->integrate);
|
||||
if (respa->nhybrid_styles > 0) respaflag = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user