add some missing pointer checks

This commit is contained in:
Arne Morten Kvarving
2018-08-13 12:22:29 +02:00
parent 39c4c40c08
commit b7f842aaca
3 changed files with 6 additions and 3 deletions

View File

@@ -851,7 +851,7 @@ int ASMs3DLag::evalPoint (const double* xi, double* param, Vec3& X) const
param[d] = (1.0-xi[d])*svol->startparam(d) + xi[d]*svol->endparam(d);
else
param[d] = xi[d];
if (!this->getGridParameters(u[d],d,svol->order(d)-1)) return -3;
if (svol && !this->getGridParameters(u[d],d,svol->order(d)-1)) return -3;
}
// Search for the closest node

View File

@@ -1125,7 +1125,7 @@ bool SIMinput::refine (const LR::RefineData& prm,
}
// Single patch models only pass refinement call to the ASM level
if (myModel.size() == 1)
if (myModel.size() == 1 && pch)
return (isRefined = pch->refine(prm,sol,fName));
if (!prm.errors.empty()) // refinement by true_beta

View File

@@ -67,7 +67,10 @@ Real SineFunc::deriv (Real x) const
Real ConstTimeFunc::evaluate (const Vec3& X) const
{
const Vec4* Xt = dynamic_cast<const Vec4*>(&X);
return (*tfunc)(Xt ? Xt->t : Real(0));
if (Xt)
return (*tfunc)(Xt->t);
else
return (*tfunc)(Real(0));
}