mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Using only relative differences when comparing.
This commit is contained in:
@@ -42,11 +42,10 @@ BOOST_AUTO_TEST_CASE(CompareRestartFileResults)
|
||||
const std::string& filename1 = boost::unit_test::framework::master_test_suite().argv[1];
|
||||
const std::string& filename2 = boost::unit_test::framework::master_test_suite().argv[2];
|
||||
int last_report_step = std::atoi(boost::unit_test::framework::master_test_suite().argv[3]);
|
||||
const double abs_diff = 1e-3;
|
||||
const double abs_diff = 0; // An absoulute value of 0 means that *only* the relative difference is used in the comparison.
|
||||
std::map<std::string, double> relative_diffs;
|
||||
relative_diffs["SWAT"] = 0.0005; //0.05 %
|
||||
relative_diffs["SGAS"] = 0.0005;
|
||||
|
||||
relative_diffs["SGAS"] = 0.0010;
|
||||
relative_diffs["RS"] = 0.0001; //0.01 %
|
||||
relative_diffs["RV"] = 0.0001;
|
||||
relative_diffs["PRESSURE"] = 0.0001;
|
||||
@@ -69,7 +68,7 @@ BOOST_AUTO_TEST_CASE(CompareRestartFileResults)
|
||||
ecl_kw_type * kw_1 = ecl_file_iget_named_kw( file1 , key , 0);
|
||||
ecl_kw_type * kw_2 = ecl_file_iget_named_kw( file2 , key , 0);
|
||||
|
||||
bool numeric_equal = ecl_kw_numeric_equal(kw_1, kw_2, abs_diff , relative_diffs[key]);
|
||||
bool numeric_equal = ecl_kw_numeric_equal(kw_1, kw_2, abs_diff , relative_diffs[key]);
|
||||
if (numeric_equal) {
|
||||
std::cout << " Restart results for " << key << " compared ok" << std::endl;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user