My Project
|
Platform for running sets of consistency checks against collection of saturation function end-points. More...
#include <SatfuncConsistencyChecks.hpp>
Classes | |
class | Check |
Call-back interface for an individual check. More... | |
Public Types | |
enum class | ViolationLevel : std::size_t { Standard , Critical , NumLevels } |
Severity level for consistency condition violation. More... | |
using | ReportRecordOutput = std::function< void(std::string_view)> |
Call-back function type for outputting a single record of a consistency condition violation report. | |
using | PointIDFormatCallback = std::function< std::string(std::size_t)> |
Call-back function type for formatting a numeric end-point ID. | |
Public Member Functions | |
SatfuncConsistencyChecks (std::string_view pointName, const std::size_t numSamplePoints) | |
Constructor. | |
~SatfuncConsistencyChecks ()=default | |
Destructor. | |
SatfuncConsistencyChecks (const SatfuncConsistencyChecks &rhs)=delete | |
Deleted copy constructor. | |
SatfuncConsistencyChecks (SatfuncConsistencyChecks &&rhs) | |
Move-constructor. | |
SatfuncConsistencyChecks & | operator= (const SatfuncConsistencyChecks &rhs)=delete |
Deleted assignment operator. | |
SatfuncConsistencyChecks & | operator= (SatfuncConsistencyChecks &&rhs) |
Move-assignment operator. | |
SatfuncConsistencyChecks & | setPointIDFormatCallback (const PointIDFormatCallback &formatPointID) |
Replace formatting function for end-point IDs. | |
void | resetCheckSet () |
Clear current set of end-point checks. | |
void | addCheck (std::unique_ptr< Check > check) |
Add specific check to in-progress check set. | |
void | finaliseCheckSet () |
Commit current set of checks and build requisite internal support structures. | |
void | checkEndpoints (const std::size_t pointID, const EclEpsScalingPointsInfo< Scalar > &endPoints) |
Run current set of checks against a specific set of end-points. | |
void | collectFailures (int root, const Parallel::Communication &comm) |
Collect consistency violations from all ranks in MPI communicator. | |
bool | anyFailedStandardChecks () const |
Whether or not any checks failed at the Standard level. | |
bool | anyFailedCriticalChecks () const |
Whether or not any checks failed at the Critical level. | |
void | reportFailures (const ViolationLevel level, const ReportRecordOutput &emitReportRecord) const |
Generate textual summary output of all failed consistency checks at specific level. | |
Platform for running sets of consistency checks against collection of saturation function end-points.
Scalar | Element type. Typically float or double . |
|
strong |
|
explicit |
Constructor.
[in] | pointName | Name/category of the points in this set of checks. Might for instance be "Grid block" or "Saturation region". Will be used as a column header. |
[in] | numSamplePoints | Upper bound on the number of end-point check violations to preserve for reporting purposes. Should normally be a small number like 5 or 10. |
Opm::SatfuncConsistencyChecks< Scalar >::SatfuncConsistencyChecks | ( | SatfuncConsistencyChecks< Scalar > && | rhs | ) |
Move-constructor.
[in,out] | rhs | Source object. Left in a "valid but unspecified" state on exit. |
void Opm::SatfuncConsistencyChecks< Scalar >::addCheck | ( | std::unique_ptr< Check > | check | ) |
Add specific check to in-progress check set.
[in] | check | Particular end-point check. |
void Opm::SatfuncConsistencyChecks< Scalar >::checkEndpoints | ( | const std::size_t | pointID, |
const EclEpsScalingPointsInfo< Scalar > & | endPoints | ||
) |
Run current set of checks against a specific set of end-points.
[in] | pointID | Numeric identifier for this particular set of end-points. Typically a saturation region or a cell ID. |
[in] | endPoints | Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region. Will be passed directly on to virtual void test(const EclEpsScalingPointsInfo< Scalar > &endPoints)=0 Run specific check against a set of saturation function end-points. |
void Opm::SatfuncConsistencyChecks< Scalar >::collectFailures | ( | int | root, |
const Parallel::Communication & | comm | ||
) |
Collect consistency violations from all ranks in MPI communicator.
Incorporates violation counts and sampled failure points into the internal structures on each rank. Aggregate results useful for subsequent call to reportFailures() on root process.
[in] | root | MPI root process. This is the process onto which the counts and samples will be collected. Typically the index of the IO rank. |
[in] | comm | MPI communication object. |
Opm::SatfuncConsistencyChecks< Scalar > & Opm::SatfuncConsistencyChecks< Scalar >::operator= | ( | SatfuncConsistencyChecks< Scalar > && | rhs | ) |
Move-assignment operator.
[in,out] | rhs | Source object. Left in a "valid but unspecified" state on exit. |
void Opm::SatfuncConsistencyChecks< Scalar >::reportFailures | ( | const ViolationLevel | level, |
const ReportRecordOutput & | emitReportRecord | ||
) | const |
Generate textual summary output of all failed consistency checks at specific level.
Reports only those conditions/checks for which there is at least one violation.
In a parallel run it is only safe to call this function on the MPI process to which the consistency check violations were collected in a previous call to collectFailures().
[in] | level | Report's severity level. |
[in] | emitReportRecord | Call-back function for outputting a single record/line of a violation report. Typically a wrapper of OpmLog::info()
|
|
inline |
Replace formatting function for end-point IDs.
The default formatting function is just the identity (
) which is useful for testing, but which will for instance not capture Cartesian structure.
[in] | formatPointID | Call-back function type for formatting a numeric end-point ID. |