#include <EclFilesComparator.hpp>

Inheritance diagram for ECLFilesComparator:
Inheritance graph

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

Constructor & Destructor Documentation

◆ ECLFilesComparator()

ECLFilesComparator::ECLFilesComparator ( const std::string basename1,
const std::string basename2,
double  absTolerance,
double  relTolerance 
)

Member Function Documentation

◆ average()

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

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

◆ doAnalysis()

void ECLFilesComparator::doAnalysis ( bool  analize)
inline

References analysis.

◆ getAbsTolerance()

double ECLFilesComparator::getAbsTolerance ( ) const
inline

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

◆ getNoErrors()

size_t ECLFilesComparator::getNoErrors ( ) const
inline

References num_errors.

◆ getRelTolerance()

double ECLFilesComparator::getRelTolerance ( ) const
inline

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

◆ median()

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

◆ 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
protected

◆ throwOnErrors()

void ECLFilesComparator::throwOnErrors ( bool  dothrow)
inline

References throwOnError.

Member Data Documentation

◆ analysis

bool ECLFilesComparator::analysis = false
protected

Perform full error analysis.

Referenced by doAnalysis().

◆ deviations

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

◆ num_errors

size_t ECLFilesComparator::num_errors = 0
mutableprotected

Referenced by getNoErrors().

◆ rootName1

std::string ECLFilesComparator::rootName1
protected

◆ rootName2

std::string ECLFilesComparator::rootName2
protected

◆ throwOnError

bool ECLFilesComparator::throwOnError = true
protected

Throw on first error.

Referenced by throwOnErrors().


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