diff --git a/dumux/material/components/tabulatedcomponent.hh b/dumux/material/components/tabulatedcomponent.hh index 7f211746e58af59bba07eccfa19a50e8d55e9bb1..ddeb566395fc890ea58be5bf7b931f5afc32093f 100644 --- a/dumux/material/components/tabulatedcomponent.hh +++ b/dumux/material/components/tabulatedcomponent.hh @@ -893,11 +893,9 @@ private: { Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_; + using std::min; rhoMin[iT] = rho(temperature, minP(iT)); - if (iT < nTemp_ - 1) - rhoMax[iT] = rho(temperature, maxP(iT + 1)); - else - rhoMax[iT] = rho(temperature, maxP(iT)); + rhoMax[iT] = rho(temperature, maxP(min(iT + 1, nTemp_ - 1))); }); }