|
IFEM
90A354
|
Class for encapsulation of general time stepping parameters. More...
#include <TimeStep.h>

Public Member Functions | |
| TimeStep () | |
| The constructor initializes the counters to zero. | |
| TimeStep (const TimeStep &ts) | |
| Copy constructor. | |
| TimeStep & | operator= (const TimeStep &ts) |
| Assigment operator. | |
| bool | parse (char *keyWord, std::istream &is) |
| Parses a data section from an input stream. More... | |
| bool | parse (const tinyxml2::XMLElement *elem) |
| Parses a data section from an XML document. More... | |
| bool | multiSteps () const |
| Returns true if the simulation consists of several time steps. | |
| bool | hasReached (double t) const |
| Returns true if the given time t has been reached. | |
| bool | reset (int istep=0) |
| Resets the time step to the specified step. More... | |
| bool | increment () |
| Advances the time increments one step further. More... | |
| bool | cutback () |
| Restarts current increment with a smaller step size on divergence. More... | |
| bool | finished () const |
| Returns true if the end of the simulation has been reached. | |
| bool | serialize (std::map< std::string, std::string > &data) const |
| Serialize internal state for restarting purposes. More... | |
| bool | deSerialize (const std::map< std::string, std::string > &data) |
| Set internal state from a serialized state. More... | |
Public Attributes | |
| int | step |
| Time step counter. | |
| int & | iter |
| Iteration counter. | |
| TimeDomain | time |
| Time domain data. | |
| double | starTime |
| Start time of simulation. | |
| double | stopTime |
| Stop time of simulation. | |
| double | maxCFL |
| CFL restriction on time step size (0.0: no restriction) | |
Private Types | |
| typedef std::pair< std::vector< double >, double > | Step |
| Time step definition. | |
| typedef std::vector< Step > | TimeSteps |
| Time step container. | |
Private Attributes | |
| int | niter |
| Number of iterations in previous time step. | |
| int | nInitStep |
| Number of fixed timesteps in the beginning. | |
| int | maxStep |
| Maximum number of time steps. | |
| double | dtMin |
| Minimum time increment size. | |
| double | dtMax |
| Maximun time increment size. | |
| double | f1 |
| Scale factor for increased time step size. | |
| double | f2 |
| Scale factor for reduced time step size. | |
| TimeSteps | mySteps |
| Time step definitions. | |
| TimeSteps::iterator | stepIt |
| Running iterator over the time steps. | |
| size_t | lstep |
| Local step counter, i.e., within current *stepIt. | |
Class for encapsulation of general time stepping parameters.
| bool TimeStep::cutback | ( | ) |
Restarts current increment with a smaller step size on divergence.
References IFEM::cout, TimeDomain::dt, dtMin, f2, TimeDomain::first, iter, mySteps, niter, stepIt, TimeDomain::t, and time.
Referenced by TimeIntegration::SIMExplicitRKE< Solver >::solveStep().
| bool TimeStep::deSerialize | ( | const std::map< std::string, std::string > & | data | ) |
Set internal state from a serialized state.
| [in] | data | Container for serialized data |
Referenced by SIMSolver< T1 >::deSerialize().
| bool TimeStep::increment | ( | ) |
Advances the time increments one step further.
References TimeDomain::CFL, IFEM::cout, TimeDomain::dt, dtMax, dtMin, TimeDomain::dtn, f1, f2, hasReached(), iter, lstep, maxCFL, maxStep, mySteps, nInitStep, niter, step, stepIt, stopTime, TimeDomain::t, and time.
Referenced by SIMSolver< T1 >::advanceStep(), MultiStepSIM::advanceStep(), and reset().
| bool TimeStep::parse | ( | char * | keyWord, |
| std::istream & | is | ||
| ) |
Parses a data section from an input stream.
| [in] | keyWord | Keyword of current data section to read |
| is | The file stream to read from |
References maxCFL, mySteps, utl::readLine(), reset(), starTime, TimeDomain::t, and time.
Referenced by SIMSolver< T1 >::parse().
| bool TimeStep::parse | ( | const tinyxml2::XMLElement * | elem | ) |
Parses a data section from an XML document.
| [in] | elem | The XML element to parse |
References IFEM::cout, TimeDomain::dt, dtMax, dtMin, f1, f2, utl::getAttribute(), maxCFL, maxStep, mySteps, nInitStep, reset(), starTime, stopTime, TimeDomain::t, and time.
| bool TimeStep::reset | ( | int | istep = 0 | ) |
Resets the time step to the specified step.
References TimeDomain::CFL, TimeDomain::dt, TimeDomain::dtn, increment(), lstep, mySteps, step, stepIt, stopTime, TimeDomain::t, and time.
Referenced by deSerialize(), parse(), and SIMSolverTS< T1 >::solveProblem().
| bool TimeStep::serialize | ( | std::map< std::string, std::string > & | data | ) | const |
Serialize internal state for restarting purposes.
| data | Container for serialized data |
Referenced by SIMSolver< T1 >::serialize().