20 #ifndef TIME_MARKS_HH_ 21 #define TIME_MARKS_HH_ 51 typedef unsigned long int Type;
76 inline double time()
const {
192 {
return type_fixed_time_;}
197 {
return type_output_;}
202 {
return type_input_;}
207 {
return type_balance_output_;}
310 : marks_(marks), it_(it), mask_(mask) {}
313 {
OLD_ASSERT(&marks_ == &it.
marks_,
"Can not assign TimeMarks::iterator of different container.\n");
322 while ( it_ != marks_.end() ) {
324 if (it_->match_mask(mask_))
break;
332 while ( it_ != marks_.begin() ) {
334 if (it_->match_mask(mask_))
break;
342 OLD_ASSERT(it_!= marks_.end(),
"Out of marks vector.\n");
349 OLD_ASSERT(it_!= marks_.end(),
"Out of marks vector.\n");
354 {
return it_ == other.
it_; }
357 {
return it_ != other.
it_; }
376 std::size_t operator()(
TimeMark const& mark)
const;
TimeMark::Type type_fixed_time()
Type mark_type() const
Getter for mark type.
bool operator<(const TimeMark &another) const
Iterator over TimeMark objects in TimeMarks object (database of TimeMark objects).
TimeMarksIterator & operator=(const TimeMarksIterator &it)
Type mark_type_
The type of the TimeMark.
TimeMark::Type type_output()
TimeMark(double time, Type type)
TimeMark::Type type_balance_output_
Predefined type for balance output.
TimeMark::Type type_input_
Predefined type for change of boundary condition.
Basic time management functionality for unsteady (and steady) solvers (class Equation).
static const Type none_type
Mark Type with all bits unset.
static const Type every_type
Mark Type with all bits set.
TimeMarksIterator & operator--()
Prefix decrement. Skip non matching marks.
TimeMark::Type mask_
Mask type.
TimeMark::Type type_balance_output()
UnitSI operator*(const UnitSI &a, const UnitSI &b)
Product of two units.
double time_
The marked time.
Global macros to enhance readability and debugging, general constants.
TimeMarksIterator & operator++()
Prefix increment. Skip non matching marks.
std::vector< TimeMark > marks_
TimeMarks list sorted according to the their time.
TimeMarksIterator iterator
Iterator class for iteration over time marks of particular type. This is always const_iterator.
This class is a collection of time marks to manage various events occurring during simulation time...
std::ostream & operator<<(std::ostream &stream, const TimeMark &marks)
TimeMark::Type next_mark_type_
MarkType that will be used at next new_time_mark() call.
bool match_mask(const TimeMark::Type &mask) const
TimeMark::Type mask()
Returns mask.
TimeMark::Type type_input()
TimeMarksIterator(const std::vector< TimeMark > &marks, const std::vector< TimeMark >::const_iterator &it, const TimeMark::Type &mask)
void add_to_type(const TimeMark::Type &type)
double time() const
Getter for the time of the TimeMark.
std::vector< TimeMark >::const_iterator it_
Iterator over the vector of TimeMark objects.
Class used for marking specified times at which some events occur.
TimeMark::Type type_fixed_time_
Predefined type for fixed time.
const std::vector< TimeMark > & marks_
Reference to the vector of TimeMark objects.
Representation of one time step..
TimeMark::Type type_output_
Predefined type for output.
bool operator==(const TimeMark &other_mark) const
For unordered maps and sets, hashing.