Loading...
Searching...
No Matches
Opm::SatfuncConsistencyChecks< Scalar > Class Template Reference

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.

## Detailed Description

template<typename Scalar>
class Opm::SatfuncConsistencyChecks< Scalar >

Platform for running sets of consistency checks against collection of saturation function end-points.

Template Parameters

  Scalar | Element type. Typically `float` or `double`.

## Member Enumeration Documentation

## ViolationLevel

template<typename Scalar>

enum class Opm::SatfuncConsistencyChecks::ViolationLevel : std::size_t

strong

Severity level for consistency condition violation.

Enumerator
Standard | Consistency condition violated, but we're able to continue the run.
Critical | Consistency condition violated and we're not able to continue the run.
NumLevels | Implementation helper. Must be last enumerator.

## Constructor & Destructor Documentation

## SatfuncConsistencyChecks() [1/2]

template<typename Scalar>

Opm::SatfuncConsistencyChecks< Scalar >::SatfuncConsistencyChecks | ( | std::string_view | pointName,
|  | const std::size_t | numSamplePoints )

explicit

Constructor.

Parameters

  [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.

## SatfuncConsistencyChecks() [2/2]

template<typename Scalar>

Opm::SatfuncConsistencyChecks< Scalar >::SatfuncConsistencyChecks | ( | SatfuncConsistencyChecks< Scalar > && | rhs | ) |

Move-constructor.

Parameters

  [in,out] | rhs | Source object. Left in a "valid but unspecified" state on exit.

## Member Function Documentation

## addCheck()

template<typename Scalar>

void Opm::SatfuncConsistencyChecks< Scalar >::addCheck | ( | std::unique_ptr< Check > | check | ) |

Add specific check to in-progress check set.

Parameters

  [in] | check | Particular end-point check.

## checkEndpoints()

template<typename Scalar>

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.

Parameters

  [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
  Check::test()
  Opm::SatfuncConsistencyChecks::Check::test
  virtual void test(const EclEpsScalingPointsInfo< Scalar > &endPoints)=0
  Run specific check against a set of saturation function end-points.
  for each check in the current set.

## collectFailures()

template<typename Scalar>

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.

Parameters

  [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.

## operator=()

template<typename Scalar>

Opm::SatfuncConsistencyChecks< Scalar > & Opm::SatfuncConsistencyChecks< Scalar >::operator= | ( | SatfuncConsistencyChecks< Scalar > && | rhs | ) |

Move-assignment operator.

Parameters

  [in,out] | rhs | Source object. Left in a "valid but unspecified" state on exit.

Returns
  *this
  .

## reportFailures()

template<typename Scalar>

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().

Parameters

  [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() . It is the responsibility of emitReportRecord() to properly display the text lines to end users.

## setPointIDFormatCallback()

template<typename Scalar>

SatfuncConsistencyChecks & Opm::SatfuncConsistencyChecks< Scalar >::setPointIDFormatCallback | ( | const PointIDFormatCallback & | formatPointID | ) |

inline

Replace formatting function for end-point IDs.

The default formatting function is just the identity (

std::to_string()

) which is useful for testing, but which will for instance not capture Cartesian structure.

Parameters

  [in] | formatPointID | Call-back function type for formatting a numeric end-point ID.

Returns
  *this

The documentation for this class was generated from the following files:

- opm/simulators/utils/satfunc/SatfuncConsistencyChecks.hpp
- opm/simulators/utils/satfunc/SatfuncConsistencyChecks.cpp