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 : } // namespace Spectral 16 : /// \endcond 17 : 18 : namespace Spectral { 19 : /*! 20 : * \brief %Matrix used to interpolate to the \p target_points. 21 : * 22 : * \warning For each target point located outside of the logical coordinate 23 : * interval covered by `BasisType` (often \f$[-1,1]\f$), the resulting matrix 24 : * performs polynomial extrapolation instead of interpolation. The extrapolation 25 : * will be correct but may suffer from reduced accuracy, especially for 26 : * higher-order polynomials (i.e., larger values of `num_points`). 27 : * 28 : * \param num_points The number of collocation points 29 : * \param target_points The points to interpolate to 30 : */ 31 : template <Basis BasisType, Quadrature QuadratureType, typename T> 32 1 : Matrix interpolation_matrix(size_t num_points, const T& target_points); 33 : 34 : /*! 35 : * \brief Interpolation matrix to the \p target_points for a one-dimensional 36 : * mesh. 37 : * 38 : * \see interpolation_matrix(size_t, const T&) 39 : */ 40 : template <typename T> 41 1 : Matrix interpolation_matrix(const Mesh<1>& mesh, const T& target_points); 42 : } // namespace Spectral