1#ifndef DUNE_FEM_SPACE_BREZZIDOUGLASFORTINMARINI_HH
2#define DUNE_FEM_SPACE_BREZZIDOUGLASFORTINMARINI_HH
4#if HAVE_DUNE_LOCALFUNCTIONS
18#include <dune/localfunctions/brezzidouglasfortinmarini/bdfmcube.hh>
21#include <dune/fem/space/common/uniquefacetorientation.hh>
22#include <dune/fem/space/basisfunctionset/piolatransformation.hh>
23#include <dune/fem/space/localfiniteelement/space.hh>
35 template<
class Gr
idPart,
class FunctionSpace,
int polOrder >
36 class BrezziDouglasFortinMariniLocalFiniteElementMap
38 using hasSingleGeometryType = GridPartCapabilities::hasSingleGeometryType< GridPart >;
40 static_assert( hasSingleGeometryType::v,
"`GridPart` has more the one geometry type." );
41 static_assert( GridPart::dimension == 2,
"`BDFM` basis only defined for quadrilaterals." );
43 static constexpr int dimLocal = GridPart::dimension;
44 static constexpr unsigned int topologyId = hasSingleGeometryType::topologyId;
46 "Only defined for cube grids." );
50 using Geometry =
typename GridPart::template Codim< 0 >::EntityType::Geometry;
53 using GridPartType = GridPart;
58 using KeyType = std::tuple<>;
60 using TransformationType = PiolaTransformation< Geometry, FunctionSpace::dimRange >;
62 using LocalFiniteElementType = BDFMCubeLocalFiniteElement< DomainFieldType, RangeFieldType, dimLocal, polOrder >;
64 using LocalBasisType =
typename LocalFiniteElementType::Traits::LocalBasisType;
65 using LocalCoefficientsType =
typename LocalFiniteElementType::Traits::LocalCoefficientsType;
66 using LocalInterpolationType =
typename LocalFiniteElementType::Traits::LocalInterpolationType;
68 static constexpr auto size () -> std::size_t {
return Dune::power(
int(2),
int(2*dimLocal) ); }
70 template<
class ... Args >
71 BrezziDouglasFortinMariniLocalFiniteElementMap (
const GridPartType& gridPart, Args&& ... )
72 : orientation_( gridPart )
75 map_[ i ] = LocalFiniteElementType( i );
78 int order ()
const {
return polOrder; }
80 template<
class Entity >
81 int order (
const Entity& entity )
const {
return order; }
83 template<
class Entity >
84 auto operator() (
const Entity& entity )
const
85 -> std::tuple< std::size_t, const LocalBasisType&, const LocalInterpolationType& >
87 auto o = orientation_( entity );
88 return std::tuple< std::size_t, const LocalBasisType&, const LocalInterpolationType& >(
89 static_cast< std::size_t
>( o ), map_[ o ].localBasis(), map_[ o ].localInterpolation() );
92 auto localCoefficients (
const GeometryType& type )
const
93 ->
const LocalCoefficientsType&
95 return map_[ 0 ].localCoefficients();
98 bool hasCoefficients (
const GeometryType& type )
const {
return type ==
GeometryType( topologyId, dimLocal ); }
99 auto gridPart () const -> const GridPartType& {
return orientation_.gridPart(); }
102 UniqueFacetOrientation< GridPartType > orientation_;
103 std::array< LocalFiniteElementType,
size() > map_;
110 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage = CachingStorage >
111 using BrezziDouglasFortinMariniSpace
112 = LocalFiniteElementSpace< BrezziDouglasFortinMariniLocalFiniteElementMap< 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
constexpr unsigned int id() const
Return the topology id of the type.
Definition: type.hh:365
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
static constexpr IntegralRange< std::decay_t< T > > range(T &&from, U &&to) noexcept
free standing function for setting up a range based for loop over an integer range for (auto i: range...
Definition: rangeutilities.hh:288
Some useful basic math stuff.
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
constexpr Base power(Base m, Exponent p)
Power method for integer exponents.
Definition: math.hh:75
A unique label for each type of element that can occur in a grid.
Traits for type conversions and type information.