1#ifndef DUNE_FEM_SPACE_BREZZIDOUGLASMARINI_HH
2#define DUNE_FEM_SPACE_BREZZIDOUGLASMARINI_HH
4#if HAVE_DUNE_LOCALFUNCTIONS
6#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube2d.hh>
7#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube3d.hh>
8#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1simplex2d.hh>
9#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2cube2d.hh>
10#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2simplex2d.hh>
12#include <dune/fem/space/common/uniquefacetorientation.hh>
13#include <dune/fem/space/basisfunctionset/piolatransformation.hh>
14#include <dune/fem/space/localfiniteelement/space.hh>
28 template<
unsigned int id,
class DomainField,
class RangeField,
int dimension,
int order >
29 struct BDMLocalFiniteElement
31 static_assert( AlwaysFalse< DomainField >::value,
"BDMLocalFiniteElement not implemented for your choice." );
39 :
public BDM1Cube2DLocalFiniteElement< D, D >
41 static const int numOrientations = 16;
42 template<
class ... Args >
43 BDMLocalFiniteElement ( Args && ... args )
44 : BDM1Cube2DLocalFiniteElement< D, D >(
std::forward< Args >( args ) ... ) {}
50 :
public BDM1Cube3DLocalFiniteElement< D, D >
52 static const int numOrientations = 64;
53 template<
class ... Args >
54 BDMLocalFiniteElement ( Args && ... args )
55 : BDM1Cube3DLocalFiniteElement< D, D >(
std::forward< Args >( args ) ... ) {}
61 :
public BDM2Cube2DLocalFiniteElement< D, D >
63 static const int numOrientations = 16;
64 template<
class ... Args >
65 BDMLocalFiniteElement ( Args && ... args )
66 : BDM2Cube2DLocalFiniteElement< D, D >(
std::forward< Args >( args ) ... ) {}
73 :
public BDM1Simplex2DLocalFiniteElement< D, D >
75 static const int numOrientations = 8;
76 template<
class ... Args >
77 BDMLocalFiniteElement ( Args && ... args )
78 : BDM1Simplex2DLocalFiniteElement< D, D >(
std::forward< Args >( args ) ... ) {}
84 :
public BDM2Simplex2DLocalFiniteElement< D, D >
86 static const int numOrientations = 8;
87 template<
class ... Args >
88 BDMLocalFiniteElement ( Args && ... args )
89 : BDM2Simplex2DLocalFiniteElement< D, D >(
std::forward< Args >( args ) ... ) {}
97 template<
class Gr
idPart,
class FunctionSpace,
int polOrder >
98 class BrezziDouglasMariniLocalFiniteElementMap
100 typedef BrezziDouglasMariniLocalFiniteElementMap< GridPart, FunctionSpace, polOrder > ThisType;
102 "GridPart has more than one geometry type." );
107 typedef std::tuple< > KeyType;
109 typedef GridPart GridPartType;
114 typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
116 typedef PiolaTransformation< typename EntityType::Geometry, FunctionSpace::dimRange > TransformationType;
118 static const int dimLocal = GridPart::dimension;
120 typedef Impl::BDMLocalFiniteElement< topologyId, DomainFieldType, RangeFieldType, dimLocal, polOrder > LocalFiniteElementType;
121 typedef typename LocalFiniteElementType::Traits::LocalBasisType LocalBasisType;
122 typedef typename LocalFiniteElementType::Traits::LocalCoefficientsType LocalCoefficientsType;
123 typedef typename LocalFiniteElementType::Traits::LocalInterpolationType LocalInterpolationType;
125 template<
class ... Args >
126 BrezziDouglasMariniLocalFiniteElementMap (
const GridPart &gridPart, Args ... args )
127 : orientation_( gridPart )
129 for( std::size_t i = 0; i < LocalFiniteElementType::numOrientations; ++i )
130 map_[ i ] = LocalFiniteElementType( i );
133 static std::size_t
size () {
return LocalFiniteElementType::numOrientations; }
135 int order ()
const {
return polOrder; }
137 template<
class Entity >
138 int order (
const Entity &entity )
const {
return order(); }
140 template<
class Entity >
141 auto operator() (
const Entity &e )
const
143 unsigned int orient = orientation_( e );
144 return std::tuple< std::size_t, const LocalBasisType&, const LocalInterpolationType& >
145 {
static_cast< std::size_t
>( orient ),
146 map_[ orient ].localBasis(),
147 map_[ orient ].localInterpolation() };
150 bool hasCoefficients (
const GeometryType &t )
const
152 Dune::GeometryType type( GridPartCapabilities::hasSingleGeometryType< GridPart >::topologyId, GridPart::dimension );
156 const LocalCoefficientsType &localCoefficients (
const GeometryType &type )
const
158 return map_[ 0 ].localCoefficients();
161 const GridPartType &gridPart ()
const {
return orientation_.gridPart(); }
164 UniqueFacetOrientation< GridPartType > orientation_;
165 std::array< LocalFiniteElementType, LocalFiniteElementType::numOrientations > map_;
172 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage = CachingStorage >
173 using BrezziDouglasMariniSpace
174 = LocalFiniteElementSpace< BrezziDouglasMariniLocalFiniteElementMap< GridPart, FunctionSpace, polOrder >,
175 FunctionSpace, Storage >;
FunctionSpaceTraits::DomainFieldType DomainFieldType
Intrinsic type used for values in the domain field (usually a double)
Definition: functionspaceinterface.hh:60
FunctionSpaceTraits::RangeFieldType RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspaceinterface.hh:63
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
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
specialize with 'true' for if the codimension 0 entity of the grid part has only one possible geometr...
Definition: capabilities.hh:29