Ensure correct propagation of failed report

This commit is contained in:
jakobtorben 2024-09-11 16:37:00 +02:00
parent 6d53daaa42
commit 71a64fbd13
2 changed files with 4 additions and 0 deletions

View File

@ -366,10 +366,13 @@ namespace Opm {
// Throw if any NaN or too large residual found.
if (severity == ConvergenceReport::Severity::NotANumber) {
failureReport_ += report;
OPM_THROW_PROBLEM(NumericalProblem, "NaN residual found!");
} else if (severity == ConvergenceReport::Severity::TooLarge) {
failureReport_ += report;
OPM_THROW_NOLOG(NumericalProblem, "Too large residual found!");
} else if (severity == ConvergenceReport::Severity::ConvergenceMonitorFailure) {
failureReport_ += report;
OPM_THROW_PROBLEM(ConvergenceMonitorFailure, "Total penalty count exceeded cut-off-limit of " + std::to_string(param_.convergence_monitoring_cutoff_));
}
}

View File

@ -249,6 +249,7 @@ void registerAdaptiveParameters();
}
catch (const ConvergenceMonitorFailure& e) {
causeOfFailure = "Convergence monitor failure";
substepReport = solver.failureReport();
}
catch (const LinearSolverProblem& e) {
substepReport = solver.failureReport();