bugfix: Detect exception during beginReportStep in parallel a. abort

Previously, exceptions happening at this stage have deadlocked
flow. E.g.  UniformTabulated2DFunction in opm-material throws
a NumericalIssue if the values passed are outside the tabulated
reason. This function is e.g. called in 2-phase CO2-storage cases
during BlackoilModel::initializeWellState

BTW: This is only the first step as it is not very user friendly that
a simulation aborts at this (late) stage.
This commit is contained in:
Markus Blatt
2021-09-15 20:06:26 +02:00
parent bd066d9300
commit b056557f57
3 changed files with 71 additions and 37 deletions

View File

@@ -23,6 +23,8 @@
#include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/material/common/Exceptions.hpp>
#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh>
@@ -64,6 +66,9 @@ void _throw(Opm::ExceptionType::ExcEnum exc_type, const std::string& message) {
case Opm::ExceptionType::INVALID_ARGUMENT:
throw std::invalid_argument(message);
break;
case Opm::ExceptionType::NUMERICAL_ISSUE:
throw Opm::NumericalIssue(message);
break;
case Opm::ExceptionType::DEFAULT:
case Opm::ExceptionType::LOGIC_ERROR:
throw std::logic_error(message);