From 7d30a8408a0b5bd4b5094f826bdd3e2efa633b30 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Mon, 22 Oct 2018 10:37:16 +0200 Subject: [PATCH] flow: print the startup banner immediately also, add a "reading deck" output. The idea is to make `flow`'s behaviour less surprising by preventing people from thinking that nothing happens after starting `flow` for a large deck. --- flow/flow.cpp | 7 ++++-- opm/autodiff/FlowMainEbos.hpp | 41 +++++++++++++++-------------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/flow/flow.cpp b/flow/flow.cpp index fe32fa013..c497ebf65 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -134,13 +134,16 @@ int main(int argc, char** argv) deckFilename = PreVanguard::canonicalDeckPath(deckFilename).string(); } catch (const std::exception& e) { - Ewoms::Parameters::printUsage(PreProblem::helpPreamble(argc, const_cast(argv)), - e.what()); + std::cerr << "Exception received: " << e.what() << ". Try '--help' for a usage description.\n"; return 1; } + Opm::FlowMainEbos::printBanner(); + // Create Deck and EclipseState. try { + std::cout << "Reading deck file '" << deckFilename << "'\n"; + std::cout.flush(); Opm::Parser parser; typedef std::pair ParseModePair; typedef std::vector ParseModePairs; diff --git a/opm/autodiff/FlowMainEbos.hpp b/opm/autodiff/FlowMainEbos.hpp index eb93ad049..e6a3eca80 100755 --- a/opm/autodiff/FlowMainEbos.hpp +++ b/opm/autodiff/FlowMainEbos.hpp @@ -193,6 +193,24 @@ namespace Opm return status; } + static void printBanner() + { + const int lineLen = 70; + const std::string version = moduleVersionName(); + const std::string banner = "This is flow "+version; + const int bannerPreLen = (lineLen - 2 - banner.size())/2; + const int bannerPostLen = bannerPreLen + (lineLen - 2 - banner.size())%2; + std::cout << "**********************************************************************\n"; + std::cout << "* *\n"; + std::cout << "*" << std::string(bannerPreLen, ' ') << banner << std::string(bannerPostLen, ' ') << "*\n"; + std::cout << "* *\n"; + std::cout << "* Flow is a simulator for fully implicit three-phase black-oil flow, *\n"; + std::cout << "* including solvent and polymer capabilities. *\n"; + std::cout << "* For more information, see https://opm-project.org *\n"; + std::cout << "* *\n"; + std::cout << "**********************************************************************\n\n"; + } + /// This is the main function of Flow. It runs a complete simulation with the /// given grid and simulator classes, based on the user-specified command-line /// input. @@ -207,7 +225,6 @@ namespace Opm setupParallelism(); setupOutput(); - printStartupMessage(); setupEbosSimulator(); setupLogging(); printPRTHeader(); @@ -266,28 +283,6 @@ namespace Opm ThreadManager::init(); } - // Print startup message if on output rank. - void printStartupMessage() - { - - if (output_cout_) { - const int lineLen = 70; - const std::string version = moduleVersionName(); - const std::string banner = "This is flow "+version; - const int bannerPreLen = (lineLen - 2 - banner.size())/2; - const int bannerPostLen = bannerPreLen + (lineLen - 2 - banner.size())%2; - std::cout << "**********************************************************************\n"; - std::cout << "* *\n"; - std::cout << "*" << std::string(bannerPreLen, ' ') << banner << std::string(bannerPostLen, ' ') << "*\n"; - std::cout << "* *\n"; - std::cout << "* Flow is a simulator for fully implicit three-phase black-oil flow, *\n"; - std::cout << "* including solvent and polymer capabilities. *\n"; - std::cout << "* For more information, see https://opm-project.org *\n"; - std::cout << "* *\n"; - std::cout << "**********************************************************************\n\n"; - } - } - // Extract the minimum priority and determines if log files ought to be created. // Writes to: // output_to_files_