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 : 8 : /// \cond 9 : class Matrix; 10 : template <size_t> 11 : class Mesh; 12 : namespace Spectral { 13 : enum class Basis : uint8_t; 14 : enum class Quadrature : uint8_t; 15 : enum class Parity : uint8_t; 16 : } // namespace Spectral 17 : /// \endcond 18 : 19 : namespace Spectral { 20 : /*! 21 : * \brief %Matrix used to interpolate to the \p target_points. 22 : * 23 : * \warning For each target point located outside of the logical coordinate 24 : * interval covered by `BasisType` (often \f$[-1,1]\f$), the resulting matrix 25 : * performs polynomial extrapolation instead of interpolation. The extrapolation 26 : * will be correct but may suffer from reduced accuracy, especially for 27 : * higher-order polynomials (i.e., larger values of `num_points`). 28 : * 29 : * \param num_points The number of collocation points 30 : * \param target_points The points to interpolate to 31 : */ 32 : template <Basis BasisType, Quadrature QuadratureType, typename T> 33 1 : Matrix interpolation_matrix(size_t num_points, const T& target_points); 34 : 35 : /*! 36 : * \brief Interpolation matrix to the \p target_points for a one-dimensional 37 : * mesh. 38 : * 39 : * \see interpolation_matrix(size_t, const T&) 40 : */ 41 : template <typename T> 42 1 : Matrix interpolation_matrix(const Mesh<1>& mesh, const T& target_points); 43 : 44 : /*! 45 : * \brief %Matrix used to interpolate to the \p target_points for bases with 46 : * a spectral space that depends on parity, i.e. ZernikeB1. 47 : * 48 : * \see interpolation_matrix(size_t, const T&) 49 : */ 50 : template <Basis BasisType, Quadrature QuadratureType, typename T> 51 1 : Matrix interpolation_matrix(size_t num_points, const T& target_points, 52 : Spectral::Parity parity); 53 : } // namespace Spectral