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
polynomials_raviart_thomas.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) 2005 - 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
13
17
18#include <iomanip>
19#include <iostream>
20#include <memory>
21
22
24
25
26
27template <int dim>
29 : PolynomialsVectorAnisotropic<dim>(k + 1, k, get_lexicographic_numbering(k))
30{}
31
32
33
34template <int dim>
35unsigned int
37{
38 return PolynomialsVectorAnisotropic<dim>::n_polynomials(degree + 1, degree);
39}
40
41
42
43template <int dim>
44std::vector<unsigned int>
46 const unsigned int degree)
47{
48 const unsigned int n_dofs_face = Utilities::pow(degree + 1, dim - 1);
49 std::vector<unsigned int> lexicographic_numbering;
50
51 // component 1
52 for (unsigned int j = 0; j < n_dofs_face; ++j)
53 {
54 lexicographic_numbering.push_back(j);
55 for (unsigned int i = n_dofs_face * 2 * dim;
56 i < n_dofs_face * 2 * dim + degree;
57 ++i)
58 lexicographic_numbering.push_back(i + j * degree);
59 lexicographic_numbering.push_back(n_dofs_face + j);
60 }
61
62 // component 2
63 unsigned int layers = (dim == 3) ? degree + 1 : 1;
64 for (unsigned int k = 0; k < layers; ++k)
65 {
66 unsigned int k_add = k * (degree + 1);
67 for (unsigned int j = n_dofs_face * 2; j < n_dofs_face * 2 + degree + 1;
68 ++j)
69 lexicographic_numbering.push_back(j + k_add);
70
71 for (unsigned int i = n_dofs_face * (2 * dim + degree);
72 i < n_dofs_face * (2 * dim + degree) + degree * (degree + 1);
73 ++i)
74 lexicographic_numbering.push_back(i + k_add * degree);
75 for (unsigned int j = n_dofs_face * 3; j < n_dofs_face * 3 + degree + 1;
76 ++j)
77 lexicographic_numbering.push_back(j + k_add);
78 }
79
80 // component 3
81 if (dim == 3)
82 {
83 for (unsigned int i = 4 * n_dofs_face; i < 5 * n_dofs_face; ++i)
84 lexicographic_numbering.push_back(i);
85 for (unsigned int i = 6 * n_dofs_face + n_dofs_face * 2 * degree;
86 i < 6 * n_dofs_face + n_dofs_face * 3 * degree;
87 ++i)
88 lexicographic_numbering.push_back(i);
89 for (unsigned int i = 5 * n_dofs_face; i < 6 * n_dofs_face; ++i)
90 lexicographic_numbering.push_back(i);
91 }
92
93 return lexicographic_numbering;
94}
95
96
97
98template <int dim>
99std::unique_ptr<TensorPolynomialsBase<dim>>
101{
102 return std::make_unique<PolynomialsRaviartThomas<dim>>(*this);
103}
104
105
106
107template class PolynomialsRaviartThomas<1>;
108template class PolynomialsRaviartThomas<2>;
109template class PolynomialsRaviartThomas<3>;
110
111
static unsigned int n_polynomials(const unsigned int degree)
PolynomialsRaviartThomas(const unsigned int k)
static std::vector< unsigned int > get_lexicographic_numbering(const unsigned int degree)
virtual std::unique_ptr< TensorPolynomialsBase< dim > > clone() const override
static unsigned int n_polynomials(const unsigned int normal_degree, const unsigned int tangential_degree)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
constexpr T pow(const T base, const int iexp)
Definition utilities.h:966