51 * Basic time management functionality for unsteady (and steady) solvers (class Equation).
52 *
53 * <h2> Common features and unsteady time governor (TG) </h2>
54 *
55 * This class provides algorithm for selecting next time step, and information about current time step frame.
56 * Step estimating is constrained by several bounds (permanent maximal and minimal time step, upper
57 * and lower constraint of time step). The permanent constraints are set in the constructor from the input
58 * record so that user can set the time step constraints for the whole model.
59 * Function set_permanent_constraint() should be used only in very specific cases and possibly right after
60 * the constructor before using other functions of TG.
61 *
62 * Choice of the very next time step can be constrained using functions set_upper_constraint() and set_lower_constraint().
63 * Lower and upper constraints are set equal to permanent ones in the constructor and can only
64 * become stricter. If one tries to set these constraints outside the interval of the previous constraints,
65 * nothing is changed and a specified value is returned. Upper and lower constraints are reset in function
66 * next_time() to the permanent constraints.
67 *
68 *
69 * The later one can be called multiple times with various
70 * constraint values and we use the minimum of them. Function next_time() choose the next time step in such a way that it meets actual constraints and
71 * a uniform discrete time grid with this step hits the nearest fixed time in lowest possible number of steps.
72 *
73 * The fixed times are time marks of TimeMarks object passed at construction time with particular mask.
74 *
75 * There is just one set of time marks for the whole problem. Therefore TimeMarks object is static and is shared umong
76 * all the equations and time governors. Each equation creates its own specific time mark type.
77 *
78 * Solution of the next time step proceeds in following steps:
79 * -# Estimate next time step and set constraints (this can be usefull in hc_seq_explicit for estimating next transport time)
80 * -# Fix next time step up to the next time mark (this is necessary for ConvectionTransport)
81 * -# Proceed to the next time when solution is available. (this can replace solved flag in equation classes)
82 *
83 * Information provided by TG includes:
84 * - actual time, last time, end time
85 * - actual time step
86 * - number of the time level
87 * - end of interval with fixed time step
88 * - time comparison
89 * - static pointer to time marks
90 *
91 * <h2> Steady time governor</h2>
92 *
93 * Steady TG can be constructed by default constructor (initial time is zero) or by
94 * constructor with initial time as parameter. End time and time step are set to infinity.
95 * One can check if the time governor is steady by calling is_steady().
96 * Calling estimate_dt() will return infinity.
97 *
98 * Setting constraints have no consequences. Calling fix_dt_until_mark() will only return zero
99 * and will not do anything.
100 *
101 * The steady TG works in two states. At first the time is set to initial and time level
102 * is equal zero. To use steady TG properly one should call next_time() after the computation
103 * of steady problem is done. Current time is then set to infinity, time level is set to 1 and
104 * calling estimate_dt() will return zero.
105 *
106 * Note: For example class TransportNothing (which computes really nothing) uses also steady TG but
107 * it calls next_time() immediately after TG's construction. This means that the 'computation'of transport
108 * is done.
109 *
110 *
111 * TODO:
112 * - still we have problems with time comparisons
113 * 1) TimeMarks can merge marks only with fixed precision, since they are shared by several equations with possibly different timesteps.
114 * 2) On the other hand comparing of times by time governor can be done relatively to the current time step.