Debian Codegraph @

dune/localfunctions/enriched/simplexp1bubble.hh

raw
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 // SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5 #ifndef DUNE_LOCALFUNCTIONS_ENRICHED_SIMPLEXP1BUBBLE_HH
6 #define DUNE_LOCALFUNCTIONS_ENRICHED_SIMPLEXP1BUBBLE_HH
7
8 #include <dune/geometry/type.hh>
9
10 #include <dune/localfunctions/common/localfiniteelementtraits.hh>
11 #include <dune/localfunctions/enriched/simplexp1bubble/localbasis.hh>
12 #include <dune/localfunctions/enriched/simplexp1bubble/localcoefficients.hh>
13 #include <dune/localfunctions/enriched/simplexp1bubble/localinterpolation.hh>
14
15
16 namespace Dune
17 {
18 /**
19 * \brief Linear Lagrange functions enriched with an element bubble function.
20 *
21 * The set of basis functions contains the classical Lagrange basis functions
22 * of order 1, i.e., the barycentric coordinates, and a single element "bubble"
23 * function that vanishes on all faces of the element. The bubble function is
24 * simply defined as the product of all linear basis functions and thus has
25 * polynomial order `dim+1`.
26 *
27 * A classical example where this kind of basis is used in the discretization
28 * of the Stokes equation with the stable mixed-element called MINI element,
29 * see
30 *
31 * Arnold, D.N., Brezzi, F. and Fortin, M. A stable finite element for the
32 * Stokes equations. Calcolo 21, 337-344 (1984). doi: 10.1007/BF02576171
33 *
34 * The velocity field is discretized with continuous piecewise linear
35 * functions enriched by a bubble function.
36 *
37 * \note The implementation here is restricted to simplex elements.
38 *
39 * \tparam D Type to represent the field in the domain.
40 * \tparam R Type to represent the field in the range.
41 * \tparam dim Dimension of the domain.
42 **/
43 template<class D, class R, int dim>
44 class SimplexP1BubbleLocalFiniteElement
45 {
46 public:
47 //! Type of the local basis
48 using LocalBasisType = SimplexP1BubbleLocalBasis<D,R,dim>;
49
50 //! Type of the local coefficients
51 using LocalCoefficientsType = SimplexP1BubbleLocalCoefficients<dim>;
52
53 //! Type of the local interpolation
54 using LocalInterpolationType = SimplexP1BubbleLocalInterpolation<LocalBasisType>;
55
56 //! Traits type that specifies the local basis, coefficients, and interpolation type.
57 using Traits = LocalFiniteElementTraits<LocalBasisType,LocalCoefficientsType,LocalInterpolationType>;
58
59
60 //! Returns the local basis, i.e., the set of shape functions
61 const LocalBasisType& localBasis () const
62 {
63 return basis_;
64 }
65
66 //! Returns the assignment of the degrees of freedom to the element subentities
67 const LocalCoefficientsType& localCoefficients () const
68 {
69 return coefficients_;
70 }
71
72 //! Returns object that evaluates degrees of freedom
73 const LocalInterpolationType& localInterpolation () const
74 {
75 return interpolation_;
76 }
77
78 //! Returns the number of shape functions in this finite-element
79 static constexpr std::size_t size () noexcept
80 {
81 return LocalBasisType::size();
82 }
83
84 //! Returns the type of the geometry the finite-element is attached to
85 static constexpr GeometryType type () noexcept
86 {
87 return GeometryTypes::simplex(dim);
88 }
89
90 private:
91 LocalCoefficientsType coefficients_{};
92 [[no_unique_address]] LocalBasisType basis_{};
93 [[no_unique_address]] LocalInterpolationType interpolation_{};
94 };
95
96 } // end namespace Dune
97
98 #endif // DUNE_LOCALFUNCTIONS_ENRICHED_SIMPLEXP1BUBBLE_HH