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.");
217 std::string outputDir;
218 if ( eclipseState_ ) {
219 deckFilename = eclipseState_->getIOConfig().fullBasePath();
220 outputDir = eclipseState_->getIOConfig().getOutputDir();
223 deckFilename = Parameters::Get<Parameters::EclDeckFileName>();
224 outputDir = Parameters::Get<Parameters::OutputDir>();
228 enableDamarisOutput_ = Parameters::Get<Parameters::EnableDamarisOutput>();
233 msg =
"\nUse of Damaris (command line argument --enable-damaris-output=true) has been disabled for run with only one rank.\n" ;
234 OpmLog::warning(
msg);
235 enableDamarisOutput_ =
false ;
238 if (enableDamarisOutput_) {
241 if (outputDir.empty()) {
256 if (!isSimulationRank_) {
264 outputCout_ = Parameters::Get<Parameters::EnableTerminalOutput>();
268 std::cerr <<
"No input case given. Try '--help' for a usage description.\n";
278 catch (
const std::exception&
e) {
279 if ( mpiRank == 0 ) {
280 std::cerr <<
"Exception received: " <<
e.what() <<
". Try '--help' for a usage description.\n";
294 std::ostringstream
str;
295 Parameters::printValues(
str);
303 Parameters::Get<Parameters::OutputMode>(),
304 !Parameters::Get<Parameters::SchedRestart>(),
305 Parameters::Get<Parameters::EnableLoggingFalloutWarning>(),
306 Parameters::Get<Parameters::ParsingStrictness>(),
307 Parameters::Get<Parameters::ActionParsingStrictness>(),
308 Parameters::Get<Parameters::InputSkipMode>(),
311 Parameters::Get<Parameters::EclOutputInterval>(),
312 Parameters::Get<Parameters::Slave>(),
318 catch (
const std::invalid_argument&
e)
321 std::cerr <<
"Failed to create valid EclipseState object." << std::endl;
322 std::cerr <<
"Exception caught: " <<
e.what() << std::endl;
332 Opm::gpuistl::printDevice();
339 void setupVanguard();
349 void handleVersionCmdLine_(
int argc,
char**
argv,
358 void handleTestSplitCommunicatorCmdLine_();
365 int dispatchDynamic_();
375 template <
class TypeTag>
376 int dispatchStatic_()
378 this->setupVanguard();
464 int runExtendedBlackOil();
484 const std::string& outputDir,
499 static int getNumThreads()
514 char** argv_{
nullptr};
515 bool outputCout_{
false};
516 bool outputFiles_{
false};
520 double setupTime_{0.0};
521 std::string deckFilename_{};
522 std::string flowProgName_{};
523 char *saveArgs_[3]{
nullptr};
524 std::unique_ptr<UDQState> udqState_{};
525 std::unique_ptr<Action::State> actionState_{};
526 std::unique_ptr<WellTestState> wtestState_{};
529 std::shared_ptr<EclipseState> eclipseState_{};
530 std::shared_ptr<Schedule> schedule_{};
531 std::shared_ptr<SummaryConfig> summaryConfig_{};
532 bool mpi_init_{
true};
533 bool mpi_finalize_{
true};
536 bool test_split_comm_ =
false;
537 bool isSimulationRank_ =
true;
542 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:332
Definition FlowMain.hpp:68
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 blackoilboundaryratevector.hh:37
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:242
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:235
This file provides the infrastructure to retrieve run-time parameters.
The Opm property system, traits with inheritance.