23#ifndef OPM_MAIN_HEADER_INCLUDED
24#define OPM_MAIN_HEADER_INCLUDED
26#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
31#include <opm/simulators/flow/Banners.hpp>
32#include <opm/simulators/flow/FlowMain.hpp>
36#include <dune/fem/misc/mpimanager.hh>
38#include <dune/common/parallel/mpihelper.hh>
42#include <opm/simulators/utils/ParallelEclipseState.hpp>
46#include <opm/simulators/linalg/gpuistl/device_management.hpp>
50#include <opm/simulators/utils/DamarisKeywords.hpp>
65namespace Opm::Properties {
71 using InheritsFrom = std::tuple<FlowProblem>;
79namespace Action {
class State; }
84template <
class TypeTag>
113 std::shared_ptr<EclipseState> eclipseState,
114 std::shared_ptr<Schedule> schedule,
115 std::shared_ptr<SummaryConfig> summaryConfig,
121 void setArgvArgc_(
const std::string&
filename);
122 void maybeSaveReservoirCouplingSlaveLogFilename_();
123 void maybeRedirectReservoirCouplingSlaveOutput_();
137 if (isSimulationRank_) {
138 return this->dispatchDynamic_();
152 template <
class TypeTag>
157 if (isSimulationRank_) {
181 template <
class TypeTagEarlyBird>
202 PreProblem::setBriefDescription(
"Flow, an advanced reservoir simulator for ECL-decks provided by the Open Porous Media project.");
216 OpmLog::setDebugVerbosityLevel(Parameters::Get<Parameters::DebugVerbosityLevel>());
219 std::string outputDir;
220 if ( eclipseState_ ) {
221 deckFilename = eclipseState_->getIOConfig().fullBasePath();
222 outputDir = eclipseState_->getIOConfig().getOutputDir();
225 deckFilename = Parameters::Get<Parameters::EclDeckFileName>();
226 outputDir = Parameters::Get<Parameters::OutputDir>();
230 enableDamarisOutput_ = Parameters::Get<Parameters::EnableDamarisOutput>();
235 msg =
"\nUse of Damaris (command line argument --enable-damaris-output=true) has been disabled for run with only one rank.\n" ;
236 OpmLog::warning(
msg);
237 enableDamarisOutput_ =
false ;
240 if (enableDamarisOutput_) {
243 if (outputDir.empty()) {
258 if (!isSimulationRank_) {
266 outputCout_ = Parameters::Get<Parameters::EnableTerminalOutput>();
270 std::cerr <<
"No input case given. Try '--help' for a usage description.\n";
280 catch (
const std::exception&
e) {
281 if ( mpiRank == 0 ) {
282 std::cerr <<
"Exception received: " <<
e.what() <<
". Try '--help' for a usage description.\n";
296 std::ostringstream
str;
297 Parameters::printValues(
str);
305 Parameters::Get<Parameters::OutputMode>(),
306 !Parameters::Get<Parameters::SchedRestart>(),
307 Parameters::Get<Parameters::EnableLoggingFalloutWarning>(),
308 Parameters::Get<Parameters::ParsingStrictness>(),
309 Parameters::Get<Parameters::ActionParsingStrictness>(),
310 Parameters::Get<Parameters::InputSkipMode>(),
313 Parameters::Get<Parameters::EclOutputInterval>(),
314 Parameters::Get<Parameters::Slave>(),
320 catch (
const std::invalid_argument&
e)
323 std::cerr <<
"Failed to create valid EclipseState object." << std::endl;
324 std::cerr <<
"Exception caught: " <<
e.what() << std::endl;
334 Opm::gpuistl::printDevice();
341 void setupVanguard();
351 void handleVersionCmdLine_(
int argc,
char**
argv,
360 void handleTestSplitCommunicatorCmdLine_();
367 int dispatchDynamic_();
377 template <
class TypeTag>
378 int dispatchStatic_()
380 this->setupVanguard();
476 int runExtendedBlackOil();
496 const std::string& outputDir,
511 static int getNumThreads()
526 char** argv_{
nullptr};
527 bool outputCout_{
false};
528 bool outputFiles_{
false};
532 double setupTime_{0.0};
533 std::string deckFilename_{};
534 std::string flowProgName_{};
535 char *saveArgs_[3]{
nullptr};
536 std::unique_ptr<UDQState> udqState_{};
537 std::unique_ptr<Action::State> actionState_{};
538 std::unique_ptr<WellTestState> wtestState_{};
541 std::shared_ptr<EclipseState> eclipseState_{};
542 std::shared_ptr<Schedule> schedule_{};
543 std::shared_ptr<SummaryConfig> summaryConfig_{};
544 bool mpi_init_{
true};
545 bool mpi_finalize_{
true};
548 bool test_split_comm_ =
false;
549 bool isSimulationRank_ =
true;
554 bool enableDamarisOutput_ =
false;
This problem simulates an input file given in the data format used by the commercial ECLiPSE simulato...
static Parallel::Communication & comm()
Obtain global communicator.
Definition FlowGenericVanguard.hpp:336
Definition FlowMain.hpp:69
int justInitialize()
Used for test_outputdir.
Definition Main.hpp:166
bool initialize_(int &exitCode, bool keepKeywords=false)
Initialize.
Definition Main.hpp:182
int runDynamic()
Run simulation.
Definition Main.hpp:132
int runStatic()
Run simulation.
Definition Main.hpp:153
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
std::string moduleVersionName()
Return the version name of the module, for example "2015.10" (for a release branch) or "2016....
Definition moduleVersion.cpp:34
std::string compileTimestamp()
Return a string "dd-mm-yyyy at HH::MM::SS hrs" which is the time the binary was compiled.
Definition moduleVersion.cpp:57
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
std::string moduleVersion()
Return a string containing both the name and hash, if N is the name and H is the hash it will be "N (...
Definition moduleVersion.cpp:50
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition propertysystem.hh:233
This file provides the infrastructure to retrieve run-time parameters.
The Opm property system, traits with inheritance.