25 #include <boost/functional/hash.hpp> 87 if (first_ge !=
marks_.begin()) {
96 marks_.insert(first_ge, mark);
105 for (
unsigned int i = 0; i<=n_steps;i++) {
106 auto mark =
TimeMark(time+i*dt, type);
114 if (mark.match_mask(filter_type)) mark.add_to_type(add_type);
134 auto it =
last(time_step, mask);
136 else return this->
end(mask);
144 while ( ! tg.
step().
lt(first_ge->time()) || ! first_ge->match_mask(mask) ) {
155 while ( ! time_step.
ge(first_ge->time()) || ! first_ge->match_mask(mask) ) {
192 stream <<
"time marks:" << endl;
194 stream << *
it << endl;
201 std::size_t seed = 0;
202 boost::hash_combine(seed, mark.
time());
203 boost::hash_combine(seed, mark.
mark_type());
void add_time_marks(double time, double dt, double end_time, TimeMark::Type type)
Type mark_type() const
Getter for mark type.
TimeMarks::iterator next(const TimeGovernor &tg, const TimeMark::Type &mask) const
Iterator over TimeMark objects in TimeMarks object (database of TimeMark objects).
TimeMarks::iterator begin(TimeMark::Type mask=TimeMark::every_type) const
Iterator for the begin mimics container-like of TimeMarks.
bool lt(double other_time) const
IntFormatSpec< int, TypeSpec<'x'> > hex(int value)
bool contains(double other_time) const
ostream & operator<<(ostream &stream, const TimeMark &mark)
TimeMark::Type type_balance_output_
Predefined type for balance output.
TimeMark::Type type_input_
Predefined type for change of boundary condition.
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.
Basic time management class.
TimeMarks::iterator last(const TimeStep &time_step, const TimeMark::Type &mask) const
static const Type every_type
Mark Type with all bits set.
Global macros to enhance readability and debugging, general constants.
std::vector< TimeMark > marks_
TimeMarks list sorted according to the their time.
bool ge(double other_time) const
static const double time_step_precision
friend std::ostream & operator<<(std::ostream &stream, const TimeMarks &marks)
Friend output operator.
TimeMark::Type new_mark_type()
std::size_t operator()(TimeMark const &mark) const
This class is a collection of time marks to manage various events occurring during simulation time...
TimeMark add(const TimeMark &mark)
TimeMark::Type next_mark_type_
MarkType that will be used at next new_time_mark() call.
void add_to_type_all(TimeMark::Type filter_type, TimeMark::Type add_type)
double time() const
Getter for the time of the TimeMark.
TimeMarks::iterator current(const TimeStep &time_step, const TimeMark::Type &mask) const
Class used for marking specified times at which some events occur.
TimeMarks::iterator end(TimeMark::Type mask=TimeMark::every_type) const
Iterator for the end mimics container-like of TimeMarks.
TimeMark::Type type_fixed_time_
Predefined type for fixed time.
static const double inf_time
Infinity time used for steady case.
Representation of one time step..
TimeMark::Type type_output_
Predefined type for output.