SpECTRE  v2022.05.05
dg::Events::ObserveFields< VolumeDim, ObservationValueTag, tmpl::list< Tensors... >, tmpl::list< NonTensorComputeTags... >, ArraySectionIdTag > Class Template Reference

Observe volume tensor fields. More...

#include <ObserveFields.hpp>

Classes

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

Public Types

using options = tmpl::list< SubfileName, CoordinatesFloatingPointType, FloatingPointTypes, VariablesToObserve, InterpolateToMesh >
 
using compute_tags_for_observation_box = tmpl::list< Tensors..., NonTensorComputeTags... >
 
using argument_tags = tmpl::list<::Tags::ObservationBox, ObservationValueTag, ::Events::Tags::ObserverMesh< VolumeDim > >
 
using observation_registration_tags = tmpl::list<::Tags::DataBox >
 
using is_ready_argument_tags = tmpl::list<>
 

Public Member Functions

 ObserveFields (const std::string &subfile_name, FloatingPointType coordinates_floating_point_type, const std::vector< FloatingPointType > &floating_point_types, const std::vector< std::string > &variables_to_observe, std::optional< Mesh< VolumeDim > > interpolation_mesh={}, const Options::Context &context={})
 
template<typename DataBoxType , typename ComputeTagsList , typename Metavariables , typename ParallelComponent >
void operator() (const ObservationBox< DataBoxType, ComputeTagsList > &box, const typename ObservationValueTag::type &observation_value, const Mesh< VolumeDim > &mesh, Parallel::GlobalCache< Metavariables > &cache, const ElementId< VolumeDim > &array_index, const ParallelComponent *const component) const
 
template<typename DbTagsList >
std::optional< std::pair< observers::TypeOfObservation, observers::ObservationKey > > get_observation_type_and_key_for_registration (const db::DataBox< DbTagsList > &box) const
 
template<typename Metavariables , typename ArrayIndex , typename Component >
bool is_ready (Parallel::GlobalCache< Metavariables > &, const ArrayIndex &, const Component *const) const
 
bool needs_evolved_variables () const override
 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. More...
 
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 ObservationBox< ComputeTagsList, DataBoxType > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer) 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. More...
 

Static Public Member Functions

template<typename DataBoxType , typename ComputeTagsList , typename Metavariables , typename ParallelComponent >
static void call_operator_impl (const std::string &subfile_path, const std::unordered_map< std::string, FloatingPointType > &variables_to_observe, const std::optional< Mesh< VolumeDim > > &interpolation_mesh, const typename ObservationValueTag::type &observation_value, const Mesh< VolumeDim > &mesh, const ObservationBox< DataBoxType, ComputeTagsList > &box, Parallel::GlobalCache< Metavariables > &cache, const ElementId< VolumeDim > &array_index, const ParallelComponent *const)
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

template<size_t VolumeDim, typename ObservationValueTag, typename... Tensors, typename... NonTensorComputeTags, typename ArraySectionIdTag>
class dg::Events::ObserveFields< VolumeDim, ObservationValueTag, tmpl::list< Tensors... >, tmpl::list< NonTensorComputeTags... >, ArraySectionIdTag >

Observe volume tensor fields.

A class that writes volume quantities to an h5 file during the simulation. The observed quantitites are specified in the VariablesToObserve option. Any Tensor in the db::DataBox can be observed but must be listed in the Tensors template parameter. Any additional compute tags that hold a Tensor can also be added to the Tensors template parameter. Finally, Variables and other non-tensor compute tags can be listed in the NonTensorComputeTags to facilitate observing. Note that the InertialCoordinates are always observed.

The user may specify an interpolation_mesh to which the data is interpolated.

Note
The NonTensorComputeTags are intended to be used for Variables compute tags like Tags::DerivCompute
Array sections
This event supports sections (see Parallel::Section). Set the ArraySectionIdTag template parameter to split up observations into subsets of elements. The observers::Tags::ObservationKey<ArraySectionIdTag> must be available in the DataBox. It identifies the section and is used as a suffix for the path in the output file.

Member Function Documentation

◆ needs_evolved_variables()

template<size_t VolumeDim, typename ObservationValueTag , typename... Tensors, typename... NonTensorComputeTags, typename ArraySectionIdTag >
bool dg::Events::ObserveFields< VolumeDim, ObservationValueTag, tmpl::list< Tensors... >, tmpl::list< NonTensorComputeTags... >, ArraySectionIdTag >::needs_evolved_variables ( ) const
inlineoverridevirtual

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.

Implements Event.

Member Data Documentation

◆ help

template<size_t VolumeDim, typename ObservationValueTag , typename... Tensors, typename... NonTensorComputeTags, typename ArraySectionIdTag >
constexpr Options::String dg::Events::ObserveFields< VolumeDim, ObservationValueTag, tmpl::list< Tensors... >, tmpl::list< NonTensorComputeTags... >, ArraySectionIdTag >::help
staticconstexpr
Initial value:
=
"Observe volume tensor fields.\n"
"\n"
"Writes volume quantities:\n"
" * InertialCoordinates\n"
" * Tensors listed in the 'VariablesToObserve' option\n"

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