dune-localfunctions  2.11
discontinuous.hh
Go to the documentation of this file.
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 
6 #ifndef DUNE_LOCALFUNCTIONS_META_DISCONTINUOUS_HH
7 #define DUNE_LOCALFUNCTIONS_META_DISCONTINUOUS_HH
8 
9 #include <utility>
10 
11 #include <dune/common/referencehelper.hh>
12 #include <dune/geometry/type.hh>
14 
15 namespace Dune {
16 
19 
24  template<class LFE>
26  {
27  using LFERaw = ResolveRef_t<LFE>;
28 
29  using LB = typename LFERaw::Traits::LocalBasisType;
30  using LC = typename LFERaw::Traits::LocalCoefficientsType;
31  using LI = typename LFERaw::Traits::LocalInterpolationType;
32 
33  public:
35  struct Traits {
37  using LocalBasisType = LB;
42  };
43 
44  private:
45  LFE lfe_;
46  typename Traits::LocalCoefficientsType lc_;
47 
48  public:
50  template <class LFE_>
51  explicit DiscontinuousLocalFiniteElement (LFE_&& lfe)
52  : lfe_(std::forward<LFE_>(lfe))
53  , lc_(resolveRef(lfe_).localCoefficients().size())
54  {}
55 
57 
61  const typename Traits::LocalBasisType& localBasis () const
62  {
63  return resolveRef(lfe_).localBasis();
64  }
65 
67 
72  {
73  return lc_;
74  }
75 
77 
82  {
83  return resolveRef(lfe_).localInterpolation();
84  }
85 
87  unsigned int size () const
88  {
89  return resolveRef(lfe_).size();
90  }
91 
93  const GeometryType type () const
94  {
95  return resolveRef(lfe_).type();
96  }
97  };
98 
99  // deduction guide
100  template <class LFE>
102  -> DiscontinuousLocalFiniteElement<LFE>;
103 
104 } // namespace Dune
105 
106 #endif // DUNE_LOCALFUNCTIONS_META_DISCONTINUOUS_HH
const GeometryType type() const
Return the geometry type the finite element can be bound to.
Definition: discontinuous.hh:93
DiscontinuousLocalFiniteElement(LFE lfe) -> DiscontinuousLocalFiniteElement< LFE >
A class providing local coefficients for dg spaces.
Definition: dglocalcoefficients.hh:22
types of component objects
Definition: discontinuous.hh:35
Definition: bdfmcube.hh:17
Meta-finite element turning a finite-element into "discontinuous" finite-element by associating all b...
Definition: discontinuous.hh:25
LI LocalInterpolationType
type of the Interpolation
Definition: discontinuous.hh:41
const Traits::LocalCoefficientsType & localCoefficients() const
Extract coefficients of this finite element.
Definition: discontinuous.hh:71
const Traits::LocalBasisType & localBasis() const
Extract basis of this finite element.
Definition: discontinuous.hh:61
STL namespace.
unsigned int size() const
Return the number of basis functions.
Definition: discontinuous.hh:87
DiscontinuousLocalFiniteElement(LFE_ &&lfe)
Construct a finite element.
Definition: discontinuous.hh:51
LB LocalBasisType
type of the Basis
Definition: discontinuous.hh:37
const Traits::LocalInterpolationType & localInterpolation() const
Extract interpolation of this finite element.
Definition: discontinuous.hh:81