mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Setup logging before the simulator is initialized (#1980)
Setup logging before the simulator is initialized
This commit is contained in:
142
flow/flow.cpp
142
flow/flow.cpp
@@ -38,6 +38,10 @@
|
||||
#include <opm/simulators/flow/MissingFeatures.hpp>
|
||||
#include <opm/material/common/ResetLocale.hpp>
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
#include <opm/common/OpmLog/EclipsePRTLog.hpp>
|
||||
#include <opm/common/OpmLog/LogUtil.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
@@ -112,6 +116,115 @@ namespace detail
|
||||
|
||||
}
|
||||
|
||||
enum class FileOutputMode {
|
||||
//! \brief No output to files.
|
||||
OUTPUT_NONE = 0,
|
||||
//! \brief Output only to log files, no eclipse output.
|
||||
OUTPUT_LOG_ONLY = 1,
|
||||
//! \brief Output to all files.
|
||||
OUTPUT_ALL = 3
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Setup the OpmLog backends
|
||||
FileOutputMode setupLogging(int mpi_rank_, const std::string& deck_filename, const std::string& cmdline_output_dir, const std::string& cmdline_output, bool output_cout_, const std::string& stdout_log_id) {
|
||||
// create logFile
|
||||
using boost::filesystem::path;
|
||||
path fpath(deck_filename);
|
||||
std::string baseName;
|
||||
std::ostringstream debugFileStream;
|
||||
std::ostringstream logFileStream;
|
||||
|
||||
// Strip extension "." or ".DATA"
|
||||
std::string extension = boost::to_upper_copy(fpath.extension().string());
|
||||
if (extension == ".DATA" || extension == ".") {
|
||||
baseName = boost::to_upper_copy(fpath.stem().string());
|
||||
} else {
|
||||
baseName = boost::to_upper_copy(fpath.filename().string());
|
||||
}
|
||||
|
||||
std::string output_dir = cmdline_output_dir;
|
||||
if (output_dir.empty()) {
|
||||
output_dir = absolute(path(baseName).parent_path()).string();
|
||||
}
|
||||
|
||||
logFileStream << output_dir << "/" << baseName;
|
||||
debugFileStream << output_dir << "/" << baseName;
|
||||
|
||||
if (mpi_rank_ != 0) {
|
||||
// Added rank to log file for non-zero ranks.
|
||||
// This prevents message loss.
|
||||
debugFileStream << "." << mpi_rank_;
|
||||
// If the following file appears then there is a bug.
|
||||
logFileStream << "." << mpi_rank_;
|
||||
}
|
||||
logFileStream << ".PRT";
|
||||
debugFileStream << ".DBG";
|
||||
|
||||
FileOutputMode output;
|
||||
{
|
||||
static std::map<std::string, FileOutputMode> stringToOutputMode =
|
||||
{ {"none", FileOutputMode::OUTPUT_NONE },
|
||||
{"false", FileOutputMode::OUTPUT_LOG_ONLY },
|
||||
{"log", FileOutputMode::OUTPUT_LOG_ONLY },
|
||||
{"all" , FileOutputMode::OUTPUT_ALL },
|
||||
{"true" , FileOutputMode::OUTPUT_ALL }};
|
||||
auto outputModeIt = stringToOutputMode.find(cmdline_output);
|
||||
if (outputModeIt != stringToOutputMode.end()) {
|
||||
output = outputModeIt->second;
|
||||
}
|
||||
else {
|
||||
output = FileOutputMode::OUTPUT_ALL;
|
||||
std::cerr << "Value " << cmdline_output <<
|
||||
" is not a recognized output mode. Using \"all\" instead."
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (output > FileOutputMode::OUTPUT_NONE) {
|
||||
std::shared_ptr<Opm::EclipsePRTLog> prtLog = std::make_shared<Opm::EclipsePRTLog>(logFileStream.str(), Opm::Log::NoDebugMessageTypes, false, output_cout_);
|
||||
Opm::OpmLog::addBackend("ECLIPSEPRTLOG", prtLog);
|
||||
prtLog->setMessageLimiter(std::make_shared<Opm::MessageLimiter>());
|
||||
prtLog->setMessageFormatter(std::make_shared<Opm::SimpleMessageFormatter>(false));
|
||||
}
|
||||
|
||||
if (output >= FileOutputMode::OUTPUT_LOG_ONLY) {
|
||||
std::string debugFile = debugFileStream.str();
|
||||
std::shared_ptr<Opm::StreamLog> debugLog = std::make_shared<Opm::EclipsePRTLog>(debugFileStream.str(), Opm::Log::DefaultMessageTypes, false, output_cout_);
|
||||
Opm::OpmLog::addBackend("DEBUGLOG", debugLog);
|
||||
}
|
||||
|
||||
std::shared_ptr<Opm::StreamLog> streamLog = std::make_shared<Opm::StreamLog>(std::cout, Opm::Log::StdoutMessageTypes);
|
||||
Opm::OpmLog::addBackend(stdout_log_id, streamLog);
|
||||
streamLog->setMessageFormatter(std::make_shared<Opm::SimpleMessageFormatter>(true));
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void setupMessageLimiter(const Opm::MessageLimits msgLimits, const std::string& stdout_log_id) {
|
||||
std::shared_ptr<Opm::StreamLog> stream_log = Opm::OpmLog::getBackend<Opm::StreamLog>(stdout_log_id);
|
||||
|
||||
const std::map<int64_t, int> limits = {{Opm::Log::MessageType::Note,
|
||||
msgLimits.getCommentPrintLimit(0)},
|
||||
{Opm::Log::MessageType::Info,
|
||||
msgLimits.getMessagePrintLimit(0)},
|
||||
{Opm::Log::MessageType::Warning,
|
||||
msgLimits.getWarningPrintLimit(0)},
|
||||
{Opm::Log::MessageType::Error,
|
||||
msgLimits.getErrorPrintLimit(0)},
|
||||
{Opm::Log::MessageType::Problem,
|
||||
msgLimits.getProblemPrintLimit(0)},
|
||||
{Opm::Log::MessageType::Bug,
|
||||
msgLimits.getBugPrintLimit(0)}};
|
||||
stream_log->setMessageLimiter(std::make_shared<Opm::MessageLimiter>(10, limits));
|
||||
}
|
||||
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
@@ -146,7 +259,6 @@ int main(int argc, char** argv)
|
||||
typedef GET_PROP_TYPE(PreTypeTag, Problem) PreProblem;
|
||||
|
||||
PreProblem::setBriefDescription("Flow, an advanced reservoir simulator for ECL-decks provided by the Open Porous Media project.");
|
||||
|
||||
int status = Opm::FlowMainEbos<PreTypeTag>::setupParameters_(argc, argv);
|
||||
if (status != 0)
|
||||
// if setupParameters_ returns a value smaller than 0, there was no error, but
|
||||
@@ -154,6 +266,7 @@ int main(int argc, char** argv)
|
||||
// --print-properties parameters.
|
||||
return (status >= 0)?status:0;
|
||||
|
||||
FileOutputMode outputMode = FileOutputMode::OUTPUT_NONE;
|
||||
bool outputCout = false;
|
||||
if (mpiRank == 0)
|
||||
outputCout = EWOMS_GET_PARAM(PreTypeTag, bool, EnableTerminalOutput);
|
||||
@@ -190,6 +303,11 @@ int main(int argc, char** argv)
|
||||
Opm::Parser parser;
|
||||
Opm::ParseContext parseContext;
|
||||
Opm::ErrorGuard errorGuard;
|
||||
outputMode = setupLogging(mpiRank,
|
||||
deckFilename,
|
||||
EWOMS_GET_PARAM(PreTypeTag, std::string, OutputDir),
|
||||
EWOMS_GET_PARAM(PreTypeTag, std::string, OutputMode),
|
||||
outputCout, "STDOUT_LOGGER");
|
||||
|
||||
if (EWOMS_GET_PARAM(PreTypeTag, bool, EclStrictParsing))
|
||||
parseContext.update( Opm::InputError::DELAYED_EXIT1);
|
||||
@@ -202,13 +320,13 @@ int main(int argc, char** argv)
|
||||
|
||||
deck.reset( new Opm::Deck( parser.parseFile(deckFilename , parseContext, errorGuard)));
|
||||
Opm::MissingFeatures::checkKeywords(*deck, parseContext, errorGuard);
|
||||
|
||||
if ( outputCout )
|
||||
Opm::checkDeck(*deck, parser, parseContext, errorGuard);
|
||||
|
||||
eclipseState.reset( new Opm::EclipseState(*deck, parseContext, errorGuard ));
|
||||
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard));
|
||||
summaryConfig.reset( new Opm::SummaryConfig(*deck, *schedule, eclipseState->getTableManager(), parseContext, errorGuard));
|
||||
setupMessageLimiter(schedule->getMessageLimits(), "STDOUT_LOGGER");
|
||||
|
||||
Opm::checkConsistentArrayDimensions(*eclipseState, *schedule, parseContext, errorGuard);
|
||||
|
||||
@@ -220,7 +338,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
const auto& phases = Opm::Runspec(*deck).phases();
|
||||
|
||||
bool outputFiles = (outputMode != FileOutputMode::OUTPUT_NONE);
|
||||
// run the actual simulator
|
||||
//
|
||||
// TODO: make sure that no illegal combinations like thermal and twophase are
|
||||
@@ -232,13 +350,13 @@ int main(int argc, char** argv)
|
||||
if (phases.active( Opm::Phase::GAS ))
|
||||
{
|
||||
Opm::flowEbosGasOilSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig);
|
||||
return Opm::flowEbosGasOilMain(argc, argv);
|
||||
return Opm::flowEbosGasOilMain(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
// oil-water
|
||||
else if ( phases.active( Opm::Phase::WATER ) )
|
||||
{
|
||||
Opm::flowEbosOilWaterSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig);
|
||||
return Opm::flowEbosOilWaterMain(argc, argv);
|
||||
return Opm::flowEbosOilWaterMain(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
else {
|
||||
if (outputCout)
|
||||
@@ -261,36 +379,36 @@ int main(int argc, char** argv)
|
||||
if ( phases.active( Opm::Phase::POLYMW ) ) {
|
||||
// only oil water two phase for now
|
||||
assert( phases.size() == 4);
|
||||
return Opm::flowEbosOilWaterPolymerInjectivityMain(argc, argv);
|
||||
return Opm::flowEbosOilWaterPolymerInjectivityMain(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
if ( phases.size() == 3 ) { // oil water polymer case
|
||||
Opm::flowEbosOilWaterPolymerSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig);
|
||||
return Opm::flowEbosOilWaterPolymerMain(argc, argv);
|
||||
return Opm::flowEbosOilWaterPolymerMain(argc, argv, outputCout, outputFiles);
|
||||
} else {
|
||||
Opm::flowEbosPolymerSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig);
|
||||
return Opm::flowEbosPolymerMain(argc, argv);
|
||||
return Opm::flowEbosPolymerMain(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
}
|
||||
// Foam case
|
||||
else if ( phases.active( Opm::Phase::FOAM ) ) {
|
||||
Opm::flowEbosFoamSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig);
|
||||
return Opm::flowEbosFoamMain(argc, argv);
|
||||
return Opm::flowEbosFoamMain(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
// Solvent case
|
||||
else if ( phases.active( Opm::Phase::SOLVENT ) ) {
|
||||
Opm::flowEbosSolventSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig);
|
||||
return Opm::flowEbosSolventMain(argc, argv);
|
||||
return Opm::flowEbosSolventMain(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
// Energy case
|
||||
else if (eclipseState->getSimulationConfig().isThermal()) {
|
||||
Opm::flowEbosEnergySetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig);
|
||||
return Opm::flowEbosEnergyMain(argc, argv);
|
||||
return Opm::flowEbosEnergyMain(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
// Blackoil case
|
||||
else if( phases.size() == 3 ) {
|
||||
Opm::flowEbosBlackoilSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig);
|
||||
return Opm::flowEbosBlackoilMain(argc, argv);
|
||||
return Opm::flowEbosBlackoilMain(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -99,5 +99,7 @@ namespace Ewoms {
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
typedef TTAG(EclFlowProblemSimple) TypeTag;
|
||||
return mainFlow<TypeTag>(argc, argv);
|
||||
bool outputCout = true;
|
||||
bool outputFiles = true;
|
||||
return mainFlow<TypeTag>(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ void flowEbosBlackoilSetDeck(double setupTime, Deck &deck, EclipseState& eclStat
|
||||
}
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int flowEbosBlackoilMain(int argc, char** argv)
|
||||
int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// we always want to use the default locale, and thus spare us the trouble
|
||||
// with incorrect locale settings.
|
||||
@@ -60,7 +60,7 @@ int flowEbosBlackoilMain(int argc, char** argv)
|
||||
#endif
|
||||
|
||||
Opm::FlowMainEbos<TTAG(EclFlowProblem)> mainfunc;
|
||||
return mainfunc.execute(argc, argv);
|
||||
return mainfunc.execute(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
namespace Opm {
|
||||
void flowEbosBlackoilSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
|
||||
int flowEbosBlackoilMain(int argc, char** argv);
|
||||
int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles);
|
||||
}
|
||||
|
||||
#endif // FLOW_EBOS_BLACKOIL_HPP
|
||||
|
||||
@@ -49,7 +49,7 @@ void flowEbosEnergySetDeck(double setupTime, Deck &deck, EclipseState& eclState,
|
||||
}
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int flowEbosEnergyMain(int argc, char** argv)
|
||||
int flowEbosEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// we always want to use the default locale, and thus spare us the trouble
|
||||
// with incorrect locale settings.
|
||||
@@ -63,7 +63,7 @@ int flowEbosEnergyMain(int argc, char** argv)
|
||||
#endif
|
||||
|
||||
Opm::FlowMainEbos<TTAG(EclFlowEnergyProblem)> mainfunc;
|
||||
return mainfunc.execute(argc, argv);
|
||||
return mainfunc.execute(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
namespace Opm {
|
||||
void flowEbosEnergySetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
|
||||
int flowEbosEnergyMain(int argc, char** argv);
|
||||
int flowEbosEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles);
|
||||
}
|
||||
|
||||
#endif // FLOW_EBOS_ENERGY_HPP
|
||||
|
||||
@@ -50,7 +50,7 @@ void flowEbosFoamSetDeck(double setupTime, Deck &deck, EclipseState& eclState, S
|
||||
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int flowEbosFoamMain(int argc, char** argv)
|
||||
int flowEbosFoamMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// we always want to use the default locale, and thus spare us the trouble
|
||||
// with incorrect locale settings.
|
||||
@@ -64,7 +64,7 @@ int flowEbosFoamMain(int argc, char** argv)
|
||||
#endif
|
||||
|
||||
Opm::FlowMainEbos<TTAG(EclFlowFoamProblem)> mainfunc;
|
||||
return mainfunc.execute(argc, argv);
|
||||
return mainfunc.execute(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
namespace Opm {
|
||||
void flowEbosFoamSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
|
||||
int flowEbosFoamMain(int argc, char** argv);
|
||||
int flowEbosFoamMain(int argc, char** argv, bool outputCout, bool outputFiles);
|
||||
}
|
||||
|
||||
#endif // FLOW_EBOS_FOAM_HPP
|
||||
|
||||
@@ -73,7 +73,7 @@ void flowEbosGasOilSetDeck(double setupTime, Deck &deck, EclipseState& eclState,
|
||||
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int flowEbosGasOilMain(int argc, char** argv)
|
||||
int flowEbosGasOilMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// we always want to use the default locale, and thus spare us the trouble
|
||||
// with incorrect locale settings.
|
||||
@@ -86,7 +86,7 @@ int flowEbosGasOilMain(int argc, char** argv)
|
||||
#endif
|
||||
|
||||
Opm::FlowMainEbos<TTAG(EclFlowGasOilProblem)> mainfunc;
|
||||
return mainfunc.execute(argc, argv);
|
||||
return mainfunc.execute(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
namespace Opm {
|
||||
void flowEbosGasOilSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
|
||||
int flowEbosGasOilMain(int argc, char** argv);
|
||||
int flowEbosGasOilMain(int argc, char** argv, bool outputCout, bool outputFiles);
|
||||
}
|
||||
|
||||
#endif // FLOW_EBOS_GASOIL_HPP
|
||||
|
||||
@@ -72,7 +72,7 @@ void flowEbosOilWaterSetDeck(double setupTime, Deck &deck, EclipseState& eclStat
|
||||
}
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int flowEbosOilWaterMain(int argc, char** argv)
|
||||
int flowEbosOilWaterMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// we always want to use the default locale, and thus spare us the trouble
|
||||
// with incorrect locale settings.
|
||||
@@ -85,7 +85,7 @@ int flowEbosOilWaterMain(int argc, char** argv)
|
||||
#endif
|
||||
|
||||
Opm::FlowMainEbos<TTAG(EclFlowOilWaterProblem)> mainfunc;
|
||||
return mainfunc.execute(argc, argv);
|
||||
return mainfunc.execute(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
namespace Opm {
|
||||
void flowEbosOilWaterSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
|
||||
int flowEbosOilWaterMain(int argc, char** argv);
|
||||
int flowEbosOilWaterMain(int argc, char** argv, bool outputCout, bool outputFiles);
|
||||
}
|
||||
|
||||
#endif // FLOW_EBOS_OILWATER_HPP
|
||||
|
||||
@@ -73,7 +73,7 @@ void flowEbosOilWaterPolymerSetDeck(double setupTime, Deck& deck, EclipseState&
|
||||
}
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int flowEbosOilWaterPolymerMain(int argc, char** argv)
|
||||
int flowEbosOilWaterPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// we always want to use the default locale, and thus spare us the trouble
|
||||
// with incorrect locale settings.
|
||||
@@ -86,7 +86,7 @@ int flowEbosOilWaterPolymerMain(int argc, char** argv)
|
||||
#endif
|
||||
|
||||
Opm::FlowMainEbos<TTAG(EclFlowOilWaterPolymerProblem)> mainfunc;
|
||||
return mainfunc.execute(argc, argv);
|
||||
return mainfunc.execute(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
namespace Opm {
|
||||
void flowEbosOilWaterPolymerSetDeck(double setupTime, Deck& deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
|
||||
int flowEbosOilWaterPolymerMain(int argc, char** argv);
|
||||
int flowEbosOilWaterPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles);
|
||||
}
|
||||
|
||||
#endif // FLOW_EBOS_OILWATER_POLYMER_HPP
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Opm {
|
||||
} */
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int flowEbosOilWaterPolymerInjectivityMain(int argc, char** argv)
|
||||
int flowEbosOilWaterPolymerInjectivityMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// we always want to use the default locale, and thus spare us the trouble
|
||||
// with incorrect locale settings.
|
||||
@@ -84,8 +84,7 @@ int flowEbosOilWaterPolymerInjectivityMain(int argc, char** argv)
|
||||
#endif
|
||||
|
||||
Opm::FlowMainEbos<TTAG(EclFlowOilWaterPolymerInjectivityProblem)> mainfunc;
|
||||
|
||||
return mainfunc.execute(argc, argv);
|
||||
return mainfunc.execute(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
namespace Opm {
|
||||
// void flowEbosOilWaterPolymerInjectivitySetDeck(Deck& deck, EclipseState& eclState);
|
||||
int flowEbosOilWaterPolymerInjectivityMain(int argc, char** argv);
|
||||
int flowEbosOilWaterPolymerInjectivityMain(int argc, char** argv, bool outputCout, bool outputFiles);
|
||||
}
|
||||
|
||||
#endif // FLOW_EBOS_OILWATER_POLYMER_INJECTIVITY_HPP
|
||||
|
||||
@@ -49,7 +49,7 @@ void flowEbosPolymerSetDeck(double setupTime, Deck &deck, EclipseState& eclState
|
||||
}
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int flowEbosPolymerMain(int argc, char** argv)
|
||||
int flowEbosPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// we always want to use the default locale, and thus spare us the trouble
|
||||
// with incorrect locale settings.
|
||||
@@ -63,7 +63,7 @@ int flowEbosPolymerMain(int argc, char** argv)
|
||||
#endif
|
||||
|
||||
Opm::FlowMainEbos<TTAG(EclFlowPolymerProblem)> mainfunc;
|
||||
return mainfunc.execute(argc, argv);
|
||||
return mainfunc.execute(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
namespace Opm {
|
||||
void flowEbosPolymerSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
|
||||
int flowEbosPolymerMain(int argc, char** argv);
|
||||
int flowEbosPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles);
|
||||
}
|
||||
|
||||
#endif // FLOW_EBOS_POLYMER_HPP
|
||||
|
||||
@@ -50,7 +50,7 @@ void flowEbosSolventSetDeck(double setupTime, Deck &deck, EclipseState& eclState
|
||||
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int flowEbosSolventMain(int argc, char** argv)
|
||||
int flowEbosSolventMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// we always want to use the default locale, and thus spare us the trouble
|
||||
// with incorrect locale settings.
|
||||
@@ -64,7 +64,7 @@ int flowEbosSolventMain(int argc, char** argv)
|
||||
#endif
|
||||
|
||||
Opm::FlowMainEbos<TTAG(EclFlowSolventProblem)> mainfunc;
|
||||
return mainfunc.execute(argc, argv);
|
||||
return mainfunc.execute(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
namespace Opm {
|
||||
void flowEbosSolventSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
|
||||
int flowEbosSolventMain(int argc, char** argv);
|
||||
int flowEbosSolventMain(int argc, char** argv, bool outoutCout, bool outputFiles);
|
||||
}
|
||||
|
||||
#endif // FLOW_EBOS_SOLVENT_HPP
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Opm {
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
template <class TypeTag>
|
||||
int flowEbosMain(int argc, char** argv)
|
||||
int flowEbosMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// we always want to use the default locale, and thus spare us the trouble
|
||||
// with incorrect locale settings.
|
||||
@@ -81,7 +81,7 @@ namespace Opm {
|
||||
Dune::MPIHelper::instance(argc, argv);
|
||||
#endif
|
||||
Opm::FlowMainEbos<TypeTag> mainfunc;
|
||||
return mainfunc.execute(argc, argv);
|
||||
return mainfunc.execute(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -123,7 +123,7 @@ namespace detail
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
template<class TypeTag>
|
||||
int mainFlow(int argc, char** argv)
|
||||
int mainFlow(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
// MPI setup.
|
||||
#if HAVE_DUNE_FEM
|
||||
@@ -160,7 +160,6 @@ int mainFlow(int argc, char** argv)
|
||||
// --print-properties parameters.
|
||||
return (status >= 0)?status:0;
|
||||
|
||||
bool outputCout = false;
|
||||
if (mpiRank == 0)
|
||||
outputCout = EWOMS_GET_PARAM(PreTypeTag, bool, EnableTerminalOutput);
|
||||
|
||||
@@ -198,7 +197,7 @@ int mainFlow(int argc, char** argv)
|
||||
|
||||
std::shared_ptr<Opm::EclipseState> eclipseState = std::make_shared< Opm::EclipseState > ( *deck, parseContext, errorGuard );
|
||||
Opm::flowEbosSetDeck<TypeTag>(*deck, *eclipseState);
|
||||
return Opm::flowEbosMain<TypeTag>(argc, argv);
|
||||
return Opm::flowEbosMain<TypeTag>(argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
catch (const std::invalid_argument& e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user