Opm::SatfuncConsistencyChecks< Scalar > Class Template Reference

#include <SatfuncConsistencyChecks.hpp>

Classes

class  Check
 

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)>
 
using PointIDFormatCallback = std::function< std::string(std::size_t)>
 Call-back function type for formatting a numeric end-point ID. More...
 

Public Member Functions

 SatfuncConsistencyChecks (std::string_view pointName, const std::size_t numSamplePoints)
 
 ~SatfuncConsistencyChecks ()=default
 Destructor. More...
 
 SatfuncConsistencyChecks (const SatfuncConsistencyChecks &rhs)=delete
 Deleted copy constructor. More...
 
 SatfuncConsistencyChecks (SatfuncConsistencyChecks &&rhs)
 
SatfuncConsistencyChecksoperator= (const SatfuncConsistencyChecks &rhs)=delete
 Deleted assignment operator. More...
 
SatfuncConsistencyChecksoperator= (SatfuncConsistencyChecks &&rhs)
 
SatfuncConsistencyCheckssetPointIDFormatCallback (const PointIDFormatCallback &formatPointID)
 
void resetCheckSet ()
 Clear current set of end-point checks. More...
 
void addCheck (std::unique_ptr< Check > check)
 
void finaliseCheckSet ()
 
void checkEndpoints (const std::size_t pointID, const EclEpsScalingPointsInfo< Scalar > &endPoints)
 
void collectFailures (int root, const Parallel::Communication &comm)
 
bool anyFailedChecks () const
 Whether or not any checks failed at the Standard level. More...
 
bool anyFailedCriticalChecks () const
 Whether or not any checks failed at the Critical level. More...
 
void reportFailures (const ViolationLevel level, const ReportRecordOutput &emitReportRecord) const
 

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
ScalarElement type. Typically float or double.

Member Typedef Documentation

◆ PointIDFormatCallback

template<typename Scalar >
using Opm::SatfuncConsistencyChecks< Scalar >::PointIDFormatCallback = std::function<std::string(std::size_t)>

Call-back function type for formatting a numeric end-point ID.

◆ ReportRecordOutput

template<typename Scalar >
using Opm::SatfuncConsistencyChecks< Scalar >::ReportRecordOutput = std::function<void(std::string_view)>

Call-back function type for outputting a single record of a consistency condition violation report.

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/3]

template<typename Scalar >
Opm::SatfuncConsistencyChecks< Scalar >::SatfuncConsistencyChecks ( std::string_view  pointName,
const std::size_t  numSamplePoints 
)
explicit

Constructor

Parameters
[in]pointNameName/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]numSamplePointsUpper 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()

template<typename Scalar >
Opm::SatfuncConsistencyChecks< Scalar >::~SatfuncConsistencyChecks ( )
default

Destructor.

◆ SatfuncConsistencyChecks() [2/3]

template<typename Scalar >
Opm::SatfuncConsistencyChecks< Scalar >::SatfuncConsistencyChecks ( const SatfuncConsistencyChecks< Scalar > &  rhs)
delete

Deleted copy constructor.

◆ SatfuncConsistencyChecks() [3/3]

template<typename Scalar >
Opm::SatfuncConsistencyChecks< Scalar >::SatfuncConsistencyChecks ( SatfuncConsistencyChecks< Scalar > &&  rhs)

Move-constructor.

Parameters
[in,out]rhsSource 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]checkParticular end-point check.

◆ anyFailedChecks()

template<typename Scalar >
bool Opm::SatfuncConsistencyChecks< Scalar >::anyFailedChecks ( ) const

Whether or not any checks failed at the Standard level.

◆ anyFailedCriticalChecks()

template<typename Scalar >
bool Opm::SatfuncConsistencyChecks< Scalar >::anyFailedCriticalChecks ( ) const

Whether or not any checks failed at the Critical level.

◆ 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]pointIDNumeric identifier for this particular set of end-points. Typically a saturation region or a cell ID.
[in]endPointsSet 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
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]rootMPI root process. This is the process onto which the counts and samples will be collected. Typically the index of the IO rank.
[in]commMPI communication object.

◆ finaliseCheckSet()

template<typename Scalar >
void Opm::SatfuncConsistencyChecks< Scalar >::finaliseCheckSet ( )

Commit current set of checks and build requisite internal support structures.

◆ operator=() [1/2]

template<typename Scalar >
SatfuncConsistencyChecks & Opm::SatfuncConsistencyChecks< Scalar >::operator= ( const SatfuncConsistencyChecks< Scalar > &  rhs)
delete

Deleted assignment operator.

◆ operator=() [2/2]

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

Move-assignment operator.

Parameters
[in,out]rhsSource 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]levelReport's severity level.
[in]emitReportRecordCall-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.

◆ resetCheckSet()

template<typename Scalar >
void Opm::SatfuncConsistencyChecks< Scalar >::resetCheckSet ( )

Clear current set of end-point checks.

◆ 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::string to_string(const ConvergenceReport::ReservoirFailure::Type t)

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

Parameters
[in]formatPointIDCall-back function type for formatting a numeric end-point ID.
Returns
*this

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