opm-common
ECLFilesComparator Class Reference
Inheritance diagram for ECLFilesComparator:
ECLRegressionTest

Public Member Functions

 ECLFilesComparator (const std::string &basename1, const std::string &basename2, double absTolerance, double relTolerance)
 
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.
 
double getRelTolerance () const
 Returns the relative tolerance stored as a private member variable in the class.
 

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, const Opm::EclIO::EGrid *grid, const T &value1, const T &value2) const
 

Protected Attributes

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

Member Function Documentation

◆ average()

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

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

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

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.

◆ median()

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

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.


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