This class encapsulates the setup and running of a simulator based on an input deck. More...
#include <FlowMain.hpp>
Public Member Functions | |
int | execute (int argc, char **argv) |
This is the main function of Flow. | |
Protected Types | |
typedef BlackoilPropsAdFromDeck | FluidProps |
typedef FluidProps::MaterialLawManager | MaterialLawManager |
typedef Simulator::ReservoirState | ReservoirState |
typedef Simulator::OutputWriter | OutputWriter |
Protected Member Functions | |
ioConfig | setOutputDir (output_dir_) |
if (output_to_files_) | |
void | setupLogging () |
void | mergeParallelLogFiles () |
void | readDeckInput () |
void | setupGridAndProps () |
void | setupState () |
void | distributeData () |
void | extractMessages () |
void | runDiagnostics () |
void | writeInit () |
void | setupOutputWriter () |
void | setupLinearSolver () |
int | runSimulator () |
Implementation & | asImpl () |
Protected Attributes | |
int | mpi_rank_ = 0 |
bool | output_cout_ = false |
bool | must_distribute_ = false |
ParameterGroup | param_ |
bool | output_to_files_ = false |
std::string | output_dir_ = std::string(".") |
std::shared_ptr< Deck > | deck_ |
std::shared_ptr< EclipseState > | eclipse_state_ |
std::unique_ptr< GridInit < Grid >> grid_init_;std::shared_ptr < MaterialLawManager > material_law_manager_;std::unique_ptr < FluidProps > fluidprops_;std::unique_ptr < RockCompressibility > rock_comp_;std::array< double, 3 > gravity_;bool use_local_perm_=true;std::unique_ptr < DerivedGeology > geoprops_;std::unique_ptr < ReservoirState > state_;std::vector < double > threshold_pressures_;boost::any parallel_information_;std::unique_ptr < EclipseIO > eclipse_writer_;std::unique_ptr < OutputWriter > output_writer_;std::unique_ptr < NewtonIterationBlackoilInterface > fis_solver_;std::unique_ptr < Simulator > simulator_;std::string logFile_;std::unordered_set < std::string > defunct_well_names_;void setupParallelism(int argc, char **argv){const Dune::MPIHelper &mpi_helper=Dune::MPIHelper::instance(argc, argv);mpi_rank_=mpi_helper.rank();const int mpi_size=mpi_helper.size();output_cout_=(mpi_rank_==0);must_distribute_=(mpi_size > 1);}bool cartesianAdjacent(const Grid &grid, int g1, int g2){using namespace UgGridHelpers;int diff=std::abs(g1-g2);const int *dimens=cartDims(grid);if(diff==1) return true;if(diff==dimens | getIOConfig [0]) return true;if(diff==dimens[0]*dimens[1]) return true;return false;}void printStartupMessage(){if(output_cout_){const std::string version=moduleVersionName();std::cout<< "**********************************************************************\n";std::cout<< "* *\n";std::cout<< "* This is flow_legacy (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: std::cout << "**\n"; std::cout << "**********************************************************************\n\n"; } } bool setupParameters(int argc, char** argv) { param_ = ParameterGroup(argc, argv, false, output_cout_); if (!param_.unhandledArguments().empty()) { if (param_.unhandledArguments().size() != 1) { std::cerr << "You can only specify a single input deck on the command line.\n"; return false; } else { const auto casename = detail::simulationCaseName( param_.unhandledArguments()[ 0 ] ); param_.insertParameter("deck_filename", casename.string() ); } } if (!param_.has("deck_filename")) { std::cerr << "This program must be run with an input deck.\n" "Specify the deck filename either\n" "a) as a command line argument by itself\n" "b) as a command line parameter with the syntax deck_filename=< path to your deck >, or\n" "c) as a parameter in a parameter file(.param or.xml) passed to the program.\n"; return false; } return true; } void setupOutput() { output_to_files_ = output_cout_ && param_.getDefault("output", true); auto& ioConfig = eclipse_state_->() |
const std::string | default_output_dir = ioConfig.getOutputDir() |
output_dir_ = param_.getDefault("output_dir", default_output_dir) |
This class encapsulates the setup and running of a simulator based on an input deck.
int Opm::FlowMainBase< Implementation, Grid, Simulator >::execute | ( | int | argc, | |
char ** | argv | |||
) | [inline] |
This is the main function of Flow.
It runs a complete simulation, with the given grid and simulator classes, based on user command-line input. The content of this function used to be in the main() function of flow.cpp.