SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
dg::Events::ObserveConstantsPerElement< VolumeDim > Class Template Reference

Base class for Observers that write data that is constant within an Element. More...

#include <ObserveConstantsPerElement.hpp>

Classes

struct  CoordinatesFloatingPointType
 The floating point type/precision with which to write the coordinates to disk. More...
struct  FloatingPointType
 The floating point type/precision with which to write the data to disk. More...
struct  SubfileName
 The name of the subfile inside the HDF5 file. More...

Public Types

using options
using observation_registration_tags = tmpl::list<>
using is_ready_argument_tags = tmpl::list<::Tags::Time>

Public Member Functions

 ObserveConstantsPerElement (const std::string &subfile_name, ::FloatingPointType coordinates_floating_point_type, ::FloatingPointType floating_point_type)
std::optional< std::pair< observers::TypeOfObservation, observers::ObservationKey > > get_observation_type_and_key_for_registration () const
template<typename Metavariables, typename ArrayIndex, typename Component>
bool is_ready (const double time, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const Component *const component) const
void pup (PUP::er &p) override
Public Member Functions inherited from Event
 Event (CkMigrateMessage *msg)
 WRAPPED_PUPable_abstract (Event)
template<typename ComputeTagsList, typename DataBoxType, typename Metavariables, typename ArrayIndex, typename ComponentPointer>
void run (const gsl::not_null< ObservationBox< ComputeTagsList, DataBoxType > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer, const ObservationValue &observation_value) const
template<typename DbTags, typename Metavariables, typename ArrayIndex, typename ComponentPointer>
bool is_ready (const db::DataBox< DbTags > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer) const
virtual bool needs_evolved_variables () const =0
 Whether the event uses anything depending on the evolved_variables. If this returns false, anything depending on the evolved variables may have an incorrect value when the event is run.

Protected Member Functions

std::vector< TensorComponentallocate_and_insert_coords (size_t number_of_constants, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time, const Domain< VolumeDim > &domain, const ElementId< VolumeDim > &element_id) const
 Creates the vector of tensor components that will be observed and starts to fill it with the inertial coordinates.
void add_constant (gsl::not_null< std::vector< TensorComponent > * > components, std::string name, double value) const
 Adds a TensorComponent to components with the given name and the given value.
template<typename Metavariables, typename ParallelComponent>
void observe (std::vector< TensorComponent > components, Parallel::GlobalCache< Metavariables > &cache, const ElementId< VolumeDim > &element_id, const ParallelComponent *, const ObservationValue &observation_value) const
 Observes the components as volume data.

Detailed Description

template<size_t VolumeDim>
class dg::Events::ObserveConstantsPerElement< VolumeDim >

Base class for Observers that write data that is constant within an Element.

Member Typedef Documentation

◆ options

template<size_t VolumeDim>
using dg::Events::ObserveConstantsPerElement< VolumeDim >::options
Initial value:
tmpl::list<SubfileName, CoordinatesFloatingPointType, FloatingPointType>

Member Function Documentation

◆ add_constant()

template<size_t VolumeDim>
void dg::Events::ObserveConstantsPerElement< VolumeDim >::add_constant ( gsl::not_null< std::vector< TensorComponent > * > components,
std::string name,
double value ) const
protected

Adds a TensorComponent to components with the given name and the given value.

Details

Should be called after allocate_and_insert_coords

◆ allocate_and_insert_coords()

template<size_t VolumeDim>
std::vector< TensorComponent > dg::Events::ObserveConstantsPerElement< VolumeDim >::allocate_and_insert_coords ( size_t number_of_constants,
double time,
const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > & functions_of_time,
const Domain< VolumeDim > & domain,
const ElementId< VolumeDim > & element_id ) const
protected

Creates the vector of tensor components that will be observed and starts to fill it with the inertial coordinates.

Details

number_of_constants is the number of additional tensor components that will be observed. These are added by calling add_constant


The documentation for this class was generated from the following file:
  • src/ParallelAlgorithms/Events/ObserveConstantsPerElement.hpp