adding new file type RSM to compareECL

When using -t SMRY  the RSM file is not checked
When using -t RSM   the SMRY files is not checked

when running without -t option both RSM and SMRY files are checked together with restart, grid, init and rft file.
This commit is contained in:
Torbjørn Skille 2022-10-04 08:51:22 +02:00
parent 16af572080
commit cc6769c1a2
3 changed files with 28 additions and 6 deletions

View File

@ -889,7 +889,7 @@ void ECLRegressionTest::results_smry()
ESmry smry2(fileName2, loadBaseRunData); ESmry smry2(fileName2, loadBaseRunData);
smry2.loadData(); smry2.loadData();
std::cout << "\nLoading summary file " << fileName2 << " .... done" << std::endl; std::cout << "Loading summary file " << fileName2 << " .... done" << std::endl;
deviations.clear(); deviations.clear();
@ -999,25 +999,42 @@ void ECLRegressionTest::results_smry()
} }
} }
} else {
std::cout << "\n!Warning, summary files not found, hence not compared. \n" << std::endl;
}
}
void ECLRegressionTest::results_rsm()
{
std::string fileName1,fileName2;
bool foundRsm2 = checkFileName(rootName2, "RSM", fileName2);
bool foundSmspec1 = checkFileName(rootName1, "SMSPEC", fileName1);
if ((foundRsm2) && (foundSmspec1)) {
ESmry smry2(fileName1, loadBaseRunData);
smry2.loadData();
std::cout << "\nLoading summary file " << fileName1 << " .... done" << std::endl;
namespace fs = std::filesystem; namespace fs = std::filesystem;
std::string rsm_file = rootName2 + ".RSM"; std::string rsm_file = rootName2 + ".RSM";
if (fs::is_regular_file(fs::path(rsm_file))) { if (fs::is_regular_file(fs::path(rsm_file))) {
std::cout << "\nLoading RSM file " << rsm_file << " .... " << std::flush; std::cout << "\nLoading RSM file " << rsm_file << " .... " << std::flush;
auto rsm = ERsm(rsm_file); auto rsm = ERsm(rsm_file);
std::cout << " done " << std::endl << std::flush;; std::cout << " done " << std::endl << std::flush;;
std::cout << "\nComparing RSM file against SMRY file .... " << std::flush; std::cout << "\nComparing RSM file against SMRY file .... " << std::flush;
if (!cmp(smry2, rsm)) if (!cmp(smry2, rsm))
HANDLE_ERROR(std::runtime_error, "The RSM file did not compare equal to the summary file"); HANDLE_ERROR(std::runtime_error, "The RSM file did not compare equal to the summary file");
std::cout << " done " << std::endl << std::flush;; std::cout << " done " << std::endl << std::flush;;
} }
} else { } else {
std::cout << "\n!Warning, summary files not found, hence not compared. \n" << std::endl; std::cout << "\n!Warning, summary and/or RSM - file not found, hence not compared. \n" << std::endl;
} }
} }

View File

@ -98,6 +98,7 @@ public:
void results_rst(); void results_rst();
void results_init(); void results_init();
void results_smry(); void results_smry();
void results_rsm();
void results_rft(); void results_rft();
private: private:

View File

@ -49,6 +49,7 @@ static void printHelp() {
<< " -t INIT \t Compare two initial files (.INIT).\n" << " -t INIT \t Compare two initial files (.INIT).\n"
<< " -t RFT \t Compare two RFT files (.RFT).\n" << " -t RFT \t Compare two RFT files (.RFT).\n"
<< " -t SMRY \t Compare two cases consistent of (unified) summary files.\n" << " -t SMRY \t Compare two cases consistent of (unified) summary files.\n"
<< " -t RSM \t Compare RSM file agaist a summary file.\n"
<< "-x Allow extra keywords in case number 2. These additional keywords (not found in case number1) will be ignored in the comparison.\n" << "-x Allow extra keywords in case number 2. These additional keywords (not found in case number1) will be ignored in the comparison.\n"
<< "\nExample usage of the program: \n\n" << "\nExample usage of the program: \n\n"
<< "compareECL -k PRESSURE <path to first casefile> <path to second casefile> 1e-3 1e-5\n" << "compareECL -k PRESSURE <path to first casefile> <path to second casefile> 1e-3 1e-5\n"
@ -229,6 +230,8 @@ int main(int argc, char** argv) {
comparator.results_rst(); comparator.results_rst();
} else if (fileTypeString == "SMRY") { } else if (fileTypeString == "SMRY") {
comparator.results_smry(); comparator.results_smry();
} else if (fileTypeString == "RSM") {
comparator.results_rsm();
} else if (fileTypeString == "RFT") { } else if (fileTypeString == "RFT") {
comparator.results_rft(); comparator.results_rft();
} else { } else {
@ -244,6 +247,7 @@ int main(int argc, char** argv) {
comparator.results_init(); comparator.results_init();
comparator.results_rst(); comparator.results_rst();
comparator.results_smry(); comparator.results_smry();
comparator.results_rsm();
comparator.results_rft(); comparator.results_rft();
} }