Public Member Functions | List of all members
observers::ObservationId Class Reference

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) noexcept
 Construct from a value and a string tagging the observation. More...
 
 ObservationId (double t, ObservationKey key) noexcept
 
const ObservationKeyobservation_key () const noexcept
 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 noexcept
 Hash distinguishing different ObservationIds, including the value of the Id.
 
double value () const noexcept
 The simulation "time".
 
void pup (PUP::er &p) noexcept
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ObservationId()

observers::ObservationId::ObservationId ( double  t,
std::string  tag 
)
noexcept

Construct from a value and a string tagging the observation.

The tag is a unique string used to identify the particular observation.


The documentation for this class was generated from the following files: