#include <clock.h>
Clock with explicitly defined time steps.
Definition at line 404 of file clock.h.
◆ CustomClock()
smash::CustomClock::CustomClock |
( |
std::vector< double > |
times | ) |
|
|
inlineexplicit |
Initialises a custom clock with explicitly given output times.
- Parameters
-
[in] | times | vector of desired output times |
Definition at line 411 of file clock.h.
Representation counter_
Internally used to count the number of time steps.
std::vector< double > custom_times_
Vector of times where output is generated.
◆ current_time()
double smash::CustomClock::current_time |
( |
| ) |
const |
|
inlineoverridevirtual |
- Returns
- the current time
- Exceptions
-
runtime_error | if the clock has never been advanced |
Implements smash::Clock.
Definition at line 419 of file clock.h.
424 throw std::runtime_error(
"Trying to access undefined zeroth output time");
double start_time_
Starting time of the simulation.
◆ next_time()
double smash::CustomClock::next_time |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ timestep_duration()
double smash::CustomClock::timestep_duration |
( |
| ) |
const |
|
inlineoverridevirtual |
- Returns
- the duration of the current time step
Implements smash::Clock.
Definition at line 431 of file clock.h.
double next_time() const override
double current_time() const override
◆ reset()
void smash::CustomClock::reset |
( |
double |
start_time, |
|
|
bool |
is_output_clock |
|
) |
| |
|
inlineoverridevirtual |
reset the clock to the starting time of the simulation
- Parameters
-
[in] | start_time | starting time of the simulation |
[in] | is_output_clock | whether this is an output clock rather than a lab clock |
Implements smash::Clock.
Definition at line 434 of file clock.h.
◆ remove_times_in_past()
void smash::CustomClock::remove_times_in_past |
( |
double |
start_time | ) |
|
|
inlineoverridevirtual |
Remove all custom times before start_time.
- Parameters
-
[in] | start_time | starting time of the simulation |
Implements smash::Clock.
Definition at line 444 of file clock.h.
446 [start_time](
double t) {
447 if (t <= start_time) {
448 logg[LClock].warn(
"Removing custom output time ", t,
449 " fm since it is earlier than the "
450 "starting time of the simulation");
◆ present_internal_time()
double smash::CustomClock::present_internal_time |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ custom_times_
std::vector<double> smash::CustomClock::custom_times_ |
|
private |
Vector of times where output is generated.
Definition at line 469 of file clock.h.
◆ start_time_
double smash::CustomClock::start_time_ = 0. |
|
private |
Starting time of the simulation.
Definition at line 471 of file clock.h.
The documentation for this class was generated from the following file: