Reference documentation for deal.II version 9.5.0
\(\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// Copyright (C) 2021 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.md at
12// the top level directory of deal.II.
13//
14// ---------------------------------------------------------------------
15
18
19#include <deal.II/fe/fe_dgp.h>
20#include <deal.II/fe/fe_dgq.h>
21#include <deal.II/fe/fe_poly.h>
22#include <deal.II/fe/fe_q_dg0.h>
23
26
27#include <memory>
28
30
31
32namespace internal
33{
34 namespace FEPointEvaluation
35 {
40 template <int dim, int spacedim>
41 bool
43 const unsigned int base_element_number)
44 {
45 // check if supported
46 const bool flag = [&]() {
47 if (dim != spacedim)
48 return false;
49
50 const FiniteElement<dim, spacedim> *fe_ptr =
51 &(fe.base_element(base_element_number));
52 if (fe_ptr->n_components() != 1)
53 return false;
54
55 // then check if the base element is supported or not
56 if (dynamic_cast<const FE_Poly<dim, spacedim> *>(fe_ptr) != nullptr)
57 {
58 const FE_Poly<dim, spacedim> *fe_poly_ptr =
59 dynamic_cast<const FE_Poly<dim, spacedim> *>(fe_ptr);
60
61 if (dynamic_cast<const TensorProductPolynomials<dim> *>(
62 &fe_poly_ptr->get_poly_space()) == nullptr)
63 return false;
64 }
65 else
66 return false;
67
68 return true;
69 }();
70
71 // make sure that if supported also ShapeInfo is supporting it
72 if (flag)
74 fe),
76
77 return flag;
78 }
79
80
81
82 template <int dim, int spacedim>
83 bool
85 {
86 if (dynamic_cast<const MappingQ<dim, spacedim> *>(&mapping))
87 {
88 return true;
89 }
90 else if (dynamic_cast<const MappingCartesian<dim, spacedim> *>(&mapping))
91 {
92 return true;
93 }
94 return false;
95 }
96
97
98
99 template <int dim, int spacedim>
100 std::vector<Polynomials::Polynomial<double>>
102 {
104 const FE_Poly<dim, spacedim> *fe_poly_ptr =
105 dynamic_cast<const FE_Poly<dim, spacedim> *>(&fe);
106
107 // we should catch the case that we cannot dynamic cast in
108 // is_fast_path_supported
109 Assert(fe_poly_ptr != nullptr, ExcNotImplemented());
110 if (const auto polyspace =
111 dynamic_cast<const TensorProductPolynomials<dim> *>(
112 &fe_poly_ptr->get_poly_space()))
113 return polyspace->get_underlying_polynomials();
114 else
115 Assert(false, ExcNotImplemented());
116 return {};
117 }
118 } // namespace FEPointEvaluation
119} // namespace internal
120
121
122// explicit instantiations
123#include "fe_point_evaluation.inst"
124
125
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:317
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
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)