1#ifndef DUNE_FEM_SPACE_RAVIARTTHOMAS_SPACE_HH
2#define DUNE_FEM_SPACE_RAVIARTTHOMAS_SPACE_HH
4#if HAVE_DUNE_LOCALFUNCTIONS
17#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
18#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
19#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
20#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
21#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
22#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
23#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
24#include <dune/localfunctions/raviartthomas/raviartthomas3cube2d.hh>
25#include <dune/localfunctions/raviartthomas/raviartthomas4cube2d.hh>
28#include <dune/fem/space/common/uniquefacetorientation.hh>
29#include <dune/fem/space/basisfunctionset/piolatransformation.hh>
30#include <dune/fem/space/localfiniteelement/space.hh>
45 template<
unsigned int id,
class DomainField,
class RangeField,
int dimension,
int order >
46 struct RaviartThomasLocalFiniteElement
48 static_assert( AlwaysFalse< DomainField >::value,
"RaviartThomasLocalFiniteElement not implemented for your choice." );
52 template<
class D,
class R >
54 :
public RT02DLocalFiniteElement< D, R >
56 static constexpr std::size_t numOrientations = 8;
57 using RT02DLocalFiniteElement< D, R >::RT02DLocalFiniteElement;
61 template<
class D,
class R >
63 :
public RT12DLocalFiniteElement< D, R >
65 static constexpr std::size_t numOrientations = 8;
66 using RT12DLocalFiniteElement< D, R >::RT12DLocalFiniteElement;
70 template<
class D,
class R >
72 :
public RT0Cube2DLocalFiniteElement< D, R >
74 static constexpr std::size_t numOrientations = 16;
75 using RT0Cube2DLocalFiniteElement< D, R >::RT0Cube2DLocalFiniteElement;
79 template<
class D,
class R >
81 :
public RT1Cube2DLocalFiniteElement< D, R >
83 static constexpr std::size_t numOrientations = 16;
84 using RT1Cube2DLocalFiniteElement< D, R >::RT1Cube2DLocalFiniteElement;
88 template<
class D,
class R >
90 :
public RT2Cube2DLocalFiniteElement< D, R >
92 static constexpr std::size_t numOrientations = 16;
93 using RT2Cube2DLocalFiniteElement< D, R >::RT2Cube2DLocalFiniteElement;
97 template<
class D,
class R >
99 :
public RT3Cube2DLocalFiniteElement< D, R >
101 static constexpr std::size_t numOrientations = 16;
102 using RT3Cube2DLocalFiniteElement< D, R >::RT3Cube2DLocalFiniteElement;
106 template<
class D,
class R >
108 :
public RT4Cube2DLocalFiniteElement< D, R >
110 static constexpr std::size_t numOrientations = 16;
111 using RT4Cube2DLocalFiniteElement< D, R >::RT4Cube2DLocalFiniteElement;
115 template<
class D,
class R >
117 :
public RT0Cube3DLocalFiniteElement< D, R >
119 static constexpr std::size_t numOrientations = 64;
120 using RT0Cube3DLocalFiniteElement< D, R >::RT0Cube3DLocalFiniteElement;
124 template<
class D,
class R >
126 :
public RT1Cube3DLocalFiniteElement< D, R >
128 static constexpr std::size_t numOrientations = 64;
129 using RT1Cube3DLocalFiniteElement< D, R >::RT1Cube3DLocalFiniteElement;
138 template<
class Gr
idPart,
class FunctionSpace,
int polOrder >
139 class RaviartThomasLocalFiniteElementMap
141 using hasSingleGeometryType = GridPartCapabilities::hasSingleGeometryType< GridPart >;
143 static_assert( hasSingleGeometryType::v,
"`GridPart` has more the one geometry type." );
145 static constexpr int dimLocal = GridPart::dimension;
146 static constexpr unsigned int topologyId = hasSingleGeometryType::topologyId;
150 using Geometry =
typename GridPart::template Codim< 0 >::EntityType::Geometry;
153 using GridPartType = GridPart;
158 using KeyType = std::tuple<>;
160 using TransformationType = PiolaTransformation< Geometry, FunctionSpace::dimRange >;
162 using LocalFiniteElementType =
163 Impl::RaviartThomasLocalFiniteElement< topologyId, DomainFieldType, RangeFieldType, dimLocal, polOrder >;
165 using LocalBasisType =
typename LocalFiniteElementType::Traits::LocalBasisType;
166 using LocalCoefficientsType =
typename LocalFiniteElementType::Traits::LocalCoefficientsType;
167 using LocalInterpolationType =
typename LocalFiniteElementType::Traits::LocalInterpolationType;
169 static constexpr auto size () -> std::size_t {
return LocalFiniteElementType::numOrientations; }
171 template<
class ... Args >
172 RaviartThomasLocalFiniteElementMap (
const GridPartType& gridPart, Args&& ... )
173 : orientation_( gridPart )
175 for (
auto i : range(
size() ) )
176 map_[ i ] = LocalFiniteElementType( i );
179 int order ()
const {
return polOrder; }
181 template<
class Entity >
182 int order (
const Entity& entity )
const {
return order; }
184 template<
class Entity >
185 auto operator() (
const Entity& entity )
const
186 -> std::tuple< std::size_t, const LocalBasisType&, const LocalInterpolationType& >
188 auto o = orientation_( entity );
189 return std::tuple< std::size_t, const LocalBasisType&, const LocalInterpolationType& >(
190 static_cast< std::size_t
>( o ), map_[ o ].localBasis(), map_[ o ].localInterpolation() );
193 auto localCoefficients (
const GeometryType& type )
const
194 ->
const LocalCoefficientsType&
196 return map_[ 0 ].localCoefficients();
199 bool hasCoefficients (
const GeometryType& type )
const {
return type ==
GeometryType( topologyId, dimLocal ); }
200 auto gridPart () const -> const GridPartType& {
return orientation_.gridPart(); }
203 UniqueFacetOrientation< GridPartType > orientation_;
204 std::array< LocalFiniteElementType, LocalFiniteElementType::numOrientations > map_;
211 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage = CachingStorage >
212 using RaviartThomasSpace
213 = LocalFiniteElementSpace< RaviartThomasLocalFiniteElementMap< GridPart, FunctionSpace, polOrder >, FunctionSpace, Storage >;
FunctionSpaceTraits::DomainFieldType DomainFieldType
Intrinsic type used for values in the domain field (usually a double)
Definition: functionspaceinterface.hh:60
@ dimRange
dimension of range vector space
Definition: functionspaceinterface.hh:48
FunctionSpaceTraits::RangeFieldType RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspaceinterface.hh:63
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
constexpr GeometryType cube(unsigned int dim)
Returns a GeometryType representing a hypercube of dimension dim.
Definition: type.hh:462
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:453
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
A unique label for each type of element that can occur in a grid.
Traits for type conversions and type information.