changed: move the comparison classes out of libopmcommon
these classes are really not made for reusability. thus they should only be built into the applications.
This commit is contained in:
@@ -1,251 +0,0 @@
|
||||
/*
|
||||
Copyright 2016 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ECLFILESCOMPARATOR_HPP
|
||||
#define ECLFILESCOMPARATOR_HPP
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
struct ecl_file_struct; //!< Prototype for eclipse file struct, from ERT library.
|
||||
typedef struct ecl_file_struct ecl_file_type;
|
||||
|
||||
struct ecl_grid_struct; //!< Prototype for eclipse grid struct, from ERT library.
|
||||
typedef struct ecl_grid_struct ecl_grid_type;
|
||||
struct ecl_kw_struct; //!< Prototype for eclipse keyword struct, from ERT library.
|
||||
typedef struct ecl_kw_struct ecl_kw_type;
|
||||
|
||||
|
||||
/*! \brief Deviation struct.
|
||||
\details The member variables are default initialized to -1,
|
||||
which is an invalid deviation value.
|
||||
*/
|
||||
struct Deviation {
|
||||
double abs = -1; //!< Absolute deviation
|
||||
double rel = -1; //!< Relative deviation
|
||||
};
|
||||
|
||||
|
||||
/*! \brief A class for comparing ECLIPSE files.
|
||||
\details ECLFilesComparator opens ECLIPSE files
|
||||
(unified restart, initial and RFT in addition to grid file)
|
||||
from two simulations. This class has only the functions
|
||||
printKeywords() and printKeywordsDifference(), in addition to a
|
||||
couple of get-functions: the comparison logic is implemented in
|
||||
the subclasses RegressionTest and IntegrationTest. */
|
||||
class ECLFilesComparator {
|
||||
private:
|
||||
int file_type;
|
||||
double absTolerance = 0;
|
||||
double relTolerance = 0;
|
||||
protected:
|
||||
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, keywords2;
|
||||
bool throwOnError = true; //!< Throw on first error
|
||||
bool analysis = false; //!< Perform full error analysis
|
||||
std::map<std::string, std::vector<Deviation>> deviations;
|
||||
mutable size_t num_errors = 0;
|
||||
|
||||
//! \brief Checks if the keyword exists in both cases.
|
||||
//! \param[in] keyword Keyword to check.
|
||||
//! \details If the keyword does not exist in one of the cases, the function throws an exception.
|
||||
void keywordValidForComparing(const std::string& keyword) const;
|
||||
//! \brief Stores keyword data for a given occurrence
|
||||
//! \param[out] ecl_kw1 Pointer to a ecl_kw_type, which stores keyword data for first case given the occurrence.
|
||||
//! \param[out] ecl_kw2 Pointer to a ecl_kw_type, which stores keyword data for second case given the occurrence.
|
||||
//! \param[in] keyword Which keyword to consider.
|
||||
//! \param[in] occurrence Which keyword occurrence to consider.
|
||||
//! \details This function stores keyword data for the given keyword and occurrence in #ecl_kw1 and #ecl_kw2, and returns the number of cells (for which the keyword has a value at the occurrence). If the number of cells differ for the two cases, an exception is thrown.
|
||||
unsigned int getEclKeywordData(ecl_kw_type*& ecl_kw1, ecl_kw_type*& ecl_kw2, const std::string& keyword, int occurrence1, int occurrence2) const;
|
||||
//! \brief Prints values for a given keyword, occurrence and cell
|
||||
//! \param[in] keyword Which keyword to consider.
|
||||
//! \param[in] occurrence Which keyword occurrence to consider.
|
||||
//! \param[in] cell Which cell occurrence to consider (numbered by global index).
|
||||
//! \param[in] value1 Value for first file, the data type can be bool, int, double or std::string.
|
||||
//! \param[in] value2 Value for second file, the data type can be bool, int, double or std::string.
|
||||
//! \details Templatefunction for printing values when exceptions are thrown. The function is defined for bool, int, double and std::string.
|
||||
template <typename T>
|
||||
void printValuesForCell(const std::string& keyword, int occurrence1, int occurrence2, size_t kw_size, size_t cell, const T& value1, const T& value2) const;
|
||||
|
||||
public:
|
||||
//! \brief Open ECLIPSE files and set tolerances and keywords.
|
||||
//! \param[in] file_type Specifies which filetype to be compared, possible inputs are UNRSTFILE, INITFILE and RFTFILE.
|
||||
//! \param[in] basename1 Full path without file extension to the first case.
|
||||
//! \param[in] basename2 Full path without file extension to the second case.
|
||||
//! \param[in] absTolerance Tolerance for absolute deviation.
|
||||
//! \param[in] relTolerance Tolerance for relative deviation.
|
||||
//! \details The content of the ECLIPSE files specified in the input is stored in the ecl_file_type and ecl_grid_type member variables. In addition the keywords and absolute and relative tolerances (member variables) are set. If the constructor is unable to open one of the ECLIPSE files, an exception will be thrown.
|
||||
ECLFilesComparator(int file_type, const std::string& basename1, const std::string& basename2, double absTolerance, double relTolerance);
|
||||
//! \brief Closing the ECLIPSE files.
|
||||
~ECLFilesComparator();
|
||||
|
||||
//! \brief Set whether to throw on errors or not.
|
||||
void throwOnErrors(bool dothrow) { throwOnError = dothrow; }
|
||||
|
||||
//! \brief Set whether to perform a full error analysis.
|
||||
void doAnalysis(bool analize) { analysis = analize; }
|
||||
|
||||
//! \brief Returns the number of errors encountered in the performed comparisons.
|
||||
size_t getNoErrors() const { return num_errors; }
|
||||
|
||||
//! \brief Returns the ECLIPSE filetype of this
|
||||
int getFileType() const {return file_type;}
|
||||
//! \brief Returns the absolute tolerance stored as a private member variable in the class
|
||||
double getAbsTolerance() const {return absTolerance;}
|
||||
//! \brief Returns the relative tolerance stored as a private member variable in the class
|
||||
double getRelTolerance() const {return relTolerance;}
|
||||
|
||||
//! \brief Print all keywords and their respective Eclipse type for the two input cases.
|
||||
void printKeywords() const;
|
||||
//! \brief Print common and uncommon keywords for the two input cases.
|
||||
void printKeywordsDifference() const;
|
||||
|
||||
//! \brief Calculate deviations for two values.
|
||||
//! \details 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.
|
||||
static Deviation calculateDeviations(double val1, double val2);
|
||||
//! \brief Calculate median of a vector.
|
||||
//! \details 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.
|
||||
static double median(std::vector<double> vec);
|
||||
//! \brief Calculate average of a vector.
|
||||
//! \details Returning the average of the input vector, i.e. the sum of all values divided by the number of elements.
|
||||
static double average(const std::vector<double>& vec);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*! \brief A class for executing a regression test for two ECLIPSE files.
|
||||
\details 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()).
|
||||
*/
|
||||
|
||||
class RegressionTest: public ECLFilesComparator {
|
||||
private:
|
||||
// These vectors store absolute and relative deviations, respecively. Note that they are whiped clean for every new keyword comparison.
|
||||
std::vector<double> absDeviation, relDeviation;
|
||||
// Keywords which should not contain negative values, i.e. uses allowNegativeValues = false in deviationsForCell():
|
||||
const std::vector<std::string> keywordDisallowNegatives = {"SGAS", "SWAT", "PRESSURE"};
|
||||
|
||||
// Only compare last occurrence
|
||||
bool onlyLastOccurrence = false;
|
||||
|
||||
// Prints results stored in absDeviation and relDeviation.
|
||||
void printResultsForKeyword(const std::string& keyword) const;
|
||||
|
||||
// Function which compares data at specific occurrences and for a specific keyword type. The functions takes two occurrence inputs to also be able to
|
||||
// compare keywords which are shifted relative to each other in the two files. This is for instance handy when running flow with restart from different timesteps,
|
||||
// and comparing the last timestep from the two runs.
|
||||
void boolComparisonForOccurrence(const std::string& keyword, int occurrence1, int occurrence2) const;
|
||||
void charComparisonForOccurrence(const std::string& keyword, int occurrence1, int occurrence2) const;
|
||||
void intComparisonForOccurrence(const std::string& keyword, int occurrence1, int occurrence2) const;
|
||||
void doubleComparisonForOccurrence(const std::string& keyword, int occurrence1, int occurrence2);
|
||||
// deviationsForCell throws an exception if both the absolute deviation AND the relative deviation
|
||||
// are larger than absTolerance and relTolerance, respectively. In addition,
|
||||
// if allowNegativeValues is passed as false, an exception will be thrown when the absolute value
|
||||
// of a negative value exceeds absTolerance. If no exceptions are thrown, the absolute and relative deviations are added to absDeviation and relDeviation.
|
||||
void deviationsForCell(double val1, double val2, const std::string& keyword, int occurrence1, int occurrence2, size_t kw_size, size_t cell, bool allowNegativeValues = true);
|
||||
public:
|
||||
//! \brief Sets up the regression test.
|
||||
//! \param[in] file_type Specifies which filetype to be compared, possible inputs are UNRSTFILE, INITFILE and RFTFILE.
|
||||
//! \param[in] basename1 Full path without file extension to the first case.
|
||||
//! \param[in] basename2 Full path without file extension to the second case.
|
||||
//! \param[in] absTolerance Tolerance for absolute deviation.
|
||||
//! \param[in] relTolerance Tolerance for relative deviation.
|
||||
//! \details This constructor only calls the constructor of the superclass, see the docs for ECLFilesComparator for more information.
|
||||
RegressionTest(int file_type, const std::string& basename1, const std::string& basename2, double absTolerance, double relTolerance):
|
||||
ECLFilesComparator(file_type, basename1, basename2, absTolerance, relTolerance) {}
|
||||
|
||||
//! \brief Option to only compare last occurrence
|
||||
void setOnlyLastOccurrence(bool onlyLastOccurrenceArg) {this->onlyLastOccurrence = onlyLastOccurrenceArg;}
|
||||
|
||||
//! \brief Compares grid properties of the two cases.
|
||||
// gridCompare() checks if both the number of active and global cells in the two cases are the same. If they are, and volumecheck is true, all cells are looped over to calculate the cell volume deviation for the two cases. If the both the relative and absolute deviation exceeds the tolerances, an exception is thrown.
|
||||
void gridCompare(const bool volumecheck) const;
|
||||
//! \brief Calculates deviations for all keywords.
|
||||
// This function checks if the number of keywords of the two cases are equal, and if it is, resultsForKeyword() is called for every keyword. If not, an exception is thrown.
|
||||
void results();
|
||||
//! \brief Calculates deviations for a specific keyword.
|
||||
//! \param[in] keyword Keyword which should be compared, if this keyword is absent in one of the cases, an exception will be thrown.
|
||||
//! \details This function loops through every report step and every cell and compares the values for the given keyword from the two input cases. If the absolute or relative deviation between the two values for each step exceeds both the absolute tolerance and the relative tolerance (stored in ECLFilesComparator), an exception is thrown. In addition, some keywords are marked for "disallow negative values" -- these are SGAS, SWAT and PRESSURE. An exception is thrown if a value of one of these keywords is both negative and has an absolute value larger than the absolute tolerance. If no exceptions are thrown, resultsForKeyword() uses the private member funtion printResultsForKeyword to print the average and median deviations.
|
||||
void resultsForKeyword(const std::string& keyword);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief A class for executing a integration test for two ECLIPSE files.
|
||||
\details 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()).
|
||||
*/
|
||||
class IntegrationTest: public ECLFilesComparator {
|
||||
private:
|
||||
std::vector<double> cellVolumes; //!< Vector of cell volumes in second input case (indexed by global index)
|
||||
std::vector<double> initialCellValues; //!< Keyword values for all cells at first occurrence (index by global index)
|
||||
|
||||
// These are the only keywords which are compared, since SWAT should be "1 - SOIL - SGAS", this keyword is omitted.
|
||||
const std::vector<std::string> keywordWhitelist = {"SGAS", "SWAT", "PRESSURE"};
|
||||
|
||||
void setCellVolumes();
|
||||
void initialOccurrenceCompare(const std::string& keyword);
|
||||
void occurrenceCompare(const std::string& keyword, int occurrence) const;
|
||||
public:
|
||||
//! \brief Sets up the integration test.
|
||||
//! \param[in] basename1 Full path without file extension to the first case.
|
||||
//! \param[in] basename2 Full path without file extension to the second case.
|
||||
//! \param[in] absTolerance Tolerance for absolute deviation.
|
||||
//! \param[in] relTolerance Tolerance for relative deviation.
|
||||
//! \details This constructor calls the constructor of the superclass, with input filetype unified restart. See the docs for ECLFilesComparator for more information.
|
||||
IntegrationTest(const std::string& basename1, const std::string& basename2, double absTolerance, double relTolerance);
|
||||
|
||||
//! \brief Checks if a keyword is supported for comparison.
|
||||
//! \param[in] keyword Keyword to check.
|
||||
bool elementInWhitelist(const std::string& keyword) const;
|
||||
//! \brief Checks if the number of keywords equal in the two input cases.
|
||||
//! \param[in] keyword Keyword to check.
|
||||
void equalNumKeywords() const;
|
||||
|
||||
//! \brief Finds deviations for all supported keywords.
|
||||
//! \details results() loops through all supported keywords for integration test (defined in keywordWhitelist -- this is SGAS, SWAT and PRESSURE) and calls resultsForKeyword() for each keyword.
|
||||
void results();
|
||||
//! \brief Finds deviations for a specific keyword.
|
||||
//! \param[in] keyword Keyword to check.
|
||||
/*! \details First, resultsForKeyword() checks if the keyword exits in both cases, and if the number of keyword occurrences in the two cases differ. If these tests fail, an exception is thrown. Then deviaitons are calculated as described below for each occurrence, and an exception is thrown if the relative error ratio \f$E\f$ is larger than the relative tolerance.
|
||||
* Calculation:\n
|
||||
* Let the keyword values for occurrence \f$n\f$ and cell \f$i\f$ be \f$p_{n,i}\f$ and \f$q_{n,i}\f$ for input case 1 and 2, respectively.
|
||||
* Consider first the initial occurrence (\f$n=0\f$). The function uses the second cases as reference, and calculates the volume weighted sum of \f$q_{0,i}\f$ over all cells \f$i\f$:
|
||||
* \f[ S_0 = \sum_{i} q_{0,i} v_i \f]
|
||||
* where \f$v_{i}\f$ is the volume of cell \f$i\f$ in case 2. Then, the deviations between the cases for each cell are calculated:
|
||||
* \f[ \Delta = \sum_{i} |p_{0,i} - q_{0,i}| v_i.\f]
|
||||
* The error ratio is then \f$E = \Delta/S_0\f$.\n
|
||||
* For all other occurrences \f$n\f$, the deviation value \f$\Delta\f$ is calculated the same way, but the total value \f$S\f$ is calculated relative to the initial occurrence total \f$S_0\f$:
|
||||
* \f[ S = \sum_{i} |q_{n,i} - q_{0,i}| v_i. \f]
|
||||
* The error ratio is \f$ E = \Delta/S\f$. */
|
||||
void resultsForKeyword(const std::string& keyword);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,186 +0,0 @@
|
||||
/*
|
||||
Copyright 2016 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SUMMARYCOMPARATOR_HPP
|
||||
#define SUMMARYCOMPARATOR_HPP
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
|
||||
// helper macro to handle error throws or not
|
||||
#define HANDLE_ERROR(type, message) \
|
||||
{ \
|
||||
if (throwOnError) \
|
||||
OPM_THROW(type, message); \
|
||||
else \
|
||||
std::cerr << message << std::endl; \
|
||||
}
|
||||
|
||||
|
||||
//! \brief Prototyping struct, encapsuling the stringlist libraries.
|
||||
struct stringlist_struct;
|
||||
typedef struct stringlist_struct stringlist_type;
|
||||
|
||||
//! \brief Prototyping struct, encapsuling the ert libraries.
|
||||
struct ecl_sum_struct;
|
||||
typedef struct ecl_sum_struct ecl_sum_type;
|
||||
|
||||
|
||||
//! \brief Struct for storing the deviation between two values.
|
||||
struct Deviation {
|
||||
double abs = 0; //!< The absolute deviation
|
||||
double rel = 0; //!< The relative deviation
|
||||
};
|
||||
|
||||
|
||||
class SummaryComparator {
|
||||
private:
|
||||
double absoluteTolerance = 0; //!< The maximum absolute deviation that is allowed between two values.
|
||||
double relativeTolerance = 0; //!< The maximum relative deviation that is allowed between twi values.
|
||||
protected:
|
||||
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.
|
||||
const std::vector<double> * referenceDataVec = nullptr; //!< For storing the data corresponding to each time step for the file containing the fewer time steps.
|
||||
const std::vector<double> * checkVec = nullptr; //!< For storing the values of each time step for the file containing the more time steps.
|
||||
const std::vector<double> * checkDataVec = nullptr; //!< For storing the data values corresponding to each time step for the file containing the more time steps.
|
||||
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
|
||||
bool analysis = false; //!< Perform error analysis
|
||||
std::map<std::string, std::vector<Deviation>> deviations;
|
||||
|
||||
//! \brief Calculate deviation between two data values and stores it in a Deviation struct.
|
||||
//! \param[in] refIndex Index in reference data
|
||||
//! \param[in] checkindex Index in data to be checked.
|
||||
//! \param[out] dev Holds the result from the comparison on return.
|
||||
//! \details Uses the #referenceVec as basis, and checks its values against the values in #checkDataVec. The function is reccursive, and will update the iterative index j of the #checkVec until #checkVec[j] >= #referenceVec[i]. \n When #referenceVec and #checkVec have the same time value (i.e. #referenceVec[i] == #checkVec[j]) a direct comparison is used, \n when this is not the case, when #referenceVec[i] do not excist as an element in #checkVec, a value is generated, either by the principle of unit step or by interpolation.
|
||||
void getDeviation(size_t refIndex, size_t &checkIndex, Deviation &dev);
|
||||
|
||||
//! \brief Figure out which data file contains the most / less timesteps and assign member variable pointers accordingly.
|
||||
//! \param[in] timeVec1 Data from first file
|
||||
//! \param[in] timeVec2 Data from second file
|
||||
//! \details Figure out which data file that contains the more/fewer time steps and assigns the private member variable pointers #ecl_sum_fileShort / #ecl_sum_fileLong to the correct data sets #ecl_sum1 / #ecl_sum2.
|
||||
void setDataSets(const std::vector<double>& timeVec1,
|
||||
const std::vector<double>& timeVec2);
|
||||
|
||||
//! \brief Reads in the time values of each time step.
|
||||
//! \param[in] timeVec1 Vector for storing the time steps from file1
|
||||
//! \param[in] timeVec2 Vector for storing the time steps from file2
|
||||
void setTimeVecs(std::vector<double> &timeVec1,std::vector<double> &timeVec2);
|
||||
|
||||
//! \brief Read the data for one specific keyword into two separate vectors.
|
||||
//! \param[in] dataVec1 Vector for storing the data for one specific keyword from file1
|
||||
//! \param[in] dataVec2 Vector for storing the data for one specific keyword from file2
|
||||
//! \details The two data files do not necessarily have the same amount of data values, but the values must correspond to the same interval in time. Thus possible to interpolate values.
|
||||
void getDataVecs(std::vector<double> &dataVec1,
|
||||
std::vector<double> &dataVec2, const char* keyword);
|
||||
|
||||
//! \brief Sets one data set as a basis and the other as values to check against.
|
||||
//! \param[in] timeVec1 Used to figure out which dataset that have the more/fewer time steps.
|
||||
//! \param[in] timeVec2 Used to figure out which dataset that have the more/fewer time steps.
|
||||
//! \param[in] dataVec1 For assiging the the correct pointer to the data vector.
|
||||
//! \param[in] dataVec2 For assiging the the correct pointer to the data vector.
|
||||
//! \details Figures out which time vector that contains the fewer elements. Sets this as #referenceVec and its corresponding data as #referenceDataVec. \n The remaining data set is set as #checkVec (the time vector) and #checkDataVec.
|
||||
void chooseReference(const std::vector<double> &timeVec1,
|
||||
const std::vector<double> &timeVec2,
|
||||
const std::vector<double> &dataVec1,
|
||||
const std::vector<double> &dataVec2);
|
||||
|
||||
//! \brief Returns the relative tolerance.
|
||||
double getRelTolerance(){return this->relativeTolerance;}
|
||||
|
||||
//! \brief Returns the absolute tolerance.
|
||||
double getAbsTolerance(){return this->absoluteTolerance;}
|
||||
|
||||
//! \brief Returns the unit of the values of a keyword
|
||||
//! \param[in] keyword The keyword of interest.
|
||||
//! \param[out] ret The unit of the keyword as a const char*.
|
||||
const char* getUnit(const char* keyword);
|
||||
|
||||
//! \brief Prints the units of the files.
|
||||
void printUnits();
|
||||
|
||||
//! \brief Prints the keywords of the files.
|
||||
//! \details The function prints first the common keywords, than the keywords that are different.
|
||||
void printKeywords();
|
||||
|
||||
//! \brief Prints the summary vectors from the two files.
|
||||
//! \details The function requires that the summary vectors of the specific file have been read into the member variables referenceVec etc.
|
||||
void printDataOfSpecificKeyword(const std::vector<double>& timeVec1,
|
||||
const std::vector<double>& timeVec2,
|
||||
const char* keyword);
|
||||
|
||||
public:
|
||||
//! \brief Creates an SummaryComparator class object
|
||||
//! \param[in] basename1 Path to file1 without extension.
|
||||
//! \param[in] basename1 Path to file2 without extension.
|
||||
//! \param[in] absoluteTolerance The absolute tolerance which is to be used in the test.
|
||||
//! \param[in] relativeTolerance The relative tolerance which is to be used in the test.
|
||||
//! \details The constructor creates an object of the class, and openes the files, an exception is thrown if the opening of the files fails. \n It creates stringlists, in which keywords are to be stored, and figures out which keylist that contains the more/less keywords. \n Also the private member variables aboluteTolerance and relativeTolerance are set.
|
||||
SummaryComparator(const char* basename1, const char* basename2, double absoluteTolerance, double relativeTolerance);
|
||||
|
||||
//! \brief Destructor
|
||||
//! \details The destructor takes care of the allocated memory in which data has been stored.
|
||||
~SummaryComparator();
|
||||
|
||||
//! \brief Calculates the deviation between two values
|
||||
//! \param[in] val1 The first value of interest.
|
||||
//! \param[in] val2 The second value if interest.
|
||||
//! \param[out] ret Returns a Deviation struct.
|
||||
//! \details The function takes two values, calculates the absolute and relative deviation and returns the result as a Deviation struct.
|
||||
static Deviation calculateDeviations( double val1, double val2);
|
||||
|
||||
//! \brief Sets the private member variable printKeywords
|
||||
//! \param[in] boolean Boolean value
|
||||
//! \details The function sets the private member variable printKeywords. When it is true the function printKeywords will be called.
|
||||
void setPrintKeywords(bool boolean){this->printKeyword = boolean;}
|
||||
|
||||
//! \brief Sets the private member variable printSpecificKeyword
|
||||
//! \param[in] boolean Boolean value
|
||||
//! \details The function sets the private member variable printSpecificKeyword. When true, the summary vector of the keyword for both files will be printed.
|
||||
void setPrintSpecificKeyword(bool boolean){this->printSpecificKeyword = boolean;}
|
||||
|
||||
//! \brief Unit step function
|
||||
//! \param[in] value The input value should be the last know value
|
||||
//! \param[out] ret Return the unit-step-function value.
|
||||
//! \details In this case: The unit step function is used when the data from the two data set, which is to be compared, don't match in time. \n The unit step function is then to be called on the #checkDataVec 's value at the last time step which is before the time of comparison.
|
||||
|
||||
//! \brief Returns a value based on the unit step principle.
|
||||
static double unitStep(double value){return value;}
|
||||
|
||||
//! \brief Set whether to throw on errors or not.
|
||||
void throwOnErrors(bool dothrow) { throwOnError = dothrow; }
|
||||
|
||||
//! \brief Set whether or not to perform error analysis.
|
||||
void doAnalysis(bool analyse) { analysis = analyse; }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,216 +0,0 @@
|
||||
/*
|
||||
Copyright 2016 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/test_util/summaryComparator.hpp>
|
||||
|
||||
//! \brief Struct for storing the total area under a graph.
|
||||
//! \details Used when plotting summary vector against time. In most cases this represents a volume.
|
||||
struct WellProductionVolume{
|
||||
double total=0; //!< The total area under the graph when plotting the summary vector against time. In most cases the total production volume.
|
||||
double error=0; //!< The total area under the graph when plotting the deviation vector against time. In most cases the total error volume.
|
||||
|
||||
//! \brief Overloaded operator
|
||||
//! \param[in] rhs WellProductionVolume struct
|
||||
WellProductionVolume& operator+=(const WellProductionVolume& rhs){
|
||||
this->total += rhs.total;
|
||||
this->error += rhs.error;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
//! \details The class inherits from the SummaryComparator class, which takes care of all file reading. \n The IntegrationTest class compares values from the two different files and throws exceptions when the deviation is unsatisfying.
|
||||
class IntegrationTest: public SummaryComparator {
|
||||
private:
|
||||
bool allowSpikes = false; //!< Boolean value, when true checkForSpikes is included as a sub test in the integration test. By default: false.
|
||||
bool findVolumeError = false; //!< Boolean value, when true volumeErrorCheck() is included as a sub test in the integration test. By default: false.
|
||||
bool allowDifferentAmountOfKeywords = true; //!< Boolean value, when false the integration test will check wheter the two files have the same amount of keywords. \nIf they don't, an exception will be thrown. By default: true.
|
||||
bool findVectorWithGreatestErrorRatio = false; //!< Boolean value, when true the integration test will find the vector that has the greatest error ratio. By default: false.
|
||||
bool oneOfTheMainVariables = false; //!< Boolean value, when true the integration test will only check for one of the primary variables (WOPR, WGPR, WWPR. WBHP), which will be specified by user. By default: false.
|
||||
bool throwExceptionForTooGreatErrorRatio = true; //!< Boolean value, when true any volume error ratio that exceeds the relativeTolerance will cause an exception to be thrown. By default: true.
|
||||
std::string mainVariable; //!< String variable, where the name of the main variable of interest (one of WOPR, WBHP, WWPR, WGPR) is stored. Can be empty.
|
||||
int spikeLimit = 13370; //!< The limit for how many spikes to allow in the data set of a certain keyword. By default: Set to a high number, \n should not trig the (if spikeOccurrences > spikeLimit){ // throw exception }.
|
||||
|
||||
WellProductionVolume WOP; //!< WellProductionVolume struct for storing the total production volume and total error volume of all the keywords which start with WOPR
|
||||
WellProductionVolume WWP; //!< WellProductionVolume struct for storing the total production volume and total error volume of all the keywords which start with WWPR
|
||||
WellProductionVolume WGP;//!< WellProductionVolume struct for storing the total production volume and total error volume of all the keywords which start with WGPR
|
||||
WellProductionVolume WBHP; //!< WellProductionVolume struct for storing the value of the area under the graph when plotting summary vector/deviation vector against time.This is for keywords starting with WBHP. \nNote: the name of the struct may be misleading, this is not an actual volume.
|
||||
|
||||
|
||||
//! \brief The function gathers the correct data for comparison for a specific keyword
|
||||
//! \param[in] timeVec1 A std::vector<double> that contains the time steps of file 1.
|
||||
//! \param[in] timeVec2 A std::vector<double> that contains the time steps of file 2.
|
||||
//! \param[in] keyword The keyword of interest
|
||||
//! \details The function requires an outer loop which iterates over the keywords of the files. It prepares an integration test by gathering the data, stroing it into two vectors, \n deciding which is to be used as a reference/basis and calling the test function.
|
||||
void checkForKeyword(const std::vector<double>& timeVec1,
|
||||
const std::vector<double>& timeVec2, const char* keyword);
|
||||
|
||||
//! \brief The function compares the volume error to the total production volume of a certain type of keyword.
|
||||
//! param[in] keyword The keyword of interest.
|
||||
//! \details The function takes in a keyword and checks if it is of interest. Only keywords which say something about the well oil production, well water production, \n well gas production and the well BHP are of interest. The function sums up the total production in the cases where it is possible, \n and sums up the error volumes by a trapezoid integration method. The resulting values are stored in member variable structs of type WellProductionVolume, and double variables. For proper use of the function all the keywords of the file should be checked. This is satisfied if it is called by checkForKeyword.
|
||||
void volumeErrorCheck(const char* keyword);
|
||||
|
||||
//! \brief The function calculates the total production volume and total error volume of a specific keyword
|
||||
//! \param[in] timeVec1 A std::vector<double> that contains the time steps of file 1.
|
||||
//! \param[in] timeVec2 A std::vector<double> that contains the time steps of file 2.
|
||||
//! \param[in] keyword The keyword of interest
|
||||
//! \param[out] ret Returns a WellProductionWolume struct
|
||||
//! \details The function reads the data from the two files into the member variable vectors (of the super class). It returns a WellProductionVolume struct calculated from the vectors corresponding to the keyword.
|
||||
WellProductionVolume getSpecificWellVolume(const std::vector<double>& timeVec1,
|
||||
const std::vector<double>& timeVec2,
|
||||
const char* keyword);
|
||||
|
||||
//! \brief The function is a regression test which allows spikes.
|
||||
//! \param[in] keyword The keyword of interest, the keyword the summary vectors "belong" to.
|
||||
//! \details The function requires the protected member variables referenceVec, referenceDataVec, checkVec and checkDataVec to be stored with data, which is staisfied if it is called by checkForKeyword. \n It compares the two vectors value by value, and if the deviation is unsatisfying, the errorOccurrenceCounter is incremented. If the errorOccurrenceCounter becomes greater than the errorOccurrenceLimit, \n a exception is thrown. The function will allow spike values, however, if two values in a row exceed the deviation limit, they are no longer spikes, and an exception is thrown.
|
||||
void checkWithSpikes(const char* keyword);
|
||||
|
||||
//! \brief Caluculates a deviation, throws exceptions and writes and error message.
|
||||
//! \param[in] deviation Deviation struct
|
||||
//! \param[out] int Returns 0/1, depending on wheter the deviation exceeded the limit or not.
|
||||
//! \details The function checks the values of the Deviation struct against the absolute and relative tolerance, which are private member values of the super class. \n When comparing against the relative tolerance an additional term is added, the absolute deviation has to be greater than 1e-6 for the function to throw an exception. \n When the deviations are too great, the function returns 1.
|
||||
int checkDeviation(const Deviation& deviation);
|
||||
|
||||
//! \brief Calculates the keyword's total production volume and error volume
|
||||
//! \param[in] keyword The keyword of interest.
|
||||
//! \param[out] wellProductionVolume A struct containing the total production volume and the total error volume.
|
||||
//! \details The function calculates the total production volume and total error volume of a keyword, by the trapezoid integral method. \n The function throws and exception if the total error volume is negative. The function returns the results as a struct.
|
||||
WellProductionVolume getWellProductionVolume(const char* keyword);
|
||||
|
||||
//! \brief The function function works properly when the private member variables are set (after running the integration test which findVolumeError = true). \n It prints out the total production volume, the total error volume and the error ratio.
|
||||
void evaluateWellProductionVolume();
|
||||
|
||||
//! \brief The function calculates the total production volume and total error volume
|
||||
//! \param keyword The keyword of interest
|
||||
//! \details The function uses the data that is stored in the member variable vectors. It calculates the total production volume \n and the total error volume of the specified keyword, and adds the result to the private member WellProductionVolume variables of the class.
|
||||
void updateVolumeError(const char* keyword);
|
||||
|
||||
//! \brief Finds the keyword which has the greates error volume ratio
|
||||
//! \param[in] volume WellProductionVolume struct which contains the data used for comparison
|
||||
//! \param[in] greatestRatio Double value taken in by reference. Stores the greatest error ratio value.
|
||||
//! \param[in] currentKeyword The keyword that is under evaluation
|
||||
//! \param[in] greatestErrorRatio String which contains the name of the keyword which has the greatest error ratio
|
||||
//! \details The function requires an outer loop which iterates over the keywords in the files, and calls the function for each keyword. \nThe valiables double greatestRatio and std::string keywordWithTheGreatestErrorRatio must be declared outside the loop. \nWhen the current error ratio is greater than the value stored in greatestRatio, the gratestRatio value is updated with the current error ratio.
|
||||
void findGreatestErrorRatio(const WellProductionVolume& volume,
|
||||
double &greatestRatio,
|
||||
const char* currentKeyword,
|
||||
std::string &greatestErrorRatio);
|
||||
|
||||
#if 0
|
||||
//! \brief Checks whether the unit of the two data vectors is the same
|
||||
//! \param[in] keyword The keyword of interest
|
||||
//! \param[out] boolean True/false, depending on whether the units are equal or not
|
||||
bool checkUnits(const char* keyword);
|
||||
#endif
|
||||
public:
|
||||
//! \brief Constructor, creates an object of IntegrationTest class.
|
||||
//! \param[in] basename1 Path to file1 without extension.
|
||||
//! \param[in] basename1 Path to file2 without extension.
|
||||
//! \param[in] atol The absolute tolerance which is to be used in the test.
|
||||
//! \param[in] rtol The relative tolerance which is to be used in the test.
|
||||
//! \details The constructor calls the constructor of the super class.
|
||||
IntegrationTest(const char* basename1, const char* basename2,
|
||||
double atol, double rtol) :
|
||||
SummaryComparator(basename1, basename2, atol, rtol) {}
|
||||
|
||||
//! \brief This function sets the private member variable allowSpikes.
|
||||
//! \param[in] allowSpikes Boolean value
|
||||
//! \details When allowSpikes is true, the integration test checkWithSpikes is excecuted.
|
||||
void setAllowSpikes(bool allowSpikesArg){this->allowSpikes = allowSpikesArg;}
|
||||
|
||||
//! \brief This function sets the private member variable findVolumeError.
|
||||
//! \param[in] findVolumeError Boolean value
|
||||
//! \details When findVolumeError is true, the integration test volumeErrorCheck and the function evaluateWellProductionVolume are excecuted.
|
||||
void setFindVolumeError(bool findVolumeErrorArg){this->findVolumeError = findVolumeErrorArg;}
|
||||
|
||||
//! \brief This function sets the private member variable oneOfTheMainVariables
|
||||
//! \param[in] oneOfTheMainVariables Boolean value
|
||||
//! \details When oneOfTheMainVariables is true, the integration test runs the substest volumeErrorCheckForOneSpecificVariable.
|
||||
void setOneOfTheMainVariables(bool oneOfTheMainVariablesArg){this->oneOfTheMainVariables = oneOfTheMainVariablesArg;}
|
||||
|
||||
//! \brief This function sets the member variable string #mainVariable
|
||||
//! \param[in] mainVar This is the string should contain one of the main variables. e.g. WOPR
|
||||
void setMainVariable(std::string mainVar){this->mainVariable = mainVar;}
|
||||
|
||||
//! \brief This function sets the private member variable spikeLimit.
|
||||
//! \param[in] lim The value which the spike limit is to be given.
|
||||
void setSpikeLimit(int lim){this->spikeLimit = lim;}
|
||||
|
||||
//! \brief This function sets the private member variable findVectorWithGreatestErrorRatio
|
||||
//! \param[in] findVolumeError Boolean value
|
||||
//! \details When findVectorWithGreatestErrorRatio is true, the integration test will print the vector with the greatest error ratio.
|
||||
void setFindVectorWithGreatestErrorRatio(bool boolean){this->findVectorWithGreatestErrorRatio = boolean;}
|
||||
|
||||
//! \brief This function sets the private member variable allowDifferentAmountsOfKeywords
|
||||
//! \param[in] boolean Boolean value
|
||||
//! \details When allowDifferentAmountOfKeywords is false, the amount of kewyord in the two files will be compared. \nIf the number of keywords are different an exception will be thrown.
|
||||
void setAllowDifferentAmountOfKeywords(bool boolean){this->allowDifferentAmountOfKeywords = boolean;}
|
||||
|
||||
//! \brief This function sets the private member variable throwExceptionForTooGreatErrorRatio
|
||||
//! \param[in] boolean Boolean value
|
||||
//! \details When throwExceptionForTooGreatErrorRatio is false, the function getWellProductionVolume will throw an exception.
|
||||
void setThrowExceptionForTooGreatErrorRatio(bool boolean){this->throwExceptionForTooGreatErrorRatio = boolean;}
|
||||
|
||||
//! \brief 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. \n Uses the boolean member variables to know which tests to execute.
|
||||
void getIntegrationTest();
|
||||
|
||||
//! \brief 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. \n Uses the boolean member variables to know which tests to execute.
|
||||
void getIntegrationTest(const char* keyword);
|
||||
|
||||
//! \brief This function calculates the area of an rectangle of height height and width time-timePrev
|
||||
//! \param[in] height The height of the rectangle. See important statement of use below.
|
||||
//! \param[in] width The width of the rectangle
|
||||
//! \param[out] area Returns the area of the rectangle
|
||||
//! \details This function is simple. When using it on a summary vector (data values plotted againt time), calculating the area between the two points i and i+1 note this:\nThe width is time_of_i+1 - time_of_i, the height is data_of_i+1 NOT data_of_i. The upper limit must be used.
|
||||
static double getRectangleArea(double height, double width){return height*width;}
|
||||
|
||||
//! \brief This function calculates the area under a graph by doing a Riemann sum
|
||||
//! \param[in] timeVec Contains the time values
|
||||
//! \param[in] dataVec Contains the data values
|
||||
//! \details The function does a Riemann sum integration of the graph formed
|
||||
//! by the points (timeVec[i] , dataVec[i]).
|
||||
//! In the case of a summary vector, the summary vector of quantity
|
||||
//! corresponding to a rate, is a piecewise continus function consisting
|
||||
//! of unit step functions. Thus the Riemann sum will become an
|
||||
//! exact expression for the integral of the graph.
|
||||
//! Important: For the data values correspoding to time i and i-1,
|
||||
//! the fixed value of the height of the rectangles in the Riemann sum
|
||||
//! is set by the data value i. The upper limit must be used.
|
||||
static double integrate(const std::vector<double>& timeVec,
|
||||
const std::vector<double>& dataVec);
|
||||
|
||||
//! \brief This function calculates the Riemann sum of the error between two graphs.
|
||||
//! \param[in] timeVec1 Contains the time values of graph 1
|
||||
//! \param[in] dataVec1 Contains the data values of graph 1
|
||||
//! \param[in] timeVec2 Contains the time values of graph 2
|
||||
//! \param[in] dataVec2 Contains the data values of graph 2
|
||||
//! \details This function takes in two graphs and returns the integrated error.
|
||||
//! In case of ecl summary vectors: if the vectors correspond to a
|
||||
//! quantity which is a rate, the vectors will be piecewise
|
||||
//! continous unit step functions. In this case the error will also
|
||||
//! be a piecewise continous unit step function. The function uses
|
||||
//! a Riemann sum when calculating the integral. Thus the integral
|
||||
//! will become exact. Important: For the data values corresponding
|
||||
//! to time i and i-1, the fixed value of the height of the rectangles
|
||||
//! in the Riemann sum is set by the data value i.
|
||||
//! The upper limit must be used.
|
||||
static double integrateError(const std::vector<double>& timeVec1,
|
||||
const std::vector<double>& dataVec1,
|
||||
const std::vector<double>& timeVec2,
|
||||
const std::vector<double>& dataVec2);
|
||||
};
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
Copyright 2016 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SUMMARYREGRESSIONTEST_HPP
|
||||
#define SUMMARYREGRESSIONTEST_HPP
|
||||
|
||||
#include <opm/test_util/summaryComparator.hpp>
|
||||
|
||||
//! \details The class inherits from the SummaryComparator class, which takes care of all file reading. \n The RegressionTest class compares the values from the two different files and throws exceptions when the deviation is unsatisfying.
|
||||
class RegressionTest: public SummaryComparator {
|
||||
private:
|
||||
//! \brief Gathers the correct data for comparison for a specific keyword
|
||||
//! \param[in] timeVec1 The time steps of file 1.
|
||||
//! \param[in] timeVec2 The time steps of file 2.
|
||||
//! \param[in] keyword The keyword of interest
|
||||
//! \details The function prepares a regression test by gathering the data, stroing it into two vectors, \n deciding which is to be used as a reference/basis and calling the test function.
|
||||
//! \return True if check passed, false otherwise.
|
||||
bool checkForKeyword(std::vector<double>& timeVec1, std::vector<double>& timeVec2, const char* keyword);
|
||||
|
||||
//! \brief The regression test
|
||||
//! \param[in] keyword The keyword common for both the files. The vectors associated with the keyword are used for comparison.
|
||||
//! \details Start test uses the private member variables, pointers of std::vector<double> type, which are set to point to the correct vectors in SummaryComparison::chooseReference(...). \n The function iterates over the referenceVev/basis and for each iteration it calculates the deviation with SummaryComparison::getDeviation(..) and stors it in a Deviation struct. \n SummaryComparison::getDeviation takes the int jvar as an reference input, and using it as an iterative index for the values which are to be compared with the basis. \n Thus, by updating the jvar variable every time a deviation is calculated, one keep track jvar and do not have to iterate over already checked values.
|
||||
bool startTest(const char* keyword);
|
||||
|
||||
//! \brief Caluculates a deviation, throws exceptions and writes and error message.
|
||||
//! \param[in] deviation Deviation struct
|
||||
//! \param[in] keyword The keyword that the data that are being compared belongs to.
|
||||
//! \param[in] refIndex The report step of which the deviation originates from in #referenceDataVec.
|
||||
//! \param[in] checkIndex The report step of which the deviation originates from in #checkDataVec.
|
||||
//! \details The function checks the values of the Deviation struct against the absolute and relative tolerance, which are private member values of the super class. \n When comparing against the relative tolerance an additional term is added, the absolute deviation has to be greater than 1e-6 for the function to throw an exception. \n When the deviations are too great, the function writes out which keyword, and at what report step the deviation is too great before optionally throwing an exception.
|
||||
//! \return True if check passed, false otherwise.
|
||||
bool checkDeviation(Deviation deviation, const char* keyword, int refIndex, int checkIndex);
|
||||
|
||||
bool isRestartFile = false; //!< Private member variable, when true the files that are being compared is a restart file vs a normal file
|
||||
public:
|
||||
//! \brief Constructor, creates an object of RefressionTest class.
|
||||
//! \param[in] basename1 Path to file1 without extension.
|
||||
//! \param[in] basename1 Path to file2 without extension.
|
||||
//! \param[in] relativeTol The relative tolerance which is to be used in the test.
|
||||
//! \param[in] absoluteTol The absolute tolerance which is to be used in the test.
|
||||
//! \details The constructor calls the constructor of the super class.
|
||||
RegressionTest(const char* basename1, const char* basename2, double relativeTol, double absoluteTol):
|
||||
SummaryComparator(basename1, basename2, relativeTol, absoluteTol) {}
|
||||
|
||||
//! \details The function executes a regression test for all the keywords. If the two files do not match in amount of keywords, an exception is thrown.
|
||||
void getRegressionTest();
|
||||
|
||||
//! \details The function executes a regression test for one specific keyword. If one or both of the files do not have the keyword, an exception is thrown.
|
||||
void getRegressionTest(const char* keyword);///< Regression test for a certain keyword of the files.
|
||||
|
||||
//! \brief This function sets the private member variable isRestartFiles
|
||||
//! \param[in] boolean Boolean value
|
||||
void setIsRestartFile(bool boolean){this->isRestartFile = boolean;}
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user