SpectralIo.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <array>
7 #include <string>
8 #include <vector>
9 
11 
12 namespace h5::detail {
13 class OpenGroup;
14 } // namespace h5::detail
15 
16 namespace h5_detail {
17 /// We maintain a list of bases and quadratures which are compatible
18 /// with IO, this allows for efficient storage of Spectral::Basis in
19 /// volume data files (currently there are 3 bases)
20 std::array<Spectral::Basis, 3> allowed_bases() noexcept;
21 
22 /// We maintain a list of quadratures which are compatible
23 /// with IO, this allows for efficient storage of Spectral::Quadrature in
24 /// volume data files (currently there are 4 quadratures)
25 std::array<Spectral::Quadrature, 4> allowed_quadratures() noexcept;
26 
27 /// Write a dictionary as an attribute to the volume file, can be used
28 /// to decode integer sequence as values[i] represents the string
29 /// value encoded with integer i in the h5 file
30 void write_dictionary(const std::string& dict_name,
31  const std::vector<std::string>& values,
32  const h5::detail::OpenGroup& observation_group) noexcept;
33 
34 /// A dictionary `dict_name` is used to decode the integer vector `decodable`
35 /// into an vector of strings. The `dict_name` should correspond to
36 /// a dictionary written with `h5_detail::write_dictionary`
37 std::vector<std::string> decode_with_dictionary_name(
38  const std::string& dict_name, const std::vector<int>& decodable,
39  const h5::detail::OpenGroup& observation_group) noexcept;
40 
41 } // namespace h5_detail
vector
Spectral.hpp
array
h5
Contains functions and classes for manipulating HDF5 files.
Definition: AccessType.cpp:10
Spectral::Quadrature
Quadrature
The choice of quadrature method to compute integration weights.
Definition: Spectral.hpp:90
Spectral
Functionality associated with a particular choice of basis functions and quadrature for spectral oper...
Definition: Chebyshev.cpp:19
string