More safeguarding that the intensive quantities cache is updated.

This commit is contained in:
Atgeirr Flø Rasmussen 2022-08-04 15:17:34 +02:00
parent f4e98c6d32
commit dd01af1f3b

View File

@ -391,7 +391,9 @@ private:
MatrixBlock bMat(0.0);
ADVectorBlock adres(0.0);
const IntensiveQuantities* intQuantsInP = model_().cachedIntensiveQuantities(globI, /*timeIdx*/ 0);
assert(intQuantsInP);
if (intQuantsInP == nullptr) {
throw std::logic_error("Missing updated intensive quantities for cell " + std::to_string(globI));
}
const IntensiveQuantities& intQuantsIn = *intQuantsInP;
// Flux term.
@ -404,7 +406,7 @@ private:
adres = 0.0;
const IntensiveQuantities* intQuantsExP = model_().cachedIntensiveQuantities(globJ, /*timeIdx*/ 0);
if (intQuantsExP == nullptr) {
throw std::logic_error("Missing updated intensive quantities for cell " + std::to_string(globJ));
throw std::logic_error("Missing updated intensive quantities for cell " + std::to_string(globJ) + " when assembling fluxes for cell " + std::to_string(globI));
}
const IntensiveQuantities& intQuantsEx = *intQuantsExP;
LocalResidual::computeFlux(