Dune Core Modules (unstable)

refinedp0.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#ifndef DUNE_REFINED_P0_LOCALFINITEELEMENT_HH
6#define DUNE_REFINED_P0_LOCALFINITEELEMENT_HH
7
9
10#include <dune/localfunctions/common/localfiniteelementtraits.hh>
11#include <dune/localfunctions/lagrange/p0.hh>
12
13#include "refinedp0/refinedp0localbasis.hh"
14#include "refinedp0/refinedp0localcoefficients.hh"
15#include "refinedp0/refinedp0localinterpolation.hh"
16
20namespace Dune
21{
22
27 template<class D, class R, int dim>
29 {
31
32 public:
33 // We steal the p0 traits since they exist for all dim.
34 // This allows to instantiate the type and access the Traits.
36 };
37
42 template<class D, class R>
44 {
45 public:
51 RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,1> > > Traits;
52
56 {}
57
60 const typename Traits::LocalBasisType& localBasis () const
61 {
62 return basis_;
63 }
64
68 {
69 return coefficients_;
70 }
71
75 {
76 return interpolation_;
77 }
78
80 unsigned int size () const
81 {
82 return basis_.size();
83 }
84
87 static constexpr GeometryType type ()
88 {
90 }
91
92 private:
95 RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,1> > interpolation_;
96 };
97
102 template<class D, class R>
104 {
105 public:
111 RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,2> > > Traits;
112
116 {}
117
120 const typename Traits::LocalBasisType& localBasis () const
121 {
122 return basis_;
123 }
124
128 {
129 return coefficients_;
130 }
131
135 {
136 return interpolation_;
137 }
138
140 unsigned int size () const
141 {
142 return basis_.size();
143 }
144
147 static constexpr GeometryType type ()
148 {
150 }
151
152 private:
154 RefinedP0LocalCoefficients<2> coefficients_;
155 RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,2> > interpolation_;
156 };
157
162 template<class D, class R>
164 {
165 public:
171 RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,3> > > Traits;
172
176 {}
177
180 const typename Traits::LocalBasisType& localBasis () const
181 {
182 return basis_;
183 }
184
188 {
189 return coefficients_;
190 }
191
195 {
196 return interpolation_;
197 }
198
200 unsigned int size () const
201 {
202 return basis_.size();
203 }
204
207 static constexpr GeometryType type ()
208 {
210 }
211
212 private:
214 RefinedP0LocalCoefficients<3> coefficients_;
215 RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,3> > interpolation_;
216 };
217
218
219}
220
221#endif
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
const Traits::LocalBasisType & localBasis() const
Definition: refinedp0.hh:60
static constexpr GeometryType type()
Definition: refinedp0.hh:87
RefinedP0LocalFiniteElement()
Definition: refinedp0.hh:55
const Traits::LocalInterpolationType & localInterpolation() const
Definition: refinedp0.hh:74
const Traits::LocalCoefficientsType & localCoefficients() const
Definition: refinedp0.hh:67
LocalFiniteElementTraits< RefinedP0LocalBasis< D, R, 1 >, RefinedP0LocalCoefficients< 1 >, RefinedP0LocalInterpolation< RefinedP0LocalBasis< D, R, 1 > > > Traits
Definition: refinedp0.hh:51
unsigned int size() const
Number of shape functions in this finite element.
Definition: refinedp0.hh:80
unsigned int size() const
Number of shape functions in this finite element.
Definition: refinedp0.hh:140
RefinedP0LocalFiniteElement()
Definition: refinedp0.hh:115
static constexpr GeometryType type()
Definition: refinedp0.hh:147
LocalFiniteElementTraits< RefinedP0LocalBasis< D, R, 2 >, RefinedP0LocalCoefficients< 2 >, RefinedP0LocalInterpolation< RefinedP0LocalBasis< D, R, 2 > > > Traits
Definition: refinedp0.hh:111
const Traits::LocalCoefficientsType & localCoefficients() const
Definition: refinedp0.hh:127
const Traits::LocalInterpolationType & localInterpolation() const
Definition: refinedp0.hh:134
const Traits::LocalBasisType & localBasis() const
Definition: refinedp0.hh:120
RefinedP0LocalFiniteElement()
Definition: refinedp0.hh:175
const Traits::LocalBasisType & localBasis() const
Definition: refinedp0.hh:180
const Traits::LocalInterpolationType & localInterpolation() const
Definition: refinedp0.hh:194
static constexpr GeometryType type()
Definition: refinedp0.hh:207
unsigned int size() const
Number of shape functions in this finite element.
Definition: refinedp0.hh:200
const Traits::LocalCoefficientsType & localCoefficients() const
Definition: refinedp0.hh:187
LocalFiniteElementTraits< RefinedP0LocalBasis< D, R, 3 >, RefinedP0LocalCoefficients< 3 >, RefinedP0LocalInterpolation< RefinedP0LocalBasis< D, R, 3 > > > Traits
Definition: refinedp0.hh:171
Local finite element that is piecewise P0 on a once uniformly refined reference geometry.
Definition: refinedp0.hh:29
constexpr GeometryType line
GeometryType representing a line.
Definition: type.hh:498
constexpr GeometryType triangle
GeometryType representing a triangle.
Definition: type.hh:504
constexpr GeometryType tetrahedron
GeometryType representing a tetrahedron.
Definition: type.hh:516
Dune namespace.
Definition: alignedallocator.hh:13
traits helper struct
Definition: localfiniteelementtraits.hh:13
LB LocalBasisType
Definition: localfiniteelementtraits.hh:16
LC LocalCoefficientsType
Definition: localfiniteelementtraits.hh:20
LI LocalInterpolationType
Definition: localfiniteelementtraits.hh:24
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)