Manages the initializing and running of time dependent problems.
More...
#include <simulator.hh>
|
| Simulator (const Simulator &)=delete |
|
| Simulator (bool verbose=true) |
|
GridManager & | gridManager () |
| Return a reference to the grid manager of simulation. More...
|
|
const GridManager & | gridManager () const |
| Return a reference to the grid manager of simulation. More...
|
|
GridView & | gridView () |
| Return the grid view for which the simulation is done. More...
|
|
const GridView & | gridView () const |
| Return the grid view for which the simulation is done. More...
|
|
Model & | model () |
| Return the physical model used in the simulation. More...
|
|
const Model & | model () const |
| Return the physical model used in the simulation. More...
|
|
Problem & | problem () |
| Return the object which specifies the pysical setup of the simulation. More...
|
|
const Problem & | problem () const |
| Return the object which specifies the pysical setup of the simulation. More...
|
|
void | setStartTime (Scalar t) |
| Set the time of the start of the simulation. More...
|
|
Scalar | startTime () const |
| Return the time of the start of the simulation. More...
|
|
void | setTime (Scalar t) |
| Set the current simulated time, don't change the current time step index. More...
|
|
void | setTime (Scalar t, int stepIdx) |
| Set the current simulated time and the time step index. More...
|
|
Scalar | time () const |
| Return the number of seconds of simulated time which have elapsed since the start time. More...
|
|
void | setEndTime (Scalar t) |
| Set the time of simulated seconds at which the simulation runs. More...
|
|
Scalar | endTime () const |
| Returns the number of (simulated) seconds which the simulation runs. More...
|
|
const Ewoms::Timer & | timer () const |
| Returns the current wall time required by actually running the simulation. More...
|
|
Scalar | totalWriteTime () const |
| Returns total wall clock time required to write the visualization and restart files over the course of the simulation. More...
|
|
double | setupTime () const |
| Returns the wall time required by setting up and initializing the simulation. More...
|
|
void | setTimeStepSize (Scalar timeStepSize) |
| Set the current time step size to a given value. More...
|
|
Scalar | timeStepSize () const |
| Returns the time step length so that we don't miss the beginning of the next episode or cross the end of the simlation. More...
|
|
int | timeStepIndex () const |
| Returns number of time steps which have been executed since the beginning of the simulation. More...
|
|
void | setFinished (bool yesno=true) |
| Specify whether the simulation is finished. More...
|
|
bool | finished () const |
| Returns true if the simulation is finished. More...
|
|
bool | willBeFinished () const |
| Returns true if the simulation is finished after the time level is incremented by the current time step size. More...
|
|
Scalar | maxTimeStepSize () const |
| Aligns the time step size to the episode boundary and to the end time of the simulation. More...
|
|
void | startNextEpisode (Scalar episodeStartTime, Scalar episodeLength) |
| Change the current episode of the simulation. More...
|
|
void | startNextEpisode (Scalar len=1e100) |
| Start the next episode, but don't change the episode identifier. More...
|
|
void | setEpisodeIndex (int episodeIdx) |
| Sets the index of the current episode. More...
|
|
int | episodeIndex () const |
| Returns the index of the current episode. More...
|
|
Scalar | episodeStartTime () const |
| Returns the absolute time when the current episode started . More...
|
|
Scalar | episodeLength () const |
| Returns the length of the current episode in simulated time . More...
|
|
bool | episodeIsOver () const |
| Returns true if the current episode is finished at the current time. More...
|
|
bool | episodeWillBeOver () const |
| Returns true if the current episode will be finished after the current time step. More...
|
|
Scalar | episodeMaxTimeStepSize () const |
| Aligns the time step size to the episode boundary if the current time step crosses the boundary of the current episode. More...
|
|
void | run () |
| Runs the simulation using a given problem class. More...
|
|
Scalar | prePostProcessTime () const |
|
void | addPrePostProcessTime (Scalar value) |
|
|
static void | registerParameters () |
| Registers all runtime parameters used by the simulation. More...
|
|
static std::string | humanReadableTime (Scalar timeInSeconds, bool isAmendment=true) |
| Given a time step size in seconds, return it in a format which is more easily parsable by humans. More...
|
|
|
void | serialize () |
| This method writes the complete state of the simulation to the harddisk. More...
|
|
template<class Restarter > |
void | serialize (Restarter &restarter) |
| Write the time manager's state to a restart file. More...
|
|
template<class Restarter > |
void | deserialize (Restarter &restarter) |
| Read the time manager's state from a restart file. More...
|
|
template<class TypeTag>
class Ewoms::Simulator< TypeTag >
Manages the initializing and running of time dependent problems.
This class instantiates the grid, the model and the problem to be simlated and runs the simulation loop. The time axis is treated as a sequence of "episodes" which are defined as time intervals for which the problem exhibits boundary conditions and source terms that do not depend on time.
template<class TypeTag >
template<class Restarter >
Read the time manager's state from a restart file.
- Template Parameters
-
Restarter | The type of the object which takes care to deserialize data |
- Parameters
-
restarter | The deserializer object |
Referenced by Ewoms::Simulator< TypeTag >::run().
Return a reference to the grid manager of simulation.
Return the grid view for which the simulation is done.
Referenced by Ewoms::FvBaseDiscretization< TypeTag >::checkConservativeness(), Ewoms::Restart::deserializeBegin(), Ewoms::FvBaseLinearizer< TypeTag >::linearize(), Ewoms::VtkPrimaryVarsModule< TypeTag >::processElement(), Ewoms::BaseOutputModule< TypeTag >::resizeComponentBuffer_(), Ewoms::BaseOutputModule< TypeTag >::resizeEqBuffer_(), Ewoms::BaseOutputModule< TypeTag >::resizePhaseBuffer_(), Ewoms::BaseOutputModule< TypeTag >::resizePhaseComponentBuffer_(), Ewoms::BaseOutputModule< TypeTag >::resizeScalarBuffer_(), Ewoms::BaseOutputModule< TypeTag >::resizeTensorBuffer_(), Ewoms::Simulator< TypeTag >::serialize(), Ewoms::Restart::serializeBegin(), Ewoms::Linear::ParallelAmgBackend< TypeTag >::solve(), and Ewoms::Linear::ParallelIterativeSolverBackend< TypeTag >::solve().
Return the grid view for which the simulation is done.
template<class TypeTag >
static std::string Ewoms::Simulator< TypeTag >::humanReadableTime |
( |
Scalar |
timeInSeconds, |
|
|
bool |
isAmendment = true |
|
) |
| |
|
inlinestatic |
Return the physical model used in the simulation.
Referenced by Ewoms::VtkDiscreteFractureModule< TypeTag >::allocBuffers(), Ewoms::VtkMultiPhaseModule< TypeTag >::allocBuffers(), Ewoms::FvBaseDiscretization< TypeTag >::checkConservativeness(), Ewoms::VtkDiscreteFractureModule< TypeTag >::commitBuffers(), Ewoms::VtkMultiPhaseModule< TypeTag >::commitBuffers(), Ewoms::BaseOutputModule< TypeTag >::commitPriVarsBuffer_(), Ewoms::FvBaseElementContext< TypeTag >::model(), Ewoms::NewtonMethod< TypeTag >::model(), Ewoms::FvBaseProblem< TypeTag >::model(), Ewoms::FvBaseAdLocalLinearizer< TypeTag >::model_(), Ewoms::FvBaseFdLocalLinearizer< TypeTag >::model_(), Ewoms::BaseOutputModule< TypeTag >::resizeComponentBuffer_(), Ewoms::BaseOutputModule< TypeTag >::resizeEqBuffer_(), Ewoms::BaseOutputModule< TypeTag >::resizePhaseBuffer_(), Ewoms::BaseOutputModule< TypeTag >::resizePhaseComponentBuffer_(), Ewoms::BaseOutputModule< TypeTag >::resizeScalarBuffer_(), Ewoms::BaseOutputModule< TypeTag >::resizeTensorBuffer_(), Ewoms::Linear::ParallelAmgBackend< TypeTag >::solve(), and Ewoms::Linear::ParallelIterativeSolverBackend< TypeTag >::solve().
Return the physical model used in the simulation.
Return the object which specifies the pysical setup of the simulation.
Referenced by Ewoms::FvBaseDiscretization< TypeTag >::applyInitialSolution(), Ewoms::FvBaseDiscretization< TypeTag >::checkConservativeness(), Ewoms::Restart::deserializeBegin(), Ewoms::EcfvDiscretization< TypeTag >::dofMapper(), Ewoms::VcfvDiscretization< TypeTag >::dofMapper(), Ewoms::FvBaseDiscretization< TypeTag >::elementMapper(), Ewoms::NewtonMethod< TypeTag >::problem(), Ewoms::FvBaseElementContext< TypeTag >::problem(), Ewoms::FvBaseAdLocalLinearizer< TypeTag >::problem_(), Ewoms::FvBaseFdLocalLinearizer< TypeTag >::problem_(), Ewoms::Restart::serializeBegin(), and Ewoms::FvBaseDiscretization< TypeTag >::vertexMapper().
Return the object which specifies the pysical setup of the simulation.
Runs the simulation using a given problem class.
This method makes sure that time steps sizes are aligned to episode boundaries, amongst other stuff.
References Ewoms::Simulator< TypeTag >::deserialize(), Ewoms::Restart::deserializeBegin(), Ewoms::Restart::deserializeEnd(), Ewoms::Simulator< TypeTag >::episodeIndex(), Ewoms::Simulator< TypeTag >::episodeIsOver(), EWOMS_GET_PARAM, Ewoms::Restart::fileName(), Ewoms::Simulator< TypeTag >::finished(), Ewoms::Simulator< TypeTag >::humanReadableTime(), Ewoms::Timer::realTimeElapsed(), Ewoms::Simulator< TypeTag >::serialize(), Ewoms::Simulator< TypeTag >::setTimeStepSize(), Ewoms::Timer::start(), Ewoms::Timer::stop(), Ewoms::Simulator< TypeTag >::time(), Ewoms::Simulator< TypeTag >::timeStepIndex(), and Ewoms::Simulator< TypeTag >::timeStepSize().
template<class TypeTag >
template<class Restarter >
Write the time manager's state to a restart file.
- Template Parameters
-
Restarter | The type of the object which takes care to serialize data |
- Parameters
-
restarter | The serializer object |
Set the time of simulated seconds at which the simulation runs.
- Parameters
-
t | The time at which the simulation is finished |
Sets the index of the current episode.
Use this method with care!
Specify whether the simulation is finished.
- Parameters
-
yesno | If true the simulation is considered finished before the end time is reached, else it is only considered finished if the end time is reached. |
Set the time of the start of the simulation.
- Parameters
-
t | The time which should be jumped to |
Set the current simulated time, don't change the current time step index.
- Parameters
-
t | The time which should be jumped to |
Set the current simulated time and the time step index.
- Parameters
-
t | The time which should be jumped to |
stepIdx | The new time step index |
template<class TypeTag >
void Ewoms::Simulator< TypeTag >::startNextEpisode |
( |
Scalar |
episodeStartTime, |
|
|
Scalar |
episodeLength |
|
) |
| |
|
inline |
Start the next episode, but don't change the episode identifier.
- Parameters
-
len | Length of the episode , infinite if not specified. |
Return the number of seconds of simulated time which have elapsed since the start time.
To get the time after the time integration, you have to add timeStepSize() to time().
Referenced by Ewoms::Simulator< TypeTag >::episodeIsOver(), Ewoms::Simulator< TypeTag >::episodeMaxTimeStepSize(), Ewoms::Simulator< TypeTag >::episodeWillBeOver(), Ewoms::Simulator< TypeTag >::finished(), Ewoms::Simulator< TypeTag >::maxTimeStepSize(), Ewoms::Simulator< TypeTag >::run(), Ewoms::Restart::serializeBegin(), Ewoms::Simulator< TypeTag >::timeStepSize(), Ewoms::Simulator< TypeTag >::willBeFinished(), and Ewoms::FvBaseProblem< TypeTag >::writeOutput().
Returns the time step length so that we don't miss the beginning of the next episode or cross the end of the simlation.
References Ewoms::Simulator< TypeTag >::endTime(), Ewoms::Simulator< TypeTag >::episodeMaxTimeStepSize(), and Ewoms::Simulator< TypeTag >::time().
Referenced by Ewoms::FvBaseDiscretization< TypeTag >::checkConservativeness(), Ewoms::Simulator< TypeTag >::episodeWillBeOver(), Ewoms::Simulator< TypeTag >::finished(), Ewoms::Simulator< TypeTag >::run(), Ewoms::Simulator< TypeTag >::serialize(), Ewoms::Simulator< TypeTag >::setTimeStepSize(), Ewoms::FvBaseProblem< TypeTag >::timeIntegration(), Ewoms::Simulator< TypeTag >::willBeFinished(), and Ewoms::FvBaseProblem< TypeTag >::writeOutput().
The documentation for this class was generated from the following file:
|