Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cstddef> 7 : #include <string> 8 : #include <vector> 9 : 10 : #include "NumericalAlgorithms/SphericalHarmonics/Strahlkorper.hpp" 11 : 12 : namespace ylm { 13 : /// \ingroup SurfacesGroup 14 : /// \brief Returns a list of `ylm::Strahlkorper`s constructed from reading in 15 : /// spherical harmonic data for a surface at a requested list of times 16 : /// 17 : /// \details The `ylm::Strahlkorper`s are constructed by reading in data from 18 : /// an H5 subfile that is expected to be in the format described by 19 : /// `intrp::callbacks::ObserveSurfaceData`. It is assumed that 20 : /// \f$l_{max} = m_{max}\f$. 21 : /// 22 : /// \param file_name name of the H5 file containing the surface's spherical 23 : /// harmonic data 24 : /// \param surface_subfile_name name of the subfile (with no leading slash nor 25 : /// the `.dat` extension) within `file_name` that contains the surface's 26 : /// spherical harmonic data to read in 27 : /// \param requested_number_of_times_from_end the number of times to read in 28 : /// starting backwards from the final time found in `surface_subfile_name` 29 : template <typename Frame> 30 1 : std::vector<ylm::Strahlkorper<Frame>> read_surface_ylm( 31 : const std::string& file_name, const std::string& surface_subfile_name, 32 : size_t requested_number_of_times_from_end); 33 : 34 : /*! 35 : * \brief Similar to `ylm::read_surface_ylm`, this reads in spherical harmonic 36 : * data for a surface and constructs a `ylm::Strahlkorper`. However, this 37 : * function only does it at a specific time and returns a single 38 : * `ylm::Strahlkorper`. 39 : * 40 : * \note If two times are found within \p epsilon of the \p time, then an error 41 : * will occur. Similarly, if no \p time is found within the \p epsilon, then an 42 : * error will occur as well. 43 : * 44 : * \param file_name name of the H5 file containing the surface's spherical 45 : * harmonic data 46 : * \param surface_subfile_name name of the subfile (with no leading slash nor 47 : * the `.dat` extension) within `file_name` that contains the surface's 48 : * spherical harmonic data to read in 49 : * \param time Time to read the coefficients at. 50 : * \param relative_epsilon How much error is allowed when looking for a specific 51 : * time. This is useful so users don't have to know the specific time to machine 52 : * precision. 53 : */ 54 : template <typename Frame> 55 1 : ylm::Strahlkorper<Frame> read_surface_ylm_single_time( 56 : const std::string& file_name, const std::string& surface_subfile_name, 57 : double time, double relative_epsilon); 58 : } // namespace ylm