Reference documentation for deal.II version GIT relicensing-384-g4769914377 2024-04-13 09:00:02+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: LGPL-2.1-or-later
4// Copyright (C) 2021 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
17
18#include <deal.II/fe/fe_dgp.h>
19#include <deal.II/fe/fe_dgq.h>
20#include <deal.II/fe/fe_poly.h>
21#include <deal.II/fe/fe_q_dg0.h>
22
25
26#include <memory>
27
29
30
31namespace internal
32{
33 namespace FEPointEvaluation
34 {
39 template <int dim, int spacedim>
40 bool
42 const unsigned int base_element_number)
43 {
44 // check if supported
45 const bool flag = [&]() {
46 const FiniteElement<dim, spacedim> *fe_ptr =
47 &(fe.base_element(base_element_number));
48 if (fe_ptr->n_components() != 1)
49 return false;
50
51 // then check if the base element is supported or not
52 if (dynamic_cast<const FE_Poly<dim, spacedim> *>(fe_ptr) != nullptr)
53 {
54 const FE_Poly<dim, spacedim> *fe_poly_ptr =
55 dynamic_cast<const FE_Poly<dim, spacedim> *>(fe_ptr);
56
57 if (dynamic_cast<const TensorProductPolynomials<dim> *>(
58 &fe_poly_ptr->get_poly_space()) == nullptr)
59 return false;
60 }
61 else
62 return false;
63
64 return true;
65 }();
66
67 // make sure that if supported also ShapeInfo is supporting it
68 if (flag)
70 fe),
72
73 return flag;
74 }
75
76
77
78 template <int dim, int spacedim>
79 bool
81 {
82 if (dynamic_cast<const MappingQ<dim, spacedim> *>(&mapping))
83 {
84 return true;
85 }
86 else if (dynamic_cast<const MappingCartesian<dim, spacedim> *>(&mapping))
87 {
88 return true;
89 }
90 return false;
91 }
92
93
94
95 template <int dim, int spacedim>
96 std::vector<Polynomials::Polynomial<double>>
98 {
100 const FE_Poly<dim, spacedim> *fe_poly_ptr =
101 dynamic_cast<const FE_Poly<dim, spacedim> *>(&fe);
102
103 // we should catch the case that we cannot dynamic cast in
104 // is_fast_path_supported
105 Assert(fe_poly_ptr != nullptr, ExcNotImplemented());
106 if (const auto polyspace =
107 dynamic_cast<const TensorProductPolynomials<dim> *>(
108 &fe_poly_ptr->get_poly_space()))
109 return polyspace->get_underlying_polynomials();
110 else
112 return {};
113 }
114 } // namespace FEPointEvaluation
115} // namespace internal
116
117
118// explicit instantiations
119#include "fe_point_evaluation.inst"
120
121
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:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
#define DEAL_II_NOT_IMPLEMENTED()
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)