SpECTRE  v2024.04.12
Cce::Events::ObserveFields Class Reference

Event to observe fields/variables in a characteristic evolution. More...

#include <ObserveFields.hpp>

Classes

struct  VariablesToObserve
 

Public Types

using available_tags_to_observe = tmpl::push_back< spin_weighted_tags_to_observe, Tags::ComplexInertialRetardedTime, Tags::OneMinusY >
 
using options = tmpl::list< VariablesToObserve >
 
using compute_tags_for_observation_box = tmpl::list<>
 
using return_tags = tmpl::list<>
 
using argument_tags = tmpl::list<::Tags::DataBox >
 
using is_ready_argument_tags = tmpl::list<>
 

Public Member Functions

 ObserveFields (const std::vector< std::string > &variables_to_observe, const Options::Context &context={})
 
template<typename DbTags , typename Metavariables , typename ArrayIndex , typename ParallelComponent >
void operator() (const db::DataBox< DbTags > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &, const ParallelComponent *const, const ObservationValue &) 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 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. More...
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

Event to observe fields/variables in a characteristic evolution.

Details

Similar to dg::Events::ObserveFields, this event will write volume data from the characteristic domain to disk when triggered. However, there are several differences which are important to highlight.

First is the fields themselves. The DG event takes the fields to observe as template parameters because the event must work with many evolution systems. However, since this event is specific to the characteristic evolution system, we can hardcode the list of fields that are available to observe. The fields available to observe are the following tags along with their first and second Cce::Tags::Dy derivatives (see Cce::Tags::Dy for a definition of y):

Some more fields to observe are:

The main reason that this event is separate from the DG one is because this event writes modal data over the sphere for every radial grid point, while the DG event writes nodal data. Every tag above is a Scalar<SpinWeighted<ComplexDataVector, Spin>> for some Spin. While this data itself is in nodal form, it is more convenient to transform to modal data and decompose in spherical harmonics before writing. This means our typical way of writing/storing volume data won't work.

This event writes its data in the following structure in the H5 file: /Cce/VolumeData/TagName/CompactifiedRadius_X.dat. Every field that is observed will get its own subgroup called TagName. In this subgroup, there will be N files corresponding to N radial grid points named CompactifiedRadius_X.dat where X here will range from 0 to N-1. We call these compactified radii because for a more "physical" radius, it goes to infinity at future-null infinity and we can't write that in a file. Instead, these N files will correspond to the compactified coordinate \(y = 1 - 2R/r\) where \(r\) is your coordinate radius and \(R\) is the coordinate radius of your worldtube. Each file will hold the modal data for that radial grid point. It is recommended to always dump the quantity Cce::Tags::OneMinusY so the values of the compactified coordinates are available as well.

There are two notable exceptions to this format. One is Cce::Tags::ComplexInertialRetardedTime. The quantity we are actually interested in is Cce::Tags::InertialRetardedTime which is real and only defined once for every direction \(\theta,\phi\) (meaning it does not have different values at the different radial grid points). However, we use Cce::Tags::ComplexInertialRetardedTime because it has the same data type as the other tags which makes the internals of the class simpler. The imaginary part of this ComplexDataVector is set to zero. This quantity will be stored in a subfile named /Cce/VolumeData/InertialRetardedTime.dat as a single modal set of data so we don't repeat it N times.

The second is Cce::Tags::OneMinusY. Even though this quantity is stored as a Scalar<SpinWeighted<ComplexDataVector, 0>> like the others, there is only one meaningful value per radial grid point. All angular grid points for a given radius are set to this value, namely \(1-y\). Thus we only need to write this value once for each radial grid point. We do this in a subfile /Cce/VolumeData/OneMinusY.dat where the columns are named CompactifiedRadius_X corresponding to the radial subfiles written for the spin weighted quantities above (and time as the first column).

All data will be written into the observers::OptionTags::ReductionFileName file.

Member Function Documentation

◆ needs_evolved_variables()

bool Cce::Events::ObserveFields::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

constexpr Options::String Cce::Events::ObserveFields::help
staticconstexpr
Initial value:
=
"Observe volume tensor fields on the characteristic grid. Writes volume "
"quantities from the tensors listed in the 'VariablesToObserve' "
"option to the `/Cce/VolumeData` subfile of the reduction h5 file.\n"

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