|
| IntegrationTest (const std::string &basename1, const std::string &basename2, double absTolerance, double relTolerance) |
| Sets up the integration test. More...
|
|
bool | elementInWhitelist (const std::string &keyword) const |
| Checks if a keyword is supported for comparison. More...
|
|
void | equalNumKeywords () const |
| Checks if the number of keywords equal in the two input cases. More...
|
|
void | results () |
| Finds deviations for all supported keywords. More...
|
|
void | resultsForKeyword (const std::string &keyword) |
| Finds deviations for a specific keyword. More...
|
|
| IntegrationTest (const char *basename1, const char *basename2, double atol, double rtol) |
| Constructor, creates an object of IntegrationTest class. More...
|
|
void | setAllowSpikes (bool allowSpikesArg) |
| This function sets the private member variable allowSpikes. More...
|
|
void | setFindVolumeError (bool findVolumeErrorArg) |
| This function sets the private member variable findVolumeError. More...
|
|
void | setOneOfTheMainVariables (bool oneOfTheMainVariablesArg) |
| This function sets the private member variable oneOfTheMainVariables. More...
|
|
void | setMainVariable (std::string mainVar) |
| This function sets the member variable string #mainVariable. More...
|
|
void | setSpikeLimit (int lim) |
| This function sets the private member variable spikeLimit. More...
|
|
void | setFindVectorWithGreatestErrorRatio (bool boolean) |
| This function sets the private member variable findVectorWithGreatestErrorRatio. More...
|
|
void | setAllowDifferentAmountOfKeywords (bool boolean) |
| This function sets the private member variable allowDifferentAmountsOfKeywords. More...
|
|
void | setThrowExceptionForTooGreatErrorRatio (bool boolean) |
| This function sets the private member variable throwExceptionForTooGreatErrorRatio. More...
|
|
void | getIntegrationTest () |
| This function executes a integration test for all the keywords. If the two files do not match in amount of keywords, an exception is thrown.
Uses the boolean member variables to know which tests to execute.
|
|
void | getIntegrationTest (const char *keyword) |
| This function executes a integration test for one specific keyword. If one or both of the files do not have the keyword, an exception is thorwn.
Uses the boolean member variables to know which tests to execute.
|
|
| SummaryComparator (const char *basename1, const char *basename2, double absoluteTolerance, double relativeTolerance) |
| Creates an SummaryComparator class object. More...
|
|
| ~SummaryComparator () |
| Destructor. More...
|
|
void | setPrintKeywords (bool boolean) |
| Sets the private member variable printKeywords. More...
|
|
void | setPrintSpecificKeyword (bool boolean) |
| Sets the private member variable printSpecificKeyword. More...
|
|
void | throwOnErrors (bool dothrow) |
| Set whether to throw on errors or not.
|
|
| ECLFilesComparator (int file_type, const std::string &basename1, const std::string &basename2, double absTolerance, double relTolerance) |
| Open ECLIPSE files and set tolerances and keywords. More...
|
|
| ~ECLFilesComparator () |
| Closing the ECLIPSE files.
|
|
void | throwOnErrors (bool dothrow) |
| Set whether to throw on errors or not.
|
|
size_t | getNoErrors () const |
| Returns the number of errors encountered in the performed comparisons.
|
|
int | getFileType () const |
| Returns the ECLIPSE filetype of this.
|
|
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.
|
|
void | printKeywords () const |
| Print all keywords and their respective Eclipse type for the two input cases.
|
|
void | printKeywordsDifference () const |
| Print common and uncommon keywords for the two input cases.
|
|
|
static double | getRectangleArea (double height, double width) |
| This function calculates the area of an rectangle of height height and width time-timePrev. More...
|
|
static double | integrate (const std::vector< double > &timeVec, const std::vector< double > &dataVec) |
| This function calculates the area under a graph by doing a Riemann sum. More...
|
|
static double | integrateError (const std::vector< double > &timeVec1, const std::vector< double > &dataVec1, const std::vector< double > &timeVec2, const std::vector< double > &dataVec2) |
| This function calculates the Riemann sum of the error between two graphs. More...
|
|
static Deviation | calculateDeviations (double val1, double val2) |
| Calculates the deviation between two values. More...
|
|
static double | unitStep (double value) |
| Unit step function. More...
|
|
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...
|
|
|
void | getDeviation (size_t refIndex, size_t &checkIndex, Deviation &dev) |
| Calculate deviation between two data values and stores it in a Deviation struct. More...
|
|
void | setDataSets (const std::vector< double > &timeVec1, const std::vector< double > &timeVec2) |
| Figure out which data file contains the most / less timesteps and assign member variable pointers accordingly. More...
|
|
void | setTimeVecs (std::vector< double > &timeVec1, std::vector< double > &timeVec2) |
| Reads in the time values of each time step. More...
|
|
void | getDataVecs (std::vector< double > &dataVec1, std::vector< double > &dataVec2, const char *keyword) |
| Read the data for one specific keyword into two separate vectors. More...
|
|
void | chooseReference (const std::vector< double > &timeVec1, const std::vector< double > &timeVec2, const std::vector< double > &dataVec1, const std::vector< double > &dataVec2) |
| Sets one data set as a basis and the other as values to check against. More...
|
|
double | getRelTolerance () |
| Returns the relative tolerance.
|
|
double | getAbsTolerance () |
| Returns the absolute tolerance.
|
|
const char * | getUnit (const char *keyword) |
| Returns the unit of the values of a keyword. More...
|
|
void | printUnits () |
| Prints the units of the files.
|
|
void | printKeywords () |
| Prints the keywords of the files. More...
|
|
void | printDataOfSpecificKeyword (const std::vector< double > &timeVec1, const std::vector< double > &timeVec2, const char *keyword) |
| Prints the summary vectors from the two files. More...
|
|
void | keywordValidForComparing (const std::string &keyword) const |
| Checks if the keyword exists in both cases. More...
|
|
unsigned int | getEclKeywordData (ecl_kw_type *&ecl_kw1, ecl_kw_type *&ecl_kw2, const std::string &keyword, int occurrence1, int occurrence2) const |
| Stores keyword data for a given occurrence. More...
|
|
template<typename T > |
void | printValuesForCell (const std::string &keyword, int occurrence1, int occurrence2, size_t cell, const T &value1, const T &value2) const |
| Prints values for a given keyword, occurrence and cell. More...
|
|
ecl_sum_type * | ecl_sum1 = nullptr |
| Struct that contains file1.
|
|
ecl_sum_type * | ecl_sum2 = nullptr |
| Struct that contains file2.
|
|
ecl_sum_type * | ecl_sum_fileShort = nullptr |
| For keeping track of the file with most/fewest timesteps.
|
|
ecl_sum_type * | ecl_sum_fileLong = nullptr |
| For keeping track of the file with most/fewest timesteps.
|
|
stringlist_type * | keys1 = nullptr |
| For storing all the keywords of file1.
|
|
stringlist_type * | keys2 = nullptr |
| For storing all the keywords of file2.
|
|
stringlist_type * | keysShort = nullptr |
| For keeping track of the file with most/fewest keywords.
|
|
stringlist_type * | keysLong = nullptr |
| For keeping track of the file with most/fewest keywords.
|
|
const std::vector< double > * | referenceVec = nullptr |
| For storing the values of each time step for the file containing the fewer time steps. More...
|
|
const std::vector< double > * | referenceDataVec = nullptr |
| For storing the data corresponding to each time step for the file containing the fewer time steps. More...
|
|
const std::vector< double > * | checkVec = nullptr |
| For storing the values of each time step for the file containing the more time steps. More...
|
|
const std::vector< double > * | checkDataVec = nullptr |
| For storing the data values corresponding to each time step for the file containing the more time steps. More...
|
|
bool | printKeyword = false |
| Boolean value for choosing whether to print the keywords or not.
|
|
bool | printSpecificKeyword = false |
| Boolean value for choosing whether to print the vectors of a keyword or not.
|
|
bool | throwOnError = true |
| Throw on first error.
|
|
ecl_file_type * | ecl_file1 = nullptr |
|
ecl_grid_type * | ecl_grid1 = nullptr |
|
ecl_file_type * | ecl_file2 = nullptr |
|
ecl_grid_type * | ecl_grid2 = nullptr |
|
std::vector< std::string > | keywords1 |
|
std::vector< std::string > | keywords2 |
|
bool | throwOnError = true |
| Throw on first error.
|
|
size_t | num_errors = 0 |
|
A class for executing a integration test for two ECLIPSE files.
This class inherits from ECLFilesComparator, which opens and closes the input cases and stores keywordnames. The three public functions equalNumKeywords(), results() and resultsForKeyword() can be invoked to compare griddata or keyworddata for all keywords or a given keyword (resultsForKeyword()).
The class inherits from the SummaryComparator class, which takes care of all file reading.
The IntegrationTest class compares values from the two different files and throws exceptions when the deviation is unsatisfying.
void IntegrationTest::resultsForKeyword |
( |
const std::string & |
keyword | ) |
|