A utility type for determining whether an action should be executed based on the current time value. Used to e.g. control whether we should write a file or execute a simcomp. Note that the nexecutions variable should be incremented externally by calling the register_execution procedure. This is to allow running the the check multiple times at the same time step.
More...
|
| procedure, pass(this) | init (this, start_time, end_time, control_mode, control_value) |
| | Constructor.
|
| |
| procedure, pass(this) | free (this) |
| | Destructor.
|
| |
| procedure, pass(this) | check (this, time, force) |
| | Check if the execution should be performed.
|
| |
| procedure, pass(this) | register_execution (this) |
| | Increment nexectutions.
|
| |
| procedure, pass(this) | set_counter (this, time) |
| | Set the counter based on a time (for restarts)
|
| |
Definition at line 48 of file time_based_controller.f90.
◆ check()
- Parameters
-
| t | Time value. |
| tstep | Current timestep. |
| dt | Timestep size. |
| force | Whether to force returning true. Optional. |
- Note
- In the logic,
nsteps being zero corresponds to us not knowing the number of time-steps between executions and thus having to rely on nexecutions. This is done in anticipation of having a variable timestep. A fraction of the time step (10 percent) is used as a tolerance.
Definition at line 75 of file time_based_controller.f90.
◆ free()
◆ init()
| procedure, pass(this) time_based_controller::time_based_controller_t::init |
( |
class(time_based_controller_t), intent(inout) |
this, |
|
|
real(kind=rp), intent(in) |
start_time, |
|
|
real(kind=rp), intent(in) |
end_time, |
|
|
character(len=*), intent(in) |
control_mode, |
|
|
real(kind=rp), intent(in) |
control_value |
|
) |
| |
- Parameters
-
| end_time | The final simulation time. |
| control_mode | The way to interpret the control_value parameter. |
| control_value | The value defining the execution frequency. |
Definition at line 71 of file time_based_controller.f90.
◆ register_execution()
◆ set_counter()
◆ control_mode
◆ control_value
| real(kind=rp) time_based_controller::time_based_controller_t::control_value |
◆ end_time
| real(kind=rp) time_based_controller::time_based_controller_t::end_time = 0.0_rp |
◆ frequency
| real(kind=rp) time_based_controller::time_based_controller_t::frequency = 0.0_rp |
◆ never
| logical time_based_controller::time_based_controller_t::never = .false. |
◆ nexecutions
| integer time_based_controller::time_based_controller_t::nexecutions = 0 |
◆ nsteps
| integer time_based_controller::time_based_controller_t::nsteps = 0 |
◆ start_time
| real(kind=rp) time_based_controller::time_based_controller_t::start_time = 0.0_rp |
◆ time_interval
| real(kind=rp) time_based_controller::time_based_controller_t::time_interval = 0.0_rp |
The documentation for this type was generated from the following file: