Projection.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
8 #include "DataStructures/Matrix.hpp" // IWYU pragma: keep
9 
10 /// \cond
11 template <size_t Dim>
12 class Mesh;
13 /// \endcond
14 
15 namespace Spectral {
16 
17 /// The portion of an element covered by a mortar.
18 enum class MortarSize { Full, UpperHalf, LowerHalf };
19 
20 /*!
21  * \brief The projection matrix from a 1D mortar to an element.
22  *
23  * \details
24  * The projection matrices returned by this function (and by
25  * projection_matrix_element_to_mortar()) define orthogonal projection
26  * operators between the spaces of functions on the boundary of the
27  * element and the mortar. These projections are usually the correct
28  * way to transfer data onto and off of the mortars.
29  *
30  * The half-interval projections are based on an equation derived by
31  * Saul. This shows that the projection from the spectral basis for
32  * the entire interval to the spectral basis for the upper half
33  * interval is
34  * \f{equation*}
35  * T_{jk} = \frac{2 j + 1}{2} 2^j \sum_{n=0}^{j-k} \binom{j}{k+n}
36  * \binom{(j + k + n - 1)/2}{j} \frac{(k + n)!^2}{(2 k + n + 1)! n!}
37  * \f}
38  */
40  MortarSize size, const Mesh<1>& element_mesh,
41  const Mesh<1>& mortar_mesh) noexcept;
42 
43 /// The projection matrix from a 1D element to a mortar. See
44 /// projection_matrix_mortar_to_element() for details.
46  MortarSize size, const Mesh<1>& mortar_mesh,
47  const Mesh<1>& element_mesh) noexcept;
48 
49 } // namespace Spectral
Defines class Matrix.
Holds the number of grid points, basis, and quadrature in each direction of the computational grid...
Definition: Mesh.hpp:49
Mesh< Dim > mortar_mesh(const Mesh< Dim > &face_mesh1, const Mesh< Dim > &face_mesh2) noexcept
Find a mesh for a mortar capable of representing data from either of two faces.
Definition: MortarHelpers.cpp:19
const Matrix & projection_matrix_element_to_mortar(const MortarSize size, const Mesh< 1 > &mortar_mesh, const Mesh< 1 > &element_mesh) noexcept
The projection matrix from a 1D element to a mortar. See projection_matrix_mortar_to_element() for de...
Definition: Projection.cpp:234
MortarSize
The portion of an element covered by a mortar.
Definition: Projection.hpp:18
const Matrix & projection_matrix_mortar_to_element(const MortarSize size, const Mesh< 1 > &element_mesh, const Mesh< 1 > &mortar_mesh) noexcept
The projection matrix from a 1D mortar to an element.
Definition: Projection.cpp:43
A dynamically sized matrix of doubles with column-major storage.
Definition: Matrix.hpp:19
Functionality associated with a particular choice of basis functions and quadrature for spectral oper...
Definition: Chebyshev.cpp:16