deal.II version 9.7.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
polynomials_raviart_thomas.cc
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: 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// 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
15
19
20#include <iomanip>
21#include <iostream>
22#include <memory>
23
24
26
27
28
29template <int dim>
33
34
35
36template <int dim>
37unsigned int
42
43
44
45template <int dim>
46std::vector<unsigned int>
48 const unsigned int degree)
49{
50 const unsigned int n_dofs_face = Utilities::pow(degree + 1, dim - 1);
51 std::vector<unsigned int> lexicographic_numbering;
52
53 // component 1
54 for (unsigned int j = 0; j < n_dofs_face; ++j)
55 {
56 lexicographic_numbering.push_back(j);
57 for (unsigned int i = n_dofs_face * 2 * dim;
58 i < n_dofs_face * 2 * dim + degree;
59 ++i)
60 lexicographic_numbering.push_back(i + j * degree);
61 lexicographic_numbering.push_back(n_dofs_face + j);
62 }
63
64 // component 2
65 unsigned int layers = (dim == 3) ? degree + 1 : 1;
66 for (unsigned int k = 0; k < layers; ++k)
67 {
68 unsigned int k_add = k * (degree + 1);
69 for (unsigned int j = n_dofs_face * 2; j < n_dofs_face * 2 + degree + 1;
70 ++j)
71 lexicographic_numbering.push_back(j + k_add);
72
73 for (unsigned int i = n_dofs_face * (2 * dim + degree);
74 i < n_dofs_face * (2 * dim + degree) + degree * (degree + 1);
75 ++i)
76 lexicographic_numbering.push_back(i + k_add * degree);
77 for (unsigned int j = n_dofs_face * 3; j < n_dofs_face * 3 + degree + 1;
78 ++j)
79 lexicographic_numbering.push_back(j + k_add);
80 }
81
82 // component 3
83 if (dim == 3)
84 {
85 for (unsigned int i = 4 * n_dofs_face; i < 5 * n_dofs_face; ++i)
86 lexicographic_numbering.push_back(i);
87 for (unsigned int i = 6 * n_dofs_face + n_dofs_face * 2 * degree;
88 i < 6 * n_dofs_face + n_dofs_face * 3 * degree;
89 ++i)
90 lexicographic_numbering.push_back(i);
91 for (unsigned int i = 5 * n_dofs_face; i < 6 * n_dofs_face; ++i)
92 lexicographic_numbering.push_back(i);
93 }
94
95 return lexicographic_numbering;
96}
97
98
99
100template <int dim>
101std::unique_ptr<TensorPolynomialsBase<dim>>
103{
104 return std::make_unique<PolynomialsRaviartThomas<dim>>(*this);
105}
106
107
108
109template class PolynomialsRaviartThomas<1>;
110template class PolynomialsRaviartThomas<2>;
111template class PolynomialsRaviartThomas<3>;
112
113
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
PolynomialsVectorAnisotropic(const unsigned int degree_normal, const unsigned int degree_tangential, const std::vector< unsigned int > &polynomial_ordering)
static unsigned int n_polynomials(const unsigned int normal_degree, const unsigned int tangential_degree)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:40
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:41
constexpr T pow(const T base, const int iexp)
Definition utilities.h:967