1#ifndef DUNE_FEM_SPACE_BREZZIDOUGLASMARINI_HH
2#define DUNE_FEM_SPACE_BREZZIDOUGLASMARINI_HH
4#if HAVE_DUNE_LOCALFUNCTIONS
29 template<
unsigned int id,
class DomainField,
class RangeField,
int dimension,
int order >
30 struct BDMLocalFiniteElement
32 static const int numOrientations = 0;
40 struct BDMLocalFiniteElement<
Dune::GeometryTypes::cube(2).
id(), D, D, 2, 1 >
41 :
public BDM1Cube2DLocalFiniteElement< D, D >
43 static const int numOrientations = 16;
44 template<
class ... Args >
45 BDMLocalFiniteElement ( Args && ... args )
46 : BDM1Cube2DLocalFiniteElement< D, D >(
std::
forward< Args >( args ) ... ) {}
51 struct BDMLocalFiniteElement<
Dune::GeometryTypes::cube(3).
id(), D, D, 3, 1 >
52 :
public BDM1Cube3DLocalFiniteElement< D, D >
54 static const int numOrientations = 64;
55 template<
class ... Args >
56 BDMLocalFiniteElement ( Args && ... args )
57 : BDM1Cube3DLocalFiniteElement< D, D >(
std::
forward< Args >( args ) ... ) {}
62 struct BDMLocalFiniteElement<
Dune::GeometryTypes::cube(2).
id(), D, D, 2, 2 >
63 :
public BDM2Cube2DLocalFiniteElement< D, D >
65 static const int numOrientations = 16;
66 template<
class ... Args >
67 BDMLocalFiniteElement ( Args && ... args )
68 : BDM2Cube2DLocalFiniteElement< D, D >(
std::
forward< Args >( args ) ... ) {}
74 struct BDMLocalFiniteElement<
Dune::GeometryTypes::simplex(2).
id(), D, D, 2, 1 >
75 :
public BDM1Simplex2DLocalFiniteElement< D, D >
77 static const int numOrientations = 8;
78 template<
class ... Args >
79 BDMLocalFiniteElement ( Args && ... args )
80 : BDM1Simplex2DLocalFiniteElement< D, D >(
std::
forward< Args >( args ) ... ) {}
85 struct BDMLocalFiniteElement<
Dune::GeometryTypes::simplex(2).
id(), D, D, 2, 2 >
86 :
public BDM2Simplex2DLocalFiniteElement< D, D >
88 static const int numOrientations = 8;
89 template<
class ... Args >
90 BDMLocalFiniteElement ( Args && ... args )
91 : BDM2Simplex2DLocalFiniteElement< D, D >(
std::
forward< Args >( args ) ... ) {}
99 template<
class GridPart,
class FunctionSpace,
int polOrder = -1 >
100 class BrezziDouglasMariniLocalFiniteElementMap
102 typedef BrezziDouglasMariniLocalFiniteElementMap< GridPart, FunctionSpace, polOrder > ThisType;
104 "GridPart has more than one geometry type." );
109 typedef unsigned int KeyType;
111 typedef GridPart GridPartType;
113 typedef typename FunctionSpace::DomainFieldType DomainFieldType;
114 typedef typename FunctionSpace::RangeFieldType RangeFieldType;
116 typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
118 typedef PiolaTransformation< typename EntityType::Geometry, FunctionSpace::dimRange > TransformationType;
120 static const int dimLocal = GridPart::dimension;
123 using DomainType =
typename FunctionSpace::DomainType;
124 using RangeType =
typename FunctionSpace::RangeType;
125 typedef LocalBasisTraits<DomainFieldType, FunctionSpace::dimDomain, DomainType,
126 RangeFieldType, FunctionSpace::dimRange, RangeType,
127 typename FunctionSpace::JacobianRangeType > LBT;
130 static const bool dynamicOrder = polOrder < 0 ;
135 LocalFiniteElementVirtualInterface< LBT >,
137 Impl::BDMLocalFiniteElement< topologyId, DomainFieldType,
138 RangeFieldType, dimLocal, polOrder > > :: type LocalFiniteElementType;
141 typedef typename LocalFiniteElementType::Traits::LocalBasisType LocalBasisType;
142 typedef typename LocalFiniteElementType::Traits::LocalCoefficientsType LocalCoefficientsType;
143 typedef typename LocalFiniteElementType::Traits::LocalInterpolationType LocalInterpolationType;
145 BrezziDouglasMariniLocalFiniteElementMap (
const GridPart &gridPart,
const unsigned int ord )
146 : orientation_( gridPart ), order_( dynamicOrder ? ord : polOrder )
148 if constexpr ( dynamicOrder )
151 this->
template createLFE< 1 >();
152 else if ( order_ == 2 )
153 this->
template createLFE< 2 >();
155 DUNE_THROW(NotImplemented,
"RaviartThomasLocalFiniteElement not implemented for your choice." );
159 for (
auto i : range(
size() ) )
160 map_[ i ].
reset( new LocalFiniteElementType( i ) );
165 static constexpr std::size_t numOrientations = Impl::BDMLocalFiniteElement< topologyId, DomainFieldType,
166 RangeFieldType, dimLocal, 1 >::numOrientations;
170 int order ()
const {
return order_; }
172 template<
class Entity >
173 int order (
const Entity &entity )
const {
return order(); }
175 template<
class Entity >
178 unsigned int orient = orientation_( e );
181 map( orient ).localBasis(),
182 map( orient ).localInterpolation() };
185 bool hasCoefficients (
const GeometryType &t )
const
187 Dune::GeometryType type( GridPartCapabilities::hasSingleGeometryType< GridPart >::topologyId, GridPart::dimension );
191 const LocalCoefficientsType &localCoefficients (
const GeometryType &type )
const
193 return map( 0 ).localCoefficients();
196 const GridPartType &gridPart ()
const {
return orientation_.gridPart(); }
202 using LFEImpl = Impl::BDMLocalFiniteElement< topologyId, DomainFieldType, RangeFieldType, dimLocal, p >;
203 if constexpr ( LFEImpl::numOrientations > 0 )
205 using LFEObject = LocalFiniteElementVirtualImp< LFEImpl >;
206 for (
auto i : range(
size() ) )
209 map_[ i ].reset(
new LFEObject( imp ) );
214 DUNE_THROW(NotImplemented,
"BDMLocalFiniteElement not implemented for your choice." );
218 const LocalFiniteElementType& map(
const std::size_t i )
const
224 UniqueFacetOrientation< GridPartType > orientation_;
234 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage = CachingStorage >
235 using BrezziDouglasMariniSpace
236 = LocalFiniteElementSpace< BrezziDouglasMariniLocalFiniteElementMap< GridPart, FunctionSpace, polOrder >,
237 FunctionSpace, Storage >;
239 template<
class FunctionSpace,
class Gr
idPart,
class Storage = CachingStorage >
240 using DynamicBrezziDouglasMariniSpace
241 = LocalFiniteElementSpace< BrezziDouglasMariniLocalFiniteElementMap< GridPart, FunctionSpace >,
242 FunctionSpace, Storage >;
virtual void operator()()=0
#define DUNE_THROW(E,...)
GridImp::template Codim< cd >::Entity Entity
specialize with 'true' for if the codimension 0 entity of the grid part has only one possible geometr...
Definition gridpart/common/capabilities.hh:29