A class for executing a regression test for two ECLIPSE files. More...

#include <EclRegressionTest.hpp>

Inheritance diagram for ECLRegressionTest:
Inheritance graph

Public Member Functions

 ECLRegressionTest (const std::string &basename1, const std::string &basename2, double absToleranceArg, double relToleranceArg)
 Sets up the regression test. More...
 
 ~ECLRegressionTest ()
 
void setOnlyLastReportNumber (bool onlyLastSequenceArg)
 Option to only compare last occurrence. More...
 
int countDev ()
 
void setReportStepOnly (bool reportStepOnlyArg)
 
void setAcceptExtraKeywords (bool acceptExtraKeywordsArg)
 
void setIntegrationTest (bool inregrationTestArg)
 
void setPrintKeywordOnly (bool printArg)
 
void compareSpesificKeyword (std::string keyword)
 
void compareSpesificRstReportStepNumber (int seqn)
 
void setLoadBaseRunData (bool loadArg)
 
void loadGrids ()
 
void printDeviationReport ()
 
void gridCompare ()
 
void results_rst ()
 
void results_init ()
 
void results_smry ()
 
void results_rft ()
 
void throwOnErrors (bool dothrow)
 
void doAnalysis (bool analize)
 
size_t getNoErrors () const
 
double getAbsTolerance () const
 Returns the absolute tolerance stored as a private member variable in the class. More...
 
double getRelTolerance () const
 Returns the relative tolerance stored as a private member variable in the class. More...
 

Static Public Member Functions

static Deviation calculateDeviations (double val1, double val2)
 Calculate deviations for two values. More...
 
static double median (std::vector< double > vec)
 Calculate median of a vector. More...
 
static double average (const std::vector< double > &vec)
 Calculate average of a vector. More...
 

Protected Member Functions

template<typename T >
void printValuesForCell (const std::string &keyword, const std::string &reference, size_t kw_size, size_t cell, Opm::EclIO::EGrid *grid, const T &value1, const T &value2) const
 

Protected Attributes

bool throwOnError = true
 Throw on first error. More...
 
bool analysis = false
 Perform full error analysis. More...
 
std::map< std::string, std::vector< Deviation > > deviations
 
size_t num_errors = 0
 
std::string rootName1
 
std::string rootName2
 

Detailed Description

A class for executing a regression test for two ECLIPSE files.

This class inherits from ECLFilesComparator, which opens and closes the input cases and stores keywordnames. The three public functions gridCompare(), results() and resultsForKeyword() can be invoked to compare griddata or keyworddata for all keywords or a given keyword (resultsForKeyword()).

Constructor & Destructor Documentation

◆ ECLRegressionTest()

ECLRegressionTest::ECLRegressionTest ( const std::string basename1,
const std::string basename2,
double  absToleranceArg,
double  relToleranceArg 
)
inline

Sets up the regression test.

Parameters
[in]basename1Full path without file extension to the first case.
[in]basename2Full path without file extension to the second case.
[in]absToleranceTolerance for absolute deviation.
[in]relToleranceTolerance for relative deviation.

This constructor only calls the constructor of the superclass, see the docs for ECLFilesComparator for more information.

◆ ~ECLRegressionTest()

ECLRegressionTest::~ECLRegressionTest ( )

Member Function Documentation

◆ average()

static double ECLFilesComparator::average ( const std::vector< double > &  vec)
staticinherited

Calculate average of a vector.

Returning the average of the input vector, i.e. the sum of all values divided by the number of elements.

◆ calculateDeviations()

static Deviation ECLFilesComparator::calculateDeviations ( double  val1,
double  val2 
)
staticinherited

Calculate deviations for two values.

Using absolute values of the input arguments: If one of the values are non-zero, the Deviation::abs returned is the difference between the two input values. In addition, if both values are non-zero, the Deviation::rel returned is the absolute deviation divided by the largest value.

◆ compareSpesificKeyword()

void ECLRegressionTest::compareSpesificKeyword ( std::string  keyword)
inline

References Opm::UDQ::keyword().

◆ compareSpesificRstReportStepNumber()

void ECLRegressionTest::compareSpesificRstReportStepNumber ( int  seqn)
inline

◆ countDev()

int ECLRegressionTest::countDev ( )
inline

◆ doAnalysis()

void ECLFilesComparator::doAnalysis ( bool  analize)
inlineinherited

◆ getAbsTolerance()

double ECLFilesComparator::getAbsTolerance ( ) const
inlineinherited

Returns the absolute tolerance stored as a private member variable in the class.

◆ getNoErrors()

size_t ECLFilesComparator::getNoErrors ( ) const
inlineinherited

◆ getRelTolerance()

double ECLFilesComparator::getRelTolerance ( ) const
inlineinherited

Returns the relative tolerance stored as a private member variable in the class.

◆ gridCompare()

void ECLRegressionTest::gridCompare ( )

◆ loadGrids()

void ECLRegressionTest::loadGrids ( )

◆ median()

static double ECLFilesComparator::median ( std::vector< double >  vec)
staticinherited

Calculate median of a vector.

Returning the median of the input vector, i.e. the middle value of the sorted vector if the number of elements is odd or the mean of the two middle values if the number of elements are even. Copy is intentional.

◆ printDeviationReport()

void ECLRegressionTest::printDeviationReport ( )

◆ printValuesForCell()

template<typename T >
void ECLFilesComparator::printValuesForCell ( const std::string keyword,
const std::string reference,
size_t  kw_size,
size_t  cell,
Opm::EclIO::EGrid grid,
const T &  value1,
const T &  value2 
) const
protectedinherited

◆ results_init()

void ECLRegressionTest::results_init ( )

◆ results_rft()

void ECLRegressionTest::results_rft ( )

◆ results_rst()

void ECLRegressionTest::results_rst ( )

◆ results_smry()

void ECLRegressionTest::results_smry ( )

◆ setAcceptExtraKeywords()

void ECLRegressionTest::setAcceptExtraKeywords ( bool  acceptExtraKeywordsArg)
inline

◆ setIntegrationTest()

void ECLRegressionTest::setIntegrationTest ( bool  inregrationTestArg)
inline

◆ setLoadBaseRunData()

void ECLRegressionTest::setLoadBaseRunData ( bool  loadArg)
inline

◆ setOnlyLastReportNumber()

void ECLRegressionTest::setOnlyLastReportNumber ( bool  onlyLastSequenceArg)
inline

Option to only compare last occurrence.

◆ setPrintKeywordOnly()

void ECLRegressionTest::setPrintKeywordOnly ( bool  printArg)
inline

◆ setReportStepOnly()

void ECLRegressionTest::setReportStepOnly ( bool  reportStepOnlyArg)
inline

◆ throwOnErrors()

void ECLFilesComparator::throwOnErrors ( bool  dothrow)
inlineinherited

Member Data Documentation

◆ analysis

bool ECLFilesComparator::analysis = false
protectedinherited

Perform full error analysis.

Referenced by ECLFilesComparator::doAnalysis().

◆ deviations

std::map<std::string, std::vector<Deviation> > ECLFilesComparator::deviations
protectedinherited

Referenced by countDev().

◆ num_errors

size_t ECLFilesComparator::num_errors = 0
mutableprotectedinherited

◆ rootName1

std::string ECLFilesComparator::rootName1
protectedinherited

◆ rootName2

std::string ECLFilesComparator::rootName2
protectedinherited

◆ throwOnError

bool ECLFilesComparator::throwOnError = true
protectedinherited

Throw on first error.

Referenced by ECLFilesComparator::throwOnErrors().


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