Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
time_state Module Reference

Module with things related to the simulation time.

Data Types

type  time_state_t
 A struct that contains all info about the time, expand as needed. More...
 

Functions/Subroutines

subroutine time_state_init_from_json (this, params)
 Initialize time state from JSON.
 
subroutine time_state_init_from_components (this, start_time, end_time, dt)
 Initialize time state.
 
subroutine time_state_reset (this)
 Reset time state.
 
subroutine time_state_status (this)
 Write status banner.
 
pure logical function time_state_is_done (this)
 Check if the simulation is done.
 
pure real(kind=dp) function time_state_tolerance (this)
 Tolerance for comparing the current time to a fixed time, such as the end time of the simulation or a bound of a time window.
 

Function/Subroutine Documentation

◆ time_state_init_from_components()

subroutine time_state::time_state_init_from_components ( class(time_state_t), intent(inout)  this,
real(kind=dp), intent(in)  start_time,
real(kind=dp), intent(in)  end_time,
real(kind=dp), intent(in)  dt 
)
private

Definition at line 91 of file time_state.f90.

◆ time_state_init_from_json()

subroutine time_state::time_state_init_from_json ( class(time_state_t), intent(inout)  this,
type(json_file), intent(inout)  params 
)

Definition at line 67 of file time_state.f90.

◆ time_state_is_done()

pure logical function time_state::time_state_is_done ( class(time_state_t), intent(in)  this)
private
Note
The comparison is made on the progress from the start time in the direction of the simulation, so that it also holds for a simulation marching backwards in time. The tolerance keeps a time a few ulps short of the end time from adding one more time step, which would overshoot the end time by almost dt and produce an output past it.

Definition at line 157 of file time_state.f90.

◆ time_state_reset()

subroutine time_state::time_state_reset ( class(time_state_t), intent(inout)  this)
private

Definition at line 114 of file time_state.f90.

◆ time_state_status()

subroutine time_state::time_state_status ( class(time_state_t), intent(in)  this)
private

Definition at line 125 of file time_state.f90.

◆ time_state_tolerance()

pure real(kind=dp) function time_state::time_state_tolerance ( class(time_state_t), intent(in)  this)
private

The current time is accumulated step by step and carries the round-off of the additions, so a time step meant to land on a fixed time can end up a few ulps on either side of it. Within this tolerance the two are considered equal. It is relative to the span of the simulation is always non-negative, also for a simulation marching backwards in time. To prevent issues it is also limited to a fraction of the time step size.

Definition at line 179 of file time_state.f90.