1 #ifndef DUNE_FEM_SPACE_LOCALFINITEELEMENT_DGSPACE_HH
2 #define DUNE_FEM_SPACE_LOCALFINITEELEMENT_DGSPACE_HH
10 #include <dune/geometry/type.hh>
37 template<
class LFEMap,
class FunctionSpace,
template<
class >
class Storage >
54 typedef typename GridPartType::template Codim< codimension >::EntityType EntityType;
66 template<
class LFEM >
96 template<
class LFEMap,
class FunctionSpace,
template<
class >
class Storage >
124 typedef typename LocalFiniteElementType::Traits::LocalBasisType LocalBasisType;
125 typedef typename LocalFiniteElementType::Traits::LocalInterpolationType LocalInterpolationType;
126 typedef typename LocalFiniteElementType::Traits::LocalCoefficientsType LocalCoefficientsType;
132 static LFEMapType *createObject ( std::pair< GridPartType *, KeyType > key ) {
return new LFEMapType( *key.first, key.second ); }
133 static void deleteObject (
LFEMapType *
object ) {
delete object; }
139 typedef std::vector< std::unique_ptr< StoredShapeFunctionSetType > > StoredShapeFunctionSetVectorType;
141 struct StoredShapeFunctionSetVectorFactory
143 static StoredShapeFunctionSetVectorType *createObject (
LFEMapType *lfeMap ) {
return new StoredShapeFunctionSetVectorType( lfeMap->size() ); }
144 static void deleteObject ( StoredShapeFunctionSetVectorType *
object ) {
delete object; }
147 typedef SingletonList< LFEMapType *, StoredShapeFunctionSetVectorType, StoredShapeFunctionSetVectorFactory > StoredShapeFunctionSetVectorProviderType;
149 struct BlockMapperSingletonFactory
153 return new BlockMapperType( lfeMap->gridPart(), [ lfeMap ] (
const auto &refElement ) {
154 if( lfeMap->hasCoefficients( refElement.type() ) )
155 return Dune::Fem::generateCodimensionCode( refElement, 0, lfeMap->localCoefficients( refElement.type() ).size() );
157 return Dune::Fem::DofMapperCode();
161 static void deleteObject (
BlockMapperType *
object ) {
delete object; }
164 typedef SingletonList< LFEMapType *, BlockMapperType, BlockMapperSingletonFactory > BlockMapperProviderType;
171 template< class GridPart, std::enable_if_t< std::is_same< GridPart, GridPartType >::value &&std::is_same< KeyType, std::tuple<> >::value,
int > = 0 >
173 const InterfaceType commInterface = InteriorBorder_All_Interface,
174 const CommunicationDirection commDirection = ForwardCommunication )
181 template< class GridPart, std::enable_if_t< std::is_same< GridPart, GridPartType >::value && !std::is_same< KeyType, std::tuple<> >::value,
int > = 0 >
183 const InterfaceType commInterface = InteriorBorder_All_Interface,
184 const CommunicationDirection commDirection = ForwardCommunication )
215 return getShapeFunctionSet( (*lfeMap_)( entity ), entity.type() );
225 int order ()
const {
return lfeMap_->order(); }
240 auto lfe = (*lfeMap_)( entity );
245 ShapeFunctionSetType getShapeFunctionSet ( std::tuple< std::size_t, const LocalBasisType &, const LocalInterpolationType & > lfe,
const GeometryType &
type )
const
247 auto &storedShapeFunctionSet = (*storedShapeFunctionSetVector_)[ std::get< 0 >( lfe ) ];
248 if( !storedShapeFunctionSet )
249 storedShapeFunctionSet.reset(
new StoredShapeFunctionSetType(
type, LocalFunctionsShapeFunctionSetType( std::get< 1 >( lfe ) ) ) );
253 std::unique_ptr< LFEMapType, typename LFEMapProviderType::Deleter > lfeMap_;
254 std::unique_ptr< StoredShapeFunctionSetVectorType, typename StoredShapeFunctionSetVectorProviderType::Deleter > storedShapeFunctionSetVector_;
255 std::unique_ptr< BlockMapperType, typename BlockMapperProviderType::Deleter > blockMapper_;
DFSpaceIdentifier
enumerator for identification of spaces
Definition: discretefunctionspace.hh:94
@ DGSpace_id
id for Discontinuous Galerkin Space
Definition: discretefunctionspace.hh:97
Definition: bindguard.hh:11
std::tuple_element< i, Tuple >::type & get(Dune::TypeIndexedTuple< Tuple, Types > &tuple)
Definition: typeindexedtuple.hh:122
typename Impl::GridFunctionSpace< GridPart, T >::Type GridFunctionSpace
Definition: functionspace.hh:317
Definition: basisfunctionset/default.hh:47
implementation of a basis function set for given entity
Definition: transformed.hh:44
Mathematical operation apply during communication to data that is communicated enum of all avialable ...
Definition: commoperations.hh:123
Default communication handler for discrete functions.
Definition: defaultcommhandler.hh:29
Traits ::FunctionSpaceType FunctionSpaceType
type of function space
Definition: discretefunctionspace.hh:193
int order() const
get global order of space
Definition: discretefunctionspace.hh:341
GridPartType ::IntersectionType IntersectionType
type of the intersections
Definition: discretefunctionspace.hh:225
Traits ::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: discretefunctionspace.hh:200
This is the class with default implementations for discrete function. The methods not marked with hav...
Definition: discretefunctionspace.hh:617
BaseType::BlockMapperType BlockMapperType
Definition: discretefunctionspace.hh:649
BaseType ::EntityType EntityType
Definition: discretefunctionspace.hh:633
BaseType ::GridPartType GridPartType
Definition: discretefunctionspace.hh:629
GridPartType & gridPart() const
Definition: discretefunctionspace.hh:734
Rannacher-Turek Space.
Definition: dgspace.hh:99
bool multipleGeometryTypes() const
returns true if the grid has more than one geometry type
Definition: dgspace.hh:228
Traits::LFEMapType LFEMapType
Definition: dgspace.hh:119
BaseType::EntityType EntityType
Definition: dgspace.hh:109
BaseType::GridPartType GridPartType
Definition: dgspace.hh:108
LFEMapType::KeyType KeyType
Definition: dgspace.hh:121
BaseType::Traits::ShapeFunctionSetType ShapeFunctionSetType
Definition: dgspace.hh:112
bool continuous(const IntersectionType &intersection) const
returns true if the space contains only globally continuous functions
Definition: dgspace.hh:222
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition: dgspace.hh:231
BaseType::IntersectionType IntersectionType
Definition: dgspace.hh:110
DiscontinuousLocalFiniteElementSpace(GridPart &gridPart, const KeyType &key, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: dgspace.hh:182
ThisType & operator=(const ThisType &)=delete
Traits::LocalFiniteElementType LocalFiniteElementType
Definition: dgspace.hh:117
DFSpaceIdentifier type() const
return type identifier of discrete function space
Definition: dgspace.hh:198
bool continuous() const
returns true if the space contains only globally continuous functions
Definition: dgspace.hh:219
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition: dgspace.hh:113
BaseType::BlockMapperType BlockMapperType
Definition: dgspace.hh:115
BaseType::FunctionSpaceType FunctionSpaceType
Definition: dgspace.hh:106
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition: dgspace.hh:201
DiscontinuousLocalFiniteElementSpace(GridPart &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: dgspace.hh:172
ShapeFunctionSetType shapeFunctionSet(const EntityType &entity) const
return shape function set for given entity
Definition: dgspace.hh:213
int order() const
get global order of space
Definition: dgspace.hh:225
DiscontinuousLocalFiniteElementSpace(const ThisType &)=delete
LocalFiniteElementInterpolation< BasisFunctionSetType, LocalInterpolationType > InterpolationType
Definition: dgspace.hh:167
InterpolationType interpolation(const EntityType &entity) const
return local interpolation
Definition: dgspace.hh:238
DiscontinuousLocalFiniteElementSpace(ThisType &&)=delete
Definition: dgspace.hh:39
ShapeFunctionSetProxy< StoredShapeFunctionSetType > ShapeFunctionSetType
Definition: dgspace.hh:62
static constexpr int codimension
Definition: dgspace.hh:49
Dune::Fem::IndexSetDofMapper< GridPartType > BlockMapperType
Definition: dgspace.hh:57
LFEMapType::LocalFiniteElementType LocalFiniteElementType
Definition: dgspace.hh:45
GridFunctionSpace< GridPartType, FunctionSpace > FunctionSpaceType
Definition: dgspace.hh:47
LFEMap LFEMapType
Definition: dgspace.hh:42
DiscontinuousLocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > DiscreteFunctionSpaceType
Definition: dgspace.hh:40
SelectCachingShapeFunctionSet< LocalFunctionsShapeFunctionSetType, Storage > StoredShapeFunctionSetType
Definition: dgspace.hh:60
LFEMapType::GridPartType GridPartType
Definition: dgspace.hh:44
LocalFunctionsShapeFunctionSet< typename LocalFiniteElementType::Traits::LocalBasisType > LocalFunctionsShapeFunctionSetType
Definition: dgspace.hh:59
Hybrid::IndexRange< int, 1 > LocalBlockIndices
Definition: dgspace.hh:51
decltype(basisFunctionSet(std::declval< const LFEMapType & >())) typedef BasisFunctionSetType
Definition: dgspace.hh:72
Definition: dgspace.hh:76
Operation OperationType
Definition: dgspace.hh:78
DefaultCommunicationHandler< DiscreteFunction, Operation > Type
Definition: dgspace.hh:77
Definition: localfiniteelement/interpolation.hh:90
Definition: localfiniteelement/shapefunctionset.hh:49
Definition: indexsetdofmapper.hh:636
Definition: shapefunctionset/proxy.hh:33
Definition: selectcaching.hh:28
Singleton list for key/object pairs.
Definition: singletonlist.hh:54
Provides a proxy class for pointers to a shape function set.