#include <clock.h>
Clock with explicitly defined time steps.
Definition at line 316 of file clock.h.
◆ CustomClock()
smash::CustomClock::CustomClock |
( |
std::vector< double > |
times | ) |
|
|
inline |
Initialises a custom clock with explicitly given output times.
- Parameters
-
[in] | times | vector of desired output times |
Definition at line 323 of file clock.h.
◆ 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 331 of file clock.h.
333 throw std::runtime_error(
"Trying to access undefined zeroth output time");
◆ next_time()
double smash::CustomClock::next_time |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ timestep_duration()
double smash::CustomClock::timestep_duration |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ 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 imulation |
[in] | is_output_clock | whether this is an output clock rather than a lab clock |
Implements smash::Clock.
Definition at line 342 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 349 of file clock.h.
351 [start_time](
double t) {
352 if (t <= start_time) {
353 logg[
LClock].warn(
"Removing custom output time ", t,
354 " fm since it is earlier than the "
355 "starting time of the simulation");
◆ custom_times_
std::vector<double> smash::CustomClock::custom_times_ |
|
private |
Vector of times where output is generated.
Definition at line 365 of file clock.h.
The documentation for this class was generated from the following file: