My Project
|
Base class for all problems which use a finite volume spatial discretization. More...
#include <fvbaseproblem.hh>
Public Types | |
using | RestrictProlongOperator = EmptyRestrictProlong |
Public Member Functions | |
FvBaseProblem (Simulator &simulator) | |
bool | recycleFirstIterationStorage () const |
Return if the storage term of the first iteration is identical to the storage term for the solution of the previous time step. | |
std::string | outputDir () const |
Determine the directory for simulation output. | |
void | finishInit () |
Called by the Opm::Simulator in order to initialize the problem. | |
void | prefetch (const Element &) const |
Allows to improve the performance by prefetching all data which is associated with a given element. | |
void | gridChanged () |
Handle changes of the grid. | |
template<class Context > | |
void | boundary (BoundaryRateVector &, const Context &, unsigned, unsigned) const |
Evaluate the boundary conditions for a boundary segment. | |
template<class Context > | |
void | constraints (Constraints &, const Context &, unsigned, unsigned) const |
Evaluate the constraints for a control volume. | |
template<class Context > | |
void | source (RateVector &, const Context &, unsigned, unsigned) const |
Evaluate the source term for all phases within a given sub-control-volume. | |
template<class Context > | |
void | initial (PrimaryVariables &, const Context &, unsigned, unsigned) const |
Evaluate the initial value for a control volume. | |
template<class Context > | |
Scalar | extrusionFactor (const Context &, unsigned, unsigned) const |
Return how much the domain is extruded at a given sub-control volume. | |
Scalar | extrusionFactor () const |
void | initialSolutionApplied () |
Callback used by the model to indicate that the initial solution has been determined for all degrees of freedom. | |
void | beginEpisode () |
Called at the beginning of an simulation episode. | |
void | beginTimeStep () |
Called by the simulator before each time integration. | |
void | beginIteration () |
Called by the simulator before each Newton-Raphson iteration. | |
void | endIteration () |
Called by the simulator after each Newton-Raphson update. | |
void | endTimeStep () |
Called by the simulator after each time integration. | |
void | endEpisode () |
Called when the end of an simulation episode is reached. | |
void | finalize () |
Called after the simulation has been run sucessfully. | |
void | timeIntegration () |
Called by Opm::Simulator in order to do a time integration on the model. | |
Scalar | minTimeStepSize () const |
Returns the minimum allowable size of a time step. | |
unsigned | maxTimeIntegrationFailures () const |
Returns the maximum number of subsequent failures for the time integration before giving up. | |
bool | continueOnConvergenceError () const |
Returns if we should continue with a non-converged solution instead of giving up if we encounter a time step size smaller than the minimum time step size. | |
void | setNextTimeStepSize (Scalar dt) |
Impose the next time step size to be used externally. | |
Scalar | nextTimeStepSize () const |
Called by Opm::Simulator whenever a solution for a time step has been computed and the simulation time has been updated. | |
bool | shouldWriteRestartFile () const |
Returns true if a restart file should be written to disk. | |
bool | shouldWriteOutput () const |
Returns true if the current solution should be written to disk (i.e. | |
void | advanceTimeLevel () |
Called by the simulator after everything which can be done about the current time step is finished and the model should be prepared to do the next time integration. | |
std::string | name () const |
The problem name. | |
const GridView & | gridView () const |
The GridView which used by the problem. | |
const GlobalPosition & | boundingBoxMin () const |
The coordinate of the corner of the GridView's bounding box with the smallest values. | |
const GlobalPosition & | boundingBoxMax () const |
The coordinate of the corner of the GridView's bounding box with the largest values. | |
const VertexMapper & | vertexMapper () const |
Returns the mapper for vertices to indices. | |
const ElementMapper & | elementMapper () const |
Returns the mapper for elements to indices. | |
Simulator & | simulator () |
Returns Simulator object used by the simulation. | |
const Simulator & | simulator () const |
Returns Simulator object used by the simulation. | |
Model & | model () |
Returns numerical model used for the problem. | |
const Model & | model () const |
Returns numerical model used for the problem. | |
NewtonMethod & | newtonMethod () |
Returns object which implements the Newton method. | |
const NewtonMethod & | newtonMethod () const |
Returns object which implements the Newton method. | |
RestrictProlongOperator | restrictProlongOperator () |
return restriction and prolongation operator | |
unsigned | markForGridAdaptation () |
Mark grid cells for refinement or coarsening. | |
template<class Restarter > | |
void | serialize (Restarter &res) |
This method writes the complete state of the problem to the harddisk. | |
template<class Restarter > | |
void | deserialize (Restarter &res) |
This method restores the complete state of the problem from disk. | |
void | writeOutput (bool verbose=true) |
Write the relevant secondary variables of the current solution into an VTK output file. | |
VtkMultiWriter & | defaultVtkWriter () const |
Method to retrieve the VTK writer which should be used to write the default ouput after each time step to disk. | |
Static Public Member Functions | |
static void | registerParameters () |
Registers all available parameters for the problem and the model. | |
static std::string | helpPreamble (int, const char **argv) |
Returns the string that is printed before the list of command line parameters in the help message. | |
static std::string | briefDescription () |
Returns a human readable description of the problem for the help message. | |
static int | handlePositionalParameter (std::function< void(const std::string &, const std::string &)>, std::set< std::string > &, std::string &errorMsg, int, const char **argv, int paramIdx, int) |
Handles positional command line parameters. | |
Protected Member Functions | |
bool | enableVtkOutput_ () const |
Protected Attributes | |
Scalar | nextTimeStepSize_ |
Base class for all problems which use a finite volume spatial discretization.
|
inlineexplicit |
simulator | The time manager of the simulation |
gridView | The view on the DUNE grid which ought to be used (normally the leaf grid view) |
|
inline |
Evaluate the boundary conditions for a boundary segment.
values | Stores the fluxes over the boundary segment. |
context | The object representing the execution context from which this method is called. |
spaceIdx | The local index of the spatial entity which represents the boundary segment. |
timeIdx | The index used for the time discretization |
|
inlinestatic |
Returns a human readable description of the problem for the help message.
The problem description is printed as part of the –help message. It is optional and should not exceed one or two lines of text.
|
inline |
Evaluate the constraints for a control volume.
constraints | Stores the values of the primary variables at a given spatial and temporal location. |
context | The object representing the execution context from which this method is called. |
spaceIdx | The local index of the spatial entity which represents the boundary segment. |
timeIdx | The index used for the time discretization |
|
inline |
This method restores the complete state of the problem from disk.
It is the inverse of the serialize() method.
Restarter | The deserializer type |
res | The deserializer object |
|
inline |
Called when the end of an simulation episode is reached.
Typically, a new episode is started in this method.
|
inline |
Called by the simulator after each time integration.
This method is intended to do some post processing of the solution. (e.g., some additional output)
|
inline |
Return how much the domain is extruded at a given sub-control volume.
This means the factor by which a lower-dimensional (1D or 2D) entity needs to be expanded to get a full dimensional cell. The default is 1.0 which means that 1D problems are actually thought as pipes with a cross section of 1 m^2 and 2D problems are assumed to extend 1 m to the back.
context | The object representing the execution context from which this method is called. |
spaceIdx | The local index of the spatial entity which represents the boundary segment. |
timeIdx | The index used for the time discretization |
|
inline |
Called by the Opm::Simulator in order to initialize the problem.
If you overload this method don't forget to call ParentType::finishInit()
|
inlinestatic |
Handles positional command line parameters.
Positional parameters are parameters that are not prefixed by any parameter name.
seenParams | The parameters which have already been seen in the current context |
errorMsg | If the positional argument cannot be handled, this is the reason why |
argc | The total number of command line parameters |
argv | The string value of the command line parameters |
paramIdx | The index of the positional parameter in the array of all parameters |
posParamIdx | The number of the positional parameter encountered so far |
|
inlinestatic |
Returns the string that is printed before the list of command line parameters in the help message.
If the returned string is empty, no help message will be generated.
|
inline |
Evaluate the initial value for a control volume.
values | Stores the primary variables. |
context | The object representing the execution context from which this method is called. |
spaceIdx | The local index of the spatial entity which represents the boundary segment. |
timeIdx | The index used for the time discretization |
|
inline |
Mark grid cells for refinement or coarsening.
|
inline |
Returns numerical model used for the problem.
|
inline |
The problem name.
This is used as a prefix for files generated by the simulation. It is highly recommend to overwrite this method in the concrete problem which is simulated.
|
inline |
Determine the directory for simulation output.
The actual problem may chose to transform the value of the OutputDir parameter and it can e.g. choose to create the directory on demand if it does not exist. The default behaviour is to just return the OutputDir parameter and to throw an exception if no directory with this name exists.
|
inline |
Return if the storage term of the first iteration is identical to the storage term for the solution of the previous time step.
This is only relevant if the storage cache is enabled and is usually the case, i.e., this method only needs to be overwritten in rare corner cases.
|
inline |
return restriction and prolongation operator
|
inline |
This method writes the complete state of the problem to the harddisk.
The file will start with the prefix returned by the name() method, has the current time of the simulation clock in it's name and uses the extension .ers
. (Ewoms ReStart file.) See Opm::Restart for details.
Restarter | The serializer type |
res | The serializer object |
|
inline |
Returns true if the current solution should be written to disk (i.e.
as a VTK file)
The default behavior is to write out the solution for every time step. This method is should be overwritten by the implementation if the default behavior is deemed insufficient.
|
inline |
Returns true if a restart file should be written to disk.
The default behavior is to write one restart file every 10 time steps. This method should be overwritten by the implementation if the default behavior is deemed insufficient.
|
inline |
Returns Simulator object used by the simulation.
|
inline |
Evaluate the source term for all phases within a given sub-control-volume.
rate | Stores the values of the volumetric creation/anihilition rates of the conserved quantities. |
context | The object representing the execution context from which this method is called. |
spaceIdx | The local index of the spatial entity which represents the boundary segment. |
timeIdx | The index used for the time discretization |
|
inline |
Write the relevant secondary variables of the current solution into an VTK output file.
verbose | Specify if a message should be printed whenever a file is written |