20 #ifndef SATFUNC_CONSISTENCY_CHECK_MANAGER_HPP_INCLUDED 21 #define SATFUNC_CONSISTENCY_CHECK_MANAGER_HPP_INCLUDED 23 #include <opm/input/eclipse/EclipseState/EclipseState.hpp> 25 #include <opm/input/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp> 27 #include <opm/material/fluidmatrixinteractions/EclEpsGridProperties.hpp> 29 #include <opm/simulators/utils/ParallelCommunication.hpp> 31 #include <opm/simulators/utils/satfunc/SatfuncCheckPointInterface.hpp> 32 #include <opm/simulators/utils/satfunc/SatfuncConsistencyChecks.hpp> 34 #include <dune/grid/common/partitionset.hh> 35 #include <dune/grid/common/rangegenerators.hh> 41 #include <string_view> 42 #include <type_traits> 46 template <
typename Scalar>
56 template <
typename Scalar>
90 const EclipseState& eclipseState,
127 template <
typename Gr
idView,
typename GetCellIndex>
128 void run(
const GridView& gv, GetCellIndex&& getCellIndex)
130 this->isRoot_ = gv.comm().rank() == this->root_;
132 this->warnIfDirectionalOrIrreversibleEPS();
134 for (
const auto& elem : elements(gv, Dune::Partitions::interior)) {
135 this->runCellChecks(getCellIndex(elem));
140 this->collectFailures(gv.comm());
172 struct CurveCollection
197 std::string_view pointName,
198 const std::size_t numSamplePoints);
205 std::unique_ptr<SatfuncCheckPointInterface<Scalar>> point;
216 std::reference_wrapper<const EclipseState> eclipseState_;
229 satfunc::RawTableEndPoints rtep_{};
235 satfunc::RawFunctionValues rfunc_{};
242 std::vector<EclEpsGridProperties> gridProps_{};
246 std::vector<CurveCollection> curves_{};
260 void warnIfDirectionalOrIrreversibleEPS()
const;
267 void runCellChecks(
const int cellIdx);
273 void configureCurveChecks(
const std::size_t numSamplePoints);
291 std::unique_ptr<UnscaledSatfuncCheckPoint<Scalar>>
292 configureUnscaledCurveChecks(
const std::string& regionName,
293 const std::size_t numSamplePoints);
308 void configureScaledCurveChecks(
const UnscaledSatfuncCheckPoint<Scalar>& unscaledChecks,
309 const bool useImbibition,
310 const std::size_t numSamplePoints);
322 void collectFailures(
const Parallel::Communication& comm);
334 template <
typename Body>
335 void curveLoop(Body&& body);
347 template <
typename Body>
348 void curveLoop(Body&& body)
const;
353 #endif // SATFUNC_CONSISTENCY_CHECK_MANAGER_HPP_INCLUDED typename SatfuncConsistencyChecks< Scalar >::ReportRecordOutput ReportRecordOutput
Call-back function type for outputting a single record of a consistency condition violation report...
Definition: SatfuncConsistencyCheckManager.hpp:67
bool anyFailedCriticalChecks() const
Whether or not any checks failed at the Critical level.
Definition: SatfuncConsistencyCheckManager.cpp:116
bool anyFailedStandardChecks() const
Whether or not any checks failed at the Standard level.
Definition: SatfuncConsistencyCheckManager.cpp:107
void run(const GridView &gv, GetCellIndex &&getCellIndex)
Execute collection of saturation function consistency checks for all cells in simulation model...
Definition: SatfuncConsistencyCheckManager.hpp:128
Callback protocol for single saturation function consistency check point.
Definition: SatfuncCheckPointInterface.hpp:39
Define and execute saturation function consistency checks for all cells in model. ...
Definition: SatfuncConsistencyCheckManager.hpp:57
ViolationLevel
Severity level for consistency condition violation.
Definition: SatfuncConsistencyChecks.hpp:107
std::function< void(std::string_view)> ReportRecordOutput
Call-back function type for outputting a single record of a consistency condition violation report...
Definition: SatfuncConsistencyChecks.hpp:122
SatfuncConsistencyCheckManager(const std::size_t numSamplePoints, const EclipseState &eclipseState, const LocalToGlobal &localToGlobal)
Constructor.
Definition: SatfuncConsistencyCheckManager.cpp:88
SatfuncConsistencyCheckManager & collectFailuresTo(const int root)
Set rank to which failure reports should be collected.
Definition: SatfuncConsistencyCheckManager.hpp:99
void reportFailures(const ViolationLevel level, const ReportRecordOutput &emitReportRecord) const
Generate textual summary output of all failed consistency checks at specific level.
Definition: SatfuncConsistencyCheckManager.cpp:125
std::function< std::size_t(int)> LocalToGlobal
Callback for translating active cell index to globally unique point ID.
Definition: SatfuncConsistencyCheckManager.hpp:62
Platform for running sets of consistency checks against collection of saturation function end-points...
Definition: SatfuncConsistencyChecks.hpp:45
typename SatfuncConsistencyChecks< Scalar >::ViolationLevel ViolationLevel
Severity level for consistency condition violation.
Definition: SatfuncConsistencyCheckManager.hpp:71
Callbacks for defining the consistency check point of a single region.
Definition: SatfuncConsistencyCheckManager.hpp:47