SpECTRE  v2024.09.29
h5::Cce Class Reference

Represents Cauchy-Characteristic Extraction (CCE) bondi variables inside of an HDF5 file. More...

#include <Cce.hpp>

Public Member Functions

HIDDEN_SYMBOLS void append (const std::unordered_map< std::string, std::vector< double > > &data)
 For each bondi variable name, appends the data to the dataset in the H5 file. More...
 
const std::vector< std::stringget_legend () const
 Return the legend. All bondi variables have the same legend.
 
const std::array< hsize_t, 2 > & get_dimensions (const std::string &bondi_variable_name) const
 Return the number of rows (first index) and columns (second index) of the bondi_variable_name dataset. All bondi variables will have the same dimensions.
 
const std::stringget_header () const
 The header of the Cce file.
 
uint32_t get_version () const
 The user-specified version number of the Cce file. More...
 
const std::stringsubfile_path () const override
 Path to this Cce file. More...
 
template<typename T = Matrix>
std::unordered_map< std::string, T > get_data () const
 Return all currently stored data in the h5::Cce file in the form of a Matrix or a std::vector<std::vector<double>> for each bondi variable.
 
template<typename T = Matrix>
get_data (const std::string &bondi_variable_name) const
 Return all currently stored data in the h5::Cce file in the form of a Matrix or a std::vector<std::vector<double>> for each bondi variable.
 
template<typename T = Matrix>
std::unordered_map< std::string, T > get_data_subset (const std::vector< size_t > &these_ell, size_t first_row=0, size_t num_rows=1) const
 Get only some values of \(\ell\) over a range of rows. More...
 
template<typename T = Matrix>
get_data_subset (const std::string &bondi_variable_name, const std::vector< size_t > &these_ell, size_t first_row=0, size_t num_rows=1) const
 Get only some values of \(\ell\) over a range of rows. More...
 
virtual const std::stringsubfile_path () const =0
 Return the path to the subfile where this object is stored. More...
 

Detailed Description

Represents Cauchy-Characteristic Extraction (CCE) bondi variables inside of an HDF5 file.

Within a Cce object, there are several datasets that correspond to the Cce::scri_plus_interpolation_set bondi variables at future null infinity represented as complex spherical harmonic coefficients. The names of these bondi variables are

  • EthInertialRetardedTime
  • News
  • Psi0
  • Psi1
  • Psi2
  • Psi3
  • Psi4
  • Strain

Each dataset has a couple H5 attributes:

  • Legend which is determined by the l_max massed to the constructor.
  • sxs_format which is a string. The value is "SpECTRE_CCE_v1"

The Cce object itself also has the sxs_format attribute with the same value, along with a version and header attribute.

The columns of data are stored in each dataset in the following order:

  • time
  • Real Y_0,0
  • Imag Y_0,0
  • Real Y_1,-1
  • Imag Y_1,-1
  • Real Y_1,0
  • Imag Y_1,0
  • Real Y_1,1
  • Imag Y_1,1
  • ...

and so on until you reach the coefficients for l_max.

Note
This class does not do any caching of data so all data is written as soon as append() is called.

Member Function Documentation

◆ append()

HIDDEN_SYMBOLS void h5::Cce::append ( const std::unordered_map< std::string, std::vector< double > > &  data)

For each bondi variable name, appends the data to the dataset in the H5 file.

Details

The data.at(name).size() must be the same as the number of columns already in the dataset. Also, all bondi variable names listed in the constructor of h5::Cce must be present in the data.

◆ get_data_subset() [1/2]

template<typename T = Matrix>
T h5::Cce::get_data_subset ( const std::string bondi_variable_name,
const std::vector< size_t > &  these_ell,
size_t  first_row = 0,
size_t  num_rows = 1 
) const

Get only some values of \(\ell\) over a range of rows.

Details

The time column is always returned. The coefficients will be returned in the order that you requested them in. No sorting is done internally. All requested these_ell must be less that or equal to the l_max that this file was constructed with. Also both the first and last row requested must be less than or equal to the total number of rows.

◆ get_data_subset() [2/2]

template<typename T = Matrix>
std::unordered_map< std::string, T > h5::Cce::get_data_subset ( const std::vector< size_t > &  these_ell,
size_t  first_row = 0,
size_t  num_rows = 1 
) const

Get only some values of \(\ell\) over a range of rows.

Details

The time column is always returned. The coefficients will be returned in the order that you requested them in. No sorting is done internally. All requested these_ell must be less that or equal to the l_max that this file was constructed with. Also both the first and last row requested must be less than or equal to the total number of rows.

◆ get_version()

uint32_t h5::Cce::get_version ( ) const
inline

The user-specified version number of the Cce file.

Note
h5::Version returns a uint32_t, so we return one here too for the version

◆ subfile_path()

const std::string & h5::Cce::subfile_path ( ) const
inlineoverridevirtual

Path to this Cce file.

Implements h5::Object.


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