ReducedWorldtubeModeRecorder.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cmath>
7 #include <cstddef>
8 #include <string>
9 
10 #include "Evolution/Systems/Cce/Tags.hpp"
11 #include "IO/H5/File.hpp"
13 
14 /// \cond
15 class ComplexModalVector;
16 /// \endcond
17 
18 namespace Cce {
19 
20 /// The dataset string associated with each scalar that will be output in the
21 /// reduced set of SpEC-like worldtube boundary data.
22 template <typename Tag>
24 
25 template <>
27  Cce::Tags::BoundaryValue<Cce::Tags::BondiBeta>>() noexcept {
28  return "Beta";
29 }
30 
31 template <>
33 dataset_label_for_tag<Cce::Tags::BoundaryValue<Cce::Tags::BondiU>>() noexcept {
34  return "U";
35 }
36 
37 template <>
39 dataset_label_for_tag<Cce::Tags::BoundaryValue<Cce::Tags::BondiQ>>() noexcept {
40  return "Q";
41 }
42 
43 template <>
45 dataset_label_for_tag<Cce::Tags::BoundaryValue<Cce::Tags::BondiW>>() noexcept {
46  return "W";
47 }
48 
49 template <>
51 dataset_label_for_tag<Cce::Tags::BoundaryValue<Cce::Tags::BondiJ>>() noexcept {
52  return "J";
53 }
54 
55 template <>
58  return "DrJ";
59 }
60 
61 template <>
64  return "H";
65 }
66 
67 template <>
69 dataset_label_for_tag<Cce::Tags::BoundaryValue<Cce::Tags::BondiR>>() noexcept {
70  return "R";
71 }
72 
73 template <>
76  return "DuR";
77 }
78 
79 /// Records a compressed representation of SpEC-like worldtube data associated
80 /// with just the spin-weighted scalars required to perform the CCE algorithm.
82  public:
83  /// The constructor takes the filename used to create the H5File object for
84  /// writing the data
85  explicit ReducedWorldtubeModeRecorder(const std::string& filename) noexcept
86  : output_file_{filename} {}
87 
88  /// append to `dataset_path` the vector created by `time` followed by the
89  /// `modes` rearranged in ascending m-varies-fastest format.
90  ///
91  /// For real quantities, negative m and the imaginary part of m=0 are omitted.
92  void append_worldtube_mode_data(const std::string& dataset_path, double time,
93  const ComplexModalVector& modes, size_t l_max,
94  bool is_real = false) noexcept;
95 
96  private:
97  h5::H5File<h5::AccessType::ReadWrite> output_file_;
98 };
99 } // namespace Cce
Cce::dataset_label_for_tag
std::string dataset_label_for_tag() noexcept
The dataset string associated with each scalar that will be output in the reduced set of SpEC-like wo...
std::string
cmath
Cce::ReducedWorldtubeModeRecorder::ReducedWorldtubeModeRecorder
ReducedWorldtubeModeRecorder(const std::string &filename) noexcept
The constructor takes the filename used to create the H5File object for writing the data.
Definition: ReducedWorldtubeModeRecorder.hpp:85
File.hpp
Cce::ReducedWorldtubeModeRecorder
Records a compressed representation of SpEC-like worldtube data associated with just the spin-weighte...
Definition: ReducedWorldtubeModeRecorder.hpp:81
SPECTRE_ALWAYS_INLINE
#define SPECTRE_ALWAYS_INLINE
Definition: ForceInline.hpp:16
cstddef
Cce::Tags::BoundaryValue
A prefix tag representing the boundary data for a quantity on the extraction surface.
Definition: Tags.hpp:204
h5
Contains functions and classes for manipulating HDF5 files.
Definition: AccessType.cpp:10
ComplexModalVector
A class for storing complex spectral coefficients on a spectral grid.
Definition: ComplexModalVector.hpp:39
Cce
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:28
ForceInline.hpp
h5::AccessType
AccessType
Set the access type to the H5File.
Definition: AccessType.hpp:23
Cce::ReducedWorldtubeModeRecorder::append_worldtube_mode_data
void append_worldtube_mode_data(const std::string &dataset_path, double time, const ComplexModalVector &modes, size_t l_max, bool is_real=false) noexcept
append to dataset_path the vector created by time followed by the modes rearranged in ascending m-var...
Definition: ReducedWorldtubeModeRecorder.cpp:16
string