Replace assert() with exception.

This commit is contained in:
Atgeirr Flø Rasmussen
2022-07-31 18:48:09 +02:00
parent 733b6e6b11
commit 4001fcffcf

View File

@@ -429,7 +429,9 @@ private:
bMat = 0.0; bMat = 0.0;
adres = 0.0; adres = 0.0;
const IntensiveQuantities* intQuantsExP = model_().cachedIntensiveQuantities(globJ, /*timeIdx*/ 0); const IntensiveQuantities* intQuantsExP = model_().cachedIntensiveQuantities(globJ, /*timeIdx*/ 0);
assert(intQuantsExP); if (intQuantsExP == nullptr) {
throw std::logic_error("Missing updated intensive quantities for cell " + std::to_string(globJ));
}
const IntensiveQuantities& intQuantsEx = *intQuantsExP; const IntensiveQuantities& intQuantsEx = *intQuantsExP;
LocalResidual::computeFlux( LocalResidual::computeFlux(
adres, problem_(), globI, globJ, intQuantsIn, intQuantsEx, 0, nbInfo.trans, nbInfo.faceArea); adres, problem_(), globI, globJ, intQuantsIn, intQuantsEx, 0, nbInfo.trans, nbInfo.faceArea);