| 1 |
// ------------------------------------------------------------------------ |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
// Copyright (C) 2015 - 2023 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 |
|
| 16 |
#ifndef dealii_fe_rannacher_turek_h |
| 17 |
#define dealii_fe_rannacher_turek_h |
| 18 |
|
| 19 |
#include <deal.II/base/config.h> |
| 20 |
|
| 21 |
#include <deal.II/base/polynomials_rannacher_turek.h> |
| 22 |
|
| 23 |
#include <deal.II/fe/fe_data.h> |
| 24 |
#include <deal.II/fe/fe_poly.h> |
| 25 |
|
| 26 |
#include <string> |
| 27 |
#include <vector> |
| 28 |
|
| 29 |
DEAL_II_NAMESPACE_OPEN |
| 30 |
|
| 31 |
|
| 32 |
/** |
| 33 |
* Implementation of the Rannacher-Turek element. This element is used |
| 34 |
* to generate a stable pair of function spaces for the Stokes |
| 35 |
* equation without having to increase the polynomial degree of the |
| 36 |
* velocity space as much as one would do for the stable Taylor-Hood |
| 37 |
* element which uses the $Q_2^d\times Q_1$ pair for velocity and |
| 38 |
* pressure. That said, like many other non-conforming elements, it |
| 39 |
* can also be used for the discretization of the Laplace |
| 40 |
* equation. The element was first described in R. Rannacher and |
| 41 |
* S. Turek: "Simple non-conforming quadrilateral Stokes element", |
| 42 |
* Numerical Methods for Partial Differential Equations, vol. 8, |
| 43 |
* pp. 97-112, 1992. |
| 44 |
* |
| 45 |
* The shape functions generated by this element are in general |
| 46 |
* discontinuous, and consequently the element is not $H^1$ conforming |
| 47 |
* (i.e., it is a "non-conforming" element). However, the shape |
| 48 |
* functions are constructed in such a way that the jump along faces |
| 49 |
* has mean value zero, and consequently there is <i>some</i> sort of |
| 50 |
* conformity in the element: a conforming element would have a |
| 51 |
* pointwise zero jump, a completely discontinuous element like the |
| 52 |
* FE_DGQ elements can have entirely arbitrary values for the jump |
| 53 |
* across a face, and the current element is somewhere in the middle |
| 54 |
* because its jump is nonzero but at least has mean value zero. |
| 55 |
* |
| 56 |
* The element is currently implemented only in dimension 2, for the |
| 57 |
* lowest polynomial order, and without hanging nodes and |
| 58 |
* restriction/prolongation. |
| 59 |
* |
| 60 |
* |
| 61 |
* <h3>Interpolation</h3> |
| 62 |
* |
| 63 |
* <h4>Node values</h4> |
| 64 |
* |
| 65 |
* The |
| 66 |
* @ref GlossNodes "node values" |
| 67 |
* are moments on faces. |
| 68 |
* |
| 69 |
* <h4>Generalized support points</h4> |
| 70 |
* |
| 71 |
* To calculate the node values, we are using a QGauss rule on each |
| 72 |
* face. By default, we are using a two point rule to integrate |
| 73 |
* Rannacher-Turek functions exactly. But in order to be able to |
| 74 |
* interpolate other functions with sufficient accuracy, the number of |
| 75 |
* quadrature points used on a face can be adjusted in the |
| 76 |
* constructor. |
| 77 |
* |
| 78 |
* @ingroup fe |
| 79 |
*/ |
| 80 |
template <int dim> |
| 81 |
class FE_RannacherTurek : public FE_Poly<dim> |
| 82 |
{ |
| 83 |
public: |
| 84 |
/** |
| 85 |
* Constructor for Rannacher-Turek element of given @p order, using @p |
| 86 |
* n_face_support_points quadrature points on each face for interpolation. |
| 87 |
* Notice that the element of order 0 contains polynomials of degree 2. |
| 88 |
* |
| 89 |
* The element is currently only implemented for order 0 in 2d. |
| 90 |
*/ |
| 91 |
FE_RannacherTurek(const unsigned int order = 0, |
| 92 |
const unsigned int n_face_support_points = 2); |
| 93 |
|
| 94 |
virtual std::string |
| 95 |
get_name() const override; |
| 96 |
|
| 97 |
virtual std::unique_ptr<FiniteElement<dim, dim>> |
| 98 |
clone() const override; |
| 99 |
|
| 100 |
// documentation inherited from the base class |
| 101 |
virtual void |
| 102 |
convert_generalized_support_point_values_to_dof_values( |
| 103 |
const std::vector<Vector<double>> &support_point_values, |
| 104 |
std::vector<double> &nodal_values) const override; |
| 105 |
|
| 106 |
private: |
| 107 |
/** |
| 108 |
* Order of this element. |
| 109 |
*/ |
| 110 |
const unsigned int order; |
| 111 |
|
| 112 |
/** |
| 113 |
* The number of quadrature points used on each face to evaluate node |
| 114 |
* functionals during interpolation. |
| 115 |
*/ |
| 116 |
const unsigned int n_face_support_points; |
| 117 |
|
| 118 |
/** |
| 119 |
* The weights used on the faces to evaluate node functionals. |
| 120 |
*/ |
| 121 |
std::vector<double> weights; |
| 122 |
|
| 123 |
/** |
| 124 |
* Compute generalized support points and their weights. |
| 125 |
*/ |
| 126 |
void |
| 127 |
initialize_support_points(); |
| 128 |
/** |
| 129 |
* Return information about degrees of freedom per object as needed during |
| 130 |
* construction. |
| 131 |
*/ |
| 132 |
std::vector<unsigned int> |
| 133 |
get_dpo_vector(); |
| 134 |
}; |
| 135 |
|
| 136 |
|
| 137 |
DEAL_II_NAMESPACE_CLOSE |
| 138 |
|
| 139 |
#endif |