36 #include <boost/circular_buffer.hpp>
108 inline bool gt(
double other_time)
const
114 inline bool ge(
double other_time)
const
120 inline bool lt(
double other_time)
const
126 inline bool le(
double other_time)
const
223 <<
"Time step index: " << EI_Index::val
224 <<
", history index: " << EI_BackIndex::val
225 <<
" out of history of size: " << EI_HistorySize::val);
394 inline double t()
const
417 inline double dt()
const
467 void view(
const char *name=
"")
const;
TimeMark::Type type_fixed_time()
bool operator==(const TimeStep &other)
double init_time_
Initial time.
TimeMarks::iterator next(const TimeGovernor &tg, const TimeMark::Type &mask) const
double lower_constraint_
Lower constraint for the choice of the next time step.
Iterator over TimeMark objects in TimeMarks object (database of TimeMark objects).
double end_time() const
End time.
double estimate_time() const
bool is_time_step_fixed_
Flag that is set when the fixed step is set (lasts only one time step).
boost::circular_buffer< TimeStep > recent_steps_
Circular buffer of recent time steps. Implicit size is 2.
static TimeMarks time_marks_
bool lt(double other_time) const
double upper_constraint() const
TimeGovernor(const Input::Record &input, TimeMark::Type fixed_time_mask=TimeMark::none_type)
Constructor for unsteady solvers.
double end_time_
End time of the simulation.
double fix_dt_until_mark()
Fixing time step until fixed time mark.
void set_permanent_constraint(double min_dt, double max_dt)
Sets permanent constraints for time step.
bool is_end() const
Returns true if the actual time is greater than or equal to the end time.
void next_time()
Proceed to the next time according to current estimated time step.
TimeMarks::iterator last(const TimeMark::Type &mask) const
DECLARE_INPUT_EXCEPTION(ExcTimeGovernorMessage,<< EI_Message::val)
bool is_current(const TimeMark::Type &mask) const
TimeMarks::iterator next(const TimeMark::Type &mask) const
double end_of_fixed_dt() const
const TimeStep & step(int index=-1) const
Basic time management functionality for unsteady (and steady) solvers (class Equation).
static const Type none_type
Mark Type with all bits unset.
static TimeMarks & marks()
double estimate_dt() const
Estimate choice of next time step according to actual setting of constraints.
void view(const char *name="") const
bool time_step_changed_
Flag is set if the time step has been changed (lasts only one time step).
bool le(double other_time) const
double upper_constraint_
Upper constraint for the choice of the next time step.
TimeMark::Type eq_mark_type_
TimeMark type of the equation.
Global macros to enhance readability and debugging, general constants.
bool is_current(const TimeGovernor &tg, const TimeMark::Type &mask) const
bool ge(double other_time) const
void add_time_marks_grid(double step, TimeMark::Type mark_type=TimeMark::none_type) const
static const double time_step_precision
TimeMark::Type equation_fixed_mark_type() const
TimeMark::Type equation_mark_type() const
bool is_changed_dt() const
int set_lower_constraint(double lower)
Sets lower constraint for the next time step estimating.
TYPEDEF_ERR_INFO(EI_Index, int)
double lower_constraint() const
static Input::Type::Record input_type
unsigned int index_
Index of the step is index if the end time. Zero time step is artificial.
This class is a collection of time marks to manage various events occurring during simulation time...
double end_of_fixed_dt_interval_
End of interval if fixed time step.
bool steady_
True if the time governor is used for steady problem.
bool is_steady() const
Returns true if the time governor is used for steady problem.
STREAM & operator<<(STREAM &s, UpdateFlags u)
TimeStep make_next(double new_length) const
double max_time_step_
Permanent upper limit for the time step.
DECLARE_EXCEPTION(ExcMissingTimeStep,<< "Time step index: "<< EI_Index::val<< ", history index: "<< EI_BackIndex::val<< " out of history of size: "<< EI_HistorySize::val)
void init_common(double init_time, double end_time, TimeMark::Type type)
Common part of the constructors. Set most important parameters, check they are valid and set default ...
bool safe_compare(double t1, double t0) const
int set_upper_constraint(double upper)
Sets upper constraint for the next time step estimating.
bool gt(double other_time) const
unsigned int index() const
double fixed_time_step_
Next fixed time step.
static const double inf_time
Infinity time used for steady case.
Representation of one time step.
double end_
End time point of the time step.
double min_time_step_
Permanent lower limit for the time step.
TimeMarks::iterator last(const TimeGovernor &tg, const TimeMark::Type &mask) const