| 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_BREZZIDOUGLASFORTINMARINI_BDFMCUBE_HH |
| 6 | #define DUNE_LOCALFUNCTIONS_BREZZIDOUGLASFORTINMARINI_BDFMCUBE_HH |
| 7 | |
| 8 | #include <dune/geometry/type.hh> |
| 9 | |
| 10 | #include <dune/localfunctions/common/localfiniteelementtraits.hh> |
| 11 | |
| 12 | #include <dune/localfunctions/brezzidouglasfortinmarini/cube/localbasis.hh> |
| 13 | #include <dune/localfunctions/brezzidouglasfortinmarini/cube/localcoefficients.hh> |
| 14 | #include <dune/localfunctions/brezzidouglasfortinmarini/cube/localinterpolation.hh> |
| 15 | |
| 16 | |
| 17 | namespace Dune |
| 18 | { |
| 19 | |
| 20 | /** |
| 21 | * \brief Brezzi-Douglas-Fortin-Marini finite elements for cubes |
| 22 | * |
| 23 | * Brezzi-Douglas-Fortin-Marini (BDFM) finite elements are reduced |
| 24 | * Brezzi-Douglas-Marini (BDM) finite elements, where the order of |
| 25 | * the normal traces is lowered by one. |
| 26 | * |
| 27 | * On a quadrilateral K the BDFM element is given by |
| 28 | * |
| 29 | * \f$BDFM_k = (P_k(K)\setminus\{y^k\})\times(P_k(K)\setminus\{x^k\})\quad(k\geq1)\f$ |
| 30 | * |
| 31 | * The BDFM1 element is identical to the RT0 element. |
| 32 | * |
| 33 | * For further reading see |
| 34 | * Brezzi, Fortin "Mixed and Hybrid Finite Element Methods" (1991), Chapter III Section 3 |
| 35 | * |
| 36 | * \ingroup BrezziDouglasFortinMarini |
| 37 | * |
| 38 | * \tparam D Type to represent the field in the domain. |
| 39 | * \tparam R Type to represent the field in the range. |
| 40 | * \tparam dim dimension of the reference elements, must be >= 2. |
| 41 | * \tparam order order of the element, must be >= 1. |
| 42 | */ |
| 43 | template<class D, class R, unsigned int dim, unsigned int order> |
| 44 | class BDFMCubeLocalFiniteElement |
| 45 | { |
| 46 | using LocalBasis = BDFMCubeLocalBasis<D, R, dim, order>; |
| 47 | using LocalCoefficients = BDFMCubeLocalCoefficients<D, R, dim, order>; |
| 48 | using LocalInterpolation = BDFMCubeLocalInterpolation<D, R, dim, order>; |
| 49 | |
| 50 | public: |
| 51 | using Traits = LocalFiniteElementTraits<LocalBasis, LocalCoefficients, LocalInterpolation >; |
| 52 | |
| 53 | //! \brief Standard constructor |
| 54 | BDFMCubeLocalFiniteElement () {} |
| 55 | |
| 56 | /** |
| 57 | * \brief Make set number s, where 0 <= s < 2^(2*dim) |
| 58 | * |
| 59 | * \param s Edge orientation indicator |
| 60 | */ |
| 61 | BDFMCubeLocalFiniteElement (std::bitset<2*dim> s) |
| 62 | : basis( s ), interpolation( s ) |
| 63 | {} |
| 64 | |
| 65 | auto localBasis () const -> const LocalBasis& { return basis; } |
| 66 | auto localCoefficients () const -> const LocalCoefficients& { return coefficients; } |
| 67 | auto localInterpolation () const -> const LocalInterpolation& { return interpolation; } |
| 68 | |
| 69 | /** \brief Number of shape functions in this finite element */ |
| 70 | unsigned int size () const { return basis.size(); } |
| 71 | static constexpr auto type () -> GeometryType { return GeometryTypes::cube(dim); } |
| 72 | |
| 73 | private: |
| 74 | LocalBasis basis; |
| 75 | LocalCoefficients coefficients; |
| 76 | LocalInterpolation interpolation; |
| 77 | }; |
| 78 | |
| 79 | } // namespace Dune |
| 80 | |
| 81 | #endif // #ifndef DUNE_LOCALFUNCTIONS_BREZZIDOUGLASFORTINMARINI_BDFMCUBE_HH |