deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
fe_point_evaluation.cc
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2021 - 2025 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
15
16#include <deal.II/fe/fe_dgp.h>
17#include <deal.II/fe/fe_dgq.h>
18#include <deal.II/fe/fe_poly.h>
19#include <deal.II/fe/fe_q_dg0.h>
20
23
24#include <memory>
25
27
28
29namespace internal
30{
31 namespace FEPointEvaluation
32 {
37 template <int dim, int spacedim>
38 bool
40 const unsigned int base_element_number)
41 {
42 // check if supported
43 const bool flag = [&]() {
44 const FiniteElement<dim, spacedim> *fe_ptr =
45 &(fe.base_element(base_element_number));
46 if (fe_ptr->n_components() != 1)
47 return false;
48
49 // then check if the base element is supported or not
50 if (dynamic_cast<const FE_Poly<dim, spacedim> *>(fe_ptr) != nullptr)
51 {
52 const FE_Poly<dim, spacedim> *fe_poly_ptr =
53 dynamic_cast<const FE_Poly<dim, spacedim> *>(fe_ptr);
54
55 if (dynamic_cast<const TensorProductPolynomials<dim> *>(
56 &fe_poly_ptr->get_poly_space()) == nullptr)
57 return false;
58 }
59 else
60 return false;
61
62 return true;
63 }();
64
65 // make sure that if supported also ShapeInfo is supporting it
66 if (flag)
68 fe),
70
71 return flag;
72 }
73
74
75
76 template <int dim, int spacedim>
77 bool
79 {
80 if (dynamic_cast<const MappingQ<dim, spacedim> *>(&mapping))
81 {
82 return true;
83 }
84 else if (dynamic_cast<const MappingCartesian<dim, spacedim> *>(&mapping))
85 {
86 return true;
87 }
88 return false;
89 }
90
91
92
93 template <int dim, int spacedim>
94 std::vector<Polynomials::Polynomial<double>>
96 {
98 const FE_Poly<dim, spacedim> *fe_poly_ptr =
99 dynamic_cast<const FE_Poly<dim, spacedim> *>(&fe);
100
101 // we should catch the case that we cannot dynamic cast in
102 // is_fast_path_supported
103 Assert(fe_poly_ptr != nullptr, ExcNotImplemented());
104 if (const auto polyspace =
105 dynamic_cast<const TensorProductPolynomials<dim> *>(
106 &fe_poly_ptr->get_poly_space()))
107 return polyspace->get_underlying_polynomials();
108 else
110 return {};
111 }
112 } // namespace FEPointEvaluation
113} // namespace internal
114
115
116// explicit instantiations
117#include "matrix_free/fe_point_evaluation.inst"
118
119
const ScalarPolynomialsBase< dim > & get_poly_space() const
unsigned int n_components() const
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
Abstract base class for mapping classes.
Definition mapping.h:318
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define DEAL_II_NOT_IMPLEMENTED()
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
std::vector< Polynomials::Polynomial< double > > get_polynomial_space(const FiniteElement< dim, spacedim > &fe)
bool is_fast_path_supported(const FiniteElement< dim, spacedim > &fe, const unsigned int base_element_number)