23#ifndef VULPES_FE_FE_SPACES_FE_MODAL_TENSOR_HPP_
24#define VULPES_FE_FE_SPACES_FE_MODAL_TENSOR_HPP_
41template <std::
size_t Dim,
typename DofPolicy,
bool EnableScaling = false>
46 FeSpaceModalQ<Dim, DofPolicy, EnableScaling>> {
49 return (Dim == 3 && EnableScaling);
66 (Dim == 1 && n_basis_func == (
order + 1)) ||
67 (Dim == 2 && n_basis_func == (
order + 1) * (
order + 2) / 2) ||
71 const auto legendre_q =
74 std::vector<Polynomial1D> legendre(legendre_q.size());
76 legendre_q.begin(), legendre_q.end(), legendre.begin(),
77 [](
const auto& p) { return p.template to<internal::real_t>(); });
81 for (std::size_t i = 0; i < n_basis_func; ++i) {
82 const std::array<std::size_t, Dim> cart_idx =
84 std::array<const Polynomial1D*, Dim> comps_1d;
87 for (std::size_t d = 0; d < Dim; ++d) {
88 comps_1d[d] = &legendre[cart_idx[d]];
101 for (
const auto& p :
m_polys) {
111 template <
typename CellType>
134template <std::
size_t Dim,
bool EnableScaling = false>
FeSpaceBase(std::size_t order)
Definition fe_space.hpp:85
internal::real_t real_t
Definition fe_space.hpp:82
constexpr std::size_t order() const
Definition fe_space.hpp:149
Modal FE Space on polytopal elements (tensor product of Legendre polynomials on the bounding box)....
Definition fe_modal_tensor.hpp:46
std::vector< PolynomialFast > m_polys_fast
Definition fe_modal_tensor.hpp:128
static constexpr auto getMapping(const CellType &cell)
Definition fe_modal_tensor.hpp:112
static constexpr geometry::CellInitOptionsType cellInitOptions()
Definition fe_modal_tensor.hpp:116
FeSpaceModalQ(std::size_t order)
Definition fe_modal_tensor.hpp:56
std::vector< Polynomial > m_polys
Definition fe_modal_tensor.hpp:127
const auto & getBasisFast() const
Definition fe_modal_tensor.hpp:124
static constexpr FeType elemType()
Definition fe_modal_tensor.hpp:107
polynomial::SparsePolynomial< Dim, uint8_t, double, false > PolynomialFast
Definition fe_modal_tensor.hpp:54
const auto & getBasis() const
Definition fe_modal_tensor.hpp:123
polynomial::SparsePolynomial< Dim, uint8_t, internal::real_t, false > Polynomial
Definition fe_modal_tensor.hpp:52
static constexpr bool needBasisScaling()
Definition fe_modal_tensor.hpp:48
Definition mapping.hpp:60
Template class to represent and operate on polynomials.
Definition polynomial1d.hpp:44
Template class to represent and operate on polynomials in nD.
Definition sparse_polynomial.hpp:63
Definition fe_expr_base.hpp:58
mpf_class real_t
Definition fe_space.hpp:188
Definition dof_policy.hpp:45
FeType
Definition fe_space.hpp:48
@ Poly
Definition fe_space.hpp:48
geometry::Cell< Dim, double, int32_t > CellType
Definition fe_expr_base.hpp:41
FeSpaceModalQ< Dim, DofPolicyFeSpaceDP< Dim >, EnableScaling > FeSpaceModalLegendreDQ
Modal Discontinuous Legendre FE Space on bounding box elements.
Definition fe_modal_tensor.hpp:135
std::underlying_type_t< CellInitOptions > CellInitOptionsType
Definition cell.hpp:95
@ CellInitFaceKb
Definition cell.hpp:90
@ CellInitFaceDiameter
Definition cell.hpp:89
@ CellInitFaces
Definition cell.hpp:84
@ CellInitBBox
Definition cell.hpp:85
@ CellInitMeasure
Definition cell.hpp:87
@ CellInitNormals
Definition cell.hpp:80
@ CellInitDiameter
Definition cell.hpp:86
std::array< T, Dim > getMonomial(std::size_t n)
Computes the Dim-D monomial exponents for a given linear index.
Definition monomial.hpp:199
std::vector< Polynomial< T > > buildLegendrePolynomials(std::size_t deg)
Builds a set of Legendre polynomials up to a given degree.
Definition polynomial1d.hpp:548
constexpr T binomial(T n, T k)
Definition vmath.hpp:386
constexpr U pow(U base, V exp, U result=U(1))
Computes the power of a number.
Definition vmath.hpp:171
Definition cell_manager.hpp:38