SpECTRE
v2025.03.17
|
Functions for testing volume data output. More...
Functions | |
template<typename T > | |
T | multiply (const double obs_value, const T &component) |
Helper function that multiplies a tensor component by a double, which is typically the observation time, to generate different tensor values at different times for testing. | |
template<typename DataType > | |
void | check_volume_data (const std::string &h5_file_name, const uint32_t version_number, const std::string &group_name, const size_t observation_id, const double observation_value, const std::optional< double > &observation_value_epsilon, const std::vector< DataType > &tensor_components_and_coords, const std::vector< std::string > &grid_names, const std::vector< std::vector< Spectral::Basis > > &bases, const std::vector< std::vector< Spectral::Quadrature > > &quadratures, const std::vector< std::vector< size_t > > &extents, const std::vector< std::string > &expected_components, const std::vector< std::vector< size_t > > &grid_data_orders, const std::optional< double > &components_comparison_precision, double factor_to_rescale_components=1.0, const std::vector< std::string > &invalid_components={}) |
Helper function to check that volume data was written correctly. This function checks the following: 0. That the provided observation_id is present in the file (possibly within an epsilon) More... | |
Functions for testing volume data output.
void TestHelpers::io::VolumeData::check_volume_data | ( | const std::string & | h5_file_name, |
const uint32_t | version_number, | ||
const std::string & | group_name, | ||
const size_t | observation_id, | ||
const double | observation_value, | ||
const std::optional< double > & | observation_value_epsilon, | ||
const std::vector< DataType > & | tensor_components_and_coords, | ||
const std::vector< std::string > & | grid_names, | ||
const std::vector< std::vector< Spectral::Basis > > & | bases, | ||
const std::vector< std::vector< Spectral::Quadrature > > & | quadratures, | ||
const std::vector< std::vector< size_t > > & | extents, | ||
const std::vector< std::string > & | expected_components, | ||
const std::vector< std::vector< size_t > > & | grid_data_orders, | ||
const std::optional< double > & | components_comparison_precision, | ||
double | factor_to_rescale_components = 1.0 , |
||
const std::vector< std::string > & | invalid_components = {} |
||
) |
Helper function to check that volume data was written correctly. This function checks the following: 0. That the provided observation_id is present in the file (possibly within an epsilon)