SpECTRE
v2025.03.17
|
A unique identifier for an observation representing the type of observation and the instance (e.g. time) at which the observation occurs. More...
#include <ObservationId.hpp>
Public Member Functions | |
ObservationId (double t, std::string tag) | |
Construct from a value and a string tagging the observation. More... | |
ObservationId (double t, ObservationKey key) | |
const ObservationKey & | observation_key () const |
Hash used to distinguish between ObservationIds of different types and subtypes. This hash does not contain any information about the Id or its value. | |
size_t | hash () const |
Hash distinguishing different ObservationIds, including the value of the Id . | |
double | value () const |
The simulation "time". | |
void | pup (PUP::er &p) |
A unique identifier for an observation representing the type of observation and the instance (e.g. time) at which the observation occurs.
The ObservationId is used to uniquely identify an observation inside our H5 subfiles that can be agreed upon across the system. That is, it does not depend on hardware rounding of floating points because it is an integral. One example would be a Time
for output observed every N
steps in a global time stepping evolution. Another example could be having a counter class for dense output observations that increments the counter for each observation but has a value equal to the physical time.
The constructor takes a double
representing the current "time" at which we are observing. For an evolution this could be the physical time, while for an elliptic solve this could be a combination of nonlinear and linear iteration.
A specialization of std::hash
is provided to allow using ObservationId
as a key in associative containers.
observers::ObservationId::ObservationId | ( | double | t, |
std::string | tag | ||
) |
Construct from a value and a string tagging the observation.
The tag is a unique string used to identify the particular observation.