diff --git a/examples/test_util/EclFilesComparator.cpp b/examples/test_util/EclFilesComparator.cpp index 91268d64b..435c5b104 100644 --- a/examples/test_util/EclFilesComparator.cpp +++ b/examples/test_util/EclFilesComparator.cpp @@ -288,6 +288,19 @@ double ECLFilesComparator::average(const std::vector& vec) { +double ECLFilesComparator::getCellVolume(const ecl_grid_type* ecl_grid, + const int globalIndex) { + std::vector x(8, 0.0); + std::vector y(8, 0.0); + std::vector z(8, 0.0); + for (int i = 0; i < 8; i++) { + ecl_grid_get_cell_corner_xyz1(ecl_grid, globalIndex, i, &x.data()[i], &y.data()[i], &z.data()[i]); + } + return calculateCellVol(x,y,z); +} + + + void ECLRegressionTest::printResultsForKeyword(const std::string& keyword) const { std::cout << "Deviation results for keyword " << keyword << " of type " << ecl_type_get_name(ecl_file_iget_named_data_type(ecl_file1, keyword.c_str(), 0)) @@ -417,20 +430,6 @@ void ECLRegressionTest::deviationsForCell(double val1, double val2, -namespace { - double getCellVolume(const ecl_grid_type* ecl_grid, const int globalIndex) { - std::vector x(8, 0.0); - std::vector y(8, 0.0); - std::vector z(8, 0.0); - for (int i = 0; i < 8; i++) { - ecl_grid_get_cell_corner_xyz1(ecl_grid, globalIndex, i, &x.data()[i], &y.data()[i], &z.data()[i]); - } - return calculateCellVol(x,y,z); - } -} - - - void ECLRegressionTest::gridCompare(const bool volumecheck) const { double absTolerance = getAbsTolerance(); double relTolerance = getRelTolerance(); diff --git a/examples/test_util/EclFilesComparator.hpp b/examples/test_util/EclFilesComparator.hpp index 1306a75e0..536253a6d 100644 --- a/examples/test_util/EclFilesComparator.hpp +++ b/examples/test_util/EclFilesComparator.hpp @@ -129,6 +129,8 @@ class ECLFilesComparator { //! \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& vec); + //! \brief Obtain the volume of a cell. + static double getCellVolume(const ecl_grid_type* ecl_grid, const int globalIndex); };