add casts to avoid comparison to / arithmetics with enums

This commit is contained in:
Arne Morten Kvarving 2024-11-06 10:34:00 +01:00
parent 68a727aac8
commit d9a3dd6f77
2 changed files with 5 additions and 2 deletions

View File

@ -591,7 +591,9 @@ public:
const Scalar& maxAdsorbtion = PolymerModule::plyrockMaxAdsorbtion(elemCtx, dofIdx, timeIdx);
const auto& plyadsAdsorbedPolymer = PolymerModule::plyadsAdsorbedPolymer(elemCtx, dofIdx, timeIdx);
polymerAdsorption_ = plyadsAdsorbedPolymer.eval(polymerConcentration_, /*extrapolate=*/true);
if (PolymerModule::plyrockAdsorbtionIndex(elemCtx, dofIdx, timeIdx) == BlackOilPolymerParams<Scalar>::NoDesorption) {
if (static_cast<int>(PolymerModule::plyrockAdsorbtionIndex(elemCtx, dofIdx, timeIdx)) ==
BlackOilPolymerParams<Scalar>::NoDesorption)
{
const Scalar& maxPolymerAdsorption = elemCtx.problem().maxPolymerAdsorption(elemCtx, dofIdx, timeIdx);
polymerAdsorption_ = std::max(Evaluation(maxPolymerAdsorption) , polymerAdsorption_);
}

View File

@ -212,5 +212,6 @@ Opm::RegionPhasePoreVolAverage::valueArrayIndex(const Ix start,
const AvgType type,
const Element element) const
{
return start + type*Element::NumElem + element;
return start + static_cast<Ix>(type) * static_cast<Ix>(Element::NumElem)
+ static_cast<Ix>(element);
}