SpECTRE  v2021.11.01
dg::Events::ObserveFields< VolumeDim, ObservationValueTag, tmpl::list< Tensors... >, tmpl::list< NonTensorComputeTags... >, tmpl::list< AnalyticSolutionTensors... >, ArraySectionIdTag, tmpl::list< NonSolutionTensors... > > 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, domain::Tags::Mesh< VolumeDim >, coordinates_tag, AnalyticSolutionTensors..., NonSolutionTensors... >
 
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, const tnsr::I< DataVector, VolumeDim, Frame::Inertial > &inertial_coordinates, const typename AnalyticSolutionTensors::type &... analytic_solution_tensors, const typename NonSolutionTensors::type &... non_solution_tensors, 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 OptionalAnalyticSolutions , 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 tnsr::I< DataVector, VolumeDim, Frame::Inertial > &inertial_coordinates, const typename AnalyticSolutionTensors::type &... analytic_solution_tensors, const typename NonSolutionTensors::type &... non_solution_tensors, const OptionalAnalyticSolutions &optional_analytic_solutions, 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... AnalyticSolutionTensors, typename ArraySectionIdTag, typename... NonSolutionTensors>
class dg::Events::ObserveFields< VolumeDim, ObservationValueTag, tmpl::list< Tensors... >, tmpl::list< NonTensorComputeTags... >, tmpl::list< AnalyticSolutionTensors... >, ArraySectionIdTag, tmpl::list< NonSolutionTensors... > >

Observe volume tensor fields.

A class that writes volume quantities to an h5 file during the simulation. The observed quantitites are:

  • InertialCoordinates
  • Tensors listed in Tensors template parameter
  • Error(*) = errors in AnalyticSolutionTensors = \(\text{value} - \text{analytic solution}\)

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... AnalyticSolutionTensors, typename ArraySectionIdTag , typename... NonSolutionTensors>
bool dg::Events::ObserveFields< VolumeDim, ObservationValueTag, tmpl::list< Tensors... >, tmpl::list< NonTensorComputeTags... >, tmpl::list< AnalyticSolutionTensors... >, ArraySectionIdTag, tmpl::list< NonSolutionTensors... > >::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... AnalyticSolutionTensors, typename ArraySectionIdTag , typename... NonSolutionTensors>
constexpr Options::String dg::Events::ObserveFields< VolumeDim, ObservationValueTag, tmpl::list< Tensors... >, tmpl::list< NonTensorComputeTags... >, tmpl::list< AnalyticSolutionTensors... >, ArraySectionIdTag, tmpl::list< NonSolutionTensors... > >::help
staticconstexpr
Initial value:
=
"Observe volume tensor fields.\n"
"\n"
"Writes volume quantities:\n"
" * InertialCoordinates\n"
" * Tensors listed in Tensors template parameter\n"
" * Error(*) = errors in AnalyticSolutionTensors\n"
" = value - analytic solution\n"

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