mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
Split out printStartupMessage() method.
This commit is contained in:
+41
-16
@@ -125,34 +125,20 @@ namespace Opm
|
||||
int execute(int argc, char** argv)
|
||||
try {
|
||||
setupParallelism(argc, argv);
|
||||
|
||||
if (output_cout_)
|
||||
{
|
||||
std::string version = moduleVersionName();
|
||||
std::cout << "**********************************************************************\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "* This is Flow (version " << version << ")"
|
||||
<< std::string(26 - version.size(), ' ') << "*\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "* Flow is a simulator for fully implicit three-phase black-oil flow, *\n";
|
||||
std::cout << "* and is part of OPM. For more information see: *\n";
|
||||
std::cout << "* http://opm-project.org *\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "**********************************************************************\n\n";
|
||||
}
|
||||
printStartupMessage();
|
||||
|
||||
// Read parameters, see if a deck was specified on the command line.
|
||||
if ( output_cout_ )
|
||||
{
|
||||
std::cout << "--------------- Reading parameters ---------------" << std::endl;
|
||||
}
|
||||
|
||||
parameter::ParameterGroup param(argc, argv, false, output_cout_);
|
||||
if( !output_cout_ )
|
||||
{
|
||||
param.disableOutput();
|
||||
}
|
||||
|
||||
|
||||
if (!param.unhandledArguments().empty()) {
|
||||
if (param.unhandledArguments().size() != 1) {
|
||||
std::cerr << "You can only specify a single input deck on the command line.\n";
|
||||
@@ -427,11 +413,27 @@ namespace Opm
|
||||
|
||||
// ------------ Data members ------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool output_cout_ = false;
|
||||
bool must_distribute_ = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------ Methods ------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Set up MPI and OpenMP.
|
||||
// Writes to:
|
||||
// output_cout_
|
||||
// must_distribute_
|
||||
void setupParallelism(int argc, char** argv)
|
||||
{
|
||||
// MPI setup.
|
||||
@@ -467,6 +469,29 @@ namespace Opm
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Print startup message if on output rank.
|
||||
void printStartupMessage()
|
||||
{
|
||||
if (output_cout_) {
|
||||
const std::string version = moduleVersionName();
|
||||
std::cout << "**********************************************************************\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "* This is Flow (version " << version << ")"
|
||||
<< std::string(26 - version.size(), ' ') << "*\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "* Flow is a simulator for fully implicit three-phase black-oil flow, *\n";
|
||||
std::cout << "* and is part of OPM. For more information see: *\n";
|
||||
std::cout << "* http://opm-project.org *\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "**********************************************************************\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}; // class FlowMain
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user