mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Capture some variables in FlowMainEbos.
Make Opm::FlowMainEbos capture the variables argc, argv, outputCout, and outputFiles. Passing the variables to the constructor and saving them as class variables in Opm::FlowMainEbos makes the implementation of the Python interface simpler. For example, the step_init() method does not need to ask Opm::Main about the values of the variables when it needs to run execute() in FlowMainEbos. Another advantage of this refactoring could be that less variables needs to be passed around from Opm::Main, to flow_ebos_xxx.cpp, and then again to FlowMainEbos.
This commit is contained in:
@@ -47,7 +47,7 @@ void flowEbosBlackoilSetDeck(double setupTime, Deck *deck, EclipseState& eclStat
|
||||
}
|
||||
|
||||
std::unique_ptr<Opm::FlowMainEbos<TTAG(EclFlowProblem)>>
|
||||
flowEbosBlackoilMainInit(int argc, char** argv)
|
||||
flowEbosBlackoilMainInit(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.
|
||||
@@ -59,14 +59,15 @@ flowEbosBlackoilMainInit(int argc, char** argv)
|
||||
Dune::MPIHelper::instance(argc, argv);
|
||||
#endif
|
||||
|
||||
return std::make_unique<Opm::FlowMainEbos<TTAG(EclFlowProblem)>>();
|
||||
return std::make_unique<Opm::FlowMainEbos<TTAG(EclFlowProblem)>>(
|
||||
argc, argv, outputCout, outputFiles);
|
||||
}
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
||||
{
|
||||
auto mainfunc = flowEbosBlackoilMainInit(argc, argv);
|
||||
return mainfunc->execute(argc, argv, outputCout, outputFiles);
|
||||
auto mainfunc = flowEbosBlackoilMainInit(argc, argv, outputCout, outputFiles);
|
||||
return mainfunc->execute();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user