Debian Codegraph @

include/deal.II/fe/fe_bernardi_raugel.h

raw
1 // ------------------------------------------------------------------------
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 // Copyright (C) 2018 - 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
15 #ifndef dealii_fe_bernardi_raugel_h
16 #define dealii_fe_bernardi_raugel_h
17
18 #include <deal.II/base/config.h>
19
20 #include <deal.II/base/geometry_info.h>
21 #include <deal.II/base/polynomial.h>
22 #include <deal.II/base/polynomials_bernardi_raugel.h>
23 #include <deal.II/base/tensor_product_polynomials.h>
24
25 #include <deal.II/fe/fe.h>
26 #include <deal.II/fe/fe_poly_tensor.h>
27
28 #include <vector>
29
30 DEAL_II_NAMESPACE_OPEN
31
32 /**
33 * The Bernardi-Raugel element.
34 *
35 * This class implements the non-standard Bernardi-Raugel (BR) element
36 * that can be used as one part of a stable velocity/pressure pair for
37 * the Stokes equation. The BR element can be seen as either an
38 * enriched version of the $Q_1^d$ element with added bubble functions
39 * on each edge (in 2d) or face (in 3d), or as a reduced version of
40 * the $Q_2^d$ element. It addresses the fact that the $Q_1^d\times
41 * Q_0$ combination is not inf-sup stable (requiring a larger velocity
42 * space), and that the $Q_2^d\times Q_1$ combination is stable but
43 * sub-optimal since the velocity space is too large relative to the
44 * pressure space to provide additional accuracy commensurate with the
45 * cost of the large number of velocity unknowns.
46 *
47 * The element was introduced in the paper @cite BR85.
48 *
49 *
50 * <h3>Degrees of freedom</h3>
51 *
52 * The BR1 element has <i>dim</i> degrees of freedom on each vertex and 1 on
53 * each face. The shape functions are ordered by the $(Q_1)^d$ shape functions
54 * supported on each vertex, increasing according to vertex ordering on the
55 * element in GeometryInfo, then the bubble functions follow in the ordering
56 * given in PolynomialsBernardiRaugel.
57 *
58 * This element only has 1 degree (degree $p=1$) because it yields an LBB stable
59 * pair BR1-P0 for Stokes problems which is lower degree than the Taylor-Hood
60 * element. The pair is sometimes referred to as an enriched P1-P0 element or a
61 * reduced P2-P0 element.
62 *
63 * This element does not support hanging nodes or multigrid in the current
64 * implementation.
65 *
66 * Some numerical experiments have shown that this element may converge with
67 * first-order accuracy when using the BR1-Q0 pair for the mixed Laplace
68 * equation in step-20.
69 */
70 template <int dim>
71 class FE_BernardiRaugel : public FE_PolyTensor<dim>
72 {
73 public:
74 /**
75 * Constructor for the Bernardi-Raugel element of degree @p p. The only
76 * supported degree is 1.
77 *
78 * @arg p: The degree of the element $p=1$ for $BR_1$.
79 */
80 FE_BernardiRaugel(const unsigned int p = 1);
81
82 /**
83 * Return a string that uniquely identifies a finite element. This class
84 * returns <tt>FE_BR<dim>(degree)</tt>, with @p dim and @p degree replaced
85 * by appropriate values.
86 */
87 virtual std::string
88 get_name() const override;
89
90 virtual std::unique_ptr<FiniteElement<dim, dim>>
91 clone() const override;
92
93 // documentation inherited from the base class
94 virtual void
95 convert_generalized_support_point_values_to_dof_values(
96 const std::vector<Vector<double>> &support_point_values,
97 std::vector<double> &nodal_values) const override;
98
99 private:
100 /**
101 * Only for internal use. Its full name is @p get_dofs_per_object_vector
102 * function and it creates the @p dofs_per_object vector that is needed
103 * within the constructor to be passed to the constructor of @p
104 * FiniteElementData.
105 */
106 static std::vector<unsigned int>
107 get_dpo_vector();
108
109 /**
110 * Initialize the FiniteElement<dim>::generalized_support_points and
111 * FiniteElement<dim>::generalized_face_support_points fields. Called from
112 * the constructor. See the
113 * @ref GlossGeneralizedSupport "glossary entry on generalized support points"
114 * for more information.
115 */
116 void
117 initialize_support_points();
118
119 /**
120 * Initialize the permutation pattern and the pattern of sign change.
121 *
122 * @note This function is not fully filled with the correct implementation
123 * yet. It needs to be consistently implemented in a future release to work
124 * on meshes that contain cells with flipped faces.
125 */
126 void
127 initialize_quad_dof_index_permutation_and_sign_change();
128 };
129
130 DEAL_II_NAMESPACE_CLOSE
131
132 #endif