From d4ac98fb61e76148278a4c66a1dc1f92695cf7f2 Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Fri, 19 Feb 2016 09:31:49 +0800 Subject: [PATCH 1/2] use standard filename for output log file. --- examples/diagnose_relperm.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/examples/diagnose_relperm.cpp b/examples/diagnose_relperm.cpp index 1750ec6a1..acb533fbe 100644 --- a/examples/diagnose_relperm.cpp +++ b/examples/diagnose_relperm.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -76,20 +77,16 @@ try GridManager gm(deck); const UnstructuredGrid& grid = *gm.c_grid(); - bool output = true; - std::string output_dir; - - if (output) { - output_dir = "output"; - boost::filesystem::path fpath(output_dir); - try { - create_directories(fpath); - } - catch (...) { - OPM_THROW(std::runtime_error, "Creating directories failed: " << fpath); - } + using boost::filesystem::path; + path fpath(eclipseFilename); + std::string baseName; + if (boost::to_upper_copy(path(fpath.extension()).string())== ".DATA") { + baseName = path(fpath.stem()).string(); + } else { + baseName = path(fpath.filename()).string(); } - std::string logFile = output_dir + "/LOGFILE.txt"; + + std::string logFile = baseName + ".LOG"; Opm::time::StopWatch timer; timer.start(); RelpermDiagnostics diagnostic(logFile); From 215a3f24d4e638c64f521706d833d2a06a54f43d Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Wed, 2 Mar 2016 14:55:39 +0800 Subject: [PATCH 2/2] change .LOG to .SATFUNCLOG. --- examples/diagnose_relperm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/diagnose_relperm.cpp b/examples/diagnose_relperm.cpp index acb533fbe..a368d68f3 100644 --- a/examples/diagnose_relperm.cpp +++ b/examples/diagnose_relperm.cpp @@ -86,7 +86,7 @@ try baseName = path(fpath.filename()).string(); } - std::string logFile = baseName + ".LOG"; + std::string logFile = baseName + ".SATFUNCLOG"; Opm::time::StopWatch timer; timer.start(); RelpermDiagnostics diagnostic(logFile);