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,
class Storage,
38 unsigned int scalarBlockSize >
51 static constexpr bool isScalar = LocalFiniteElementType::Traits::LocalBasisType::Traits::dimRange==1;
60 typedef typename GridPartType::template Codim< codimension >::EntityType EntityType;
79 template<
class LFEM >
87 template<
class DiscreteFunction,
class Operation = DFCommunicationOperation::Copy >
109 template <
class LFEMap,
class Enabler>
114 template <
class LFEMap>
116 std::enable_if_t<LFEMap::numBasisFunctions>=0, std::true_type> >
119 static const unsigned int polynomialOrder = LFEMap::polynomialOrder;
121 template <
class LFEMap>
124 template<
class LFEMap,
class FunctionSpace,
class Storage >
127 DiscontinuousLocalFiniteElementSpaceTraits< LFEMap,
128 FunctionSpace, Storage, FixedPolyOrder<LFEMap>::scalarBlockSize > >,
158 typedef typename LocalFiniteElementType::Traits::LocalBasisType LocalBasisType;
159 typedef typename LocalFiniteElementType::Traits::LocalInterpolationType LocalInterpolationType;
160 typedef typename LocalFiniteElementType::Traits::LocalCoefficientsType LocalCoefficientsType;
166 static LFEMapType *createObject ( std::pair< GridPartType *, KeyType > key ) {
return new LFEMapType( *key.first, key.second ); }
167 static void deleteObject (
LFEMapType *
object ) {
delete object; }
173 typedef std::vector< std::unique_ptr< StoredShapeFunctionSetType > > StoredShapeFunctionSetVectorType;
175 struct StoredShapeFunctionSetVectorFactory
177 static StoredShapeFunctionSetVectorType *createObject (
LFEMapType *lfeMap ) {
return new StoredShapeFunctionSetVectorType( lfeMap->size() ); }
178 static void deleteObject ( StoredShapeFunctionSetVectorType *
object ) {
delete object; }
181 typedef SingletonList< LFEMapType *, StoredShapeFunctionSetVectorType, StoredShapeFunctionSetVectorFactory > StoredShapeFunctionSetVectorProviderType;
183 struct BlockMapperSingletonFactory
189 [ lfeMap ] (
const auto &refElement ) {
190 if( lfeMap->hasCoefficients( refElement.type() ) )
199 static void deleteObject (
BlockMapperType *
object ) {
delete object; }
202 typedef SingletonList< LFEMapType *, BlockMapperType, BlockMapperSingletonFactory > BlockMapperProviderType;
213 template< class GridPart, std::enable_if_t< std::is_same< GridPart, GridPartType >::value &&std::is_same< KeyType, std::tuple<> >::value,
int > = 0 >
215 const InterfaceType commInterface = InteriorBorder_All_Interface,
216 const CommunicationDirection commDirection = ForwardCommunication )
223 template< class GridPart, std::enable_if_t< std::is_same< GridPart, GridPartType >::value && !std::is_same< KeyType, std::tuple<> >::value,
int > = 0 >
225 const InterfaceType commInterface = InteriorBorder_All_Interface,
226 const CommunicationDirection commDirection = ForwardCommunication )
257 return getShapeFunctionSet( (*lfeMap_)( entity ), entity.type() );
267 int order ()
const {
return lfeMap_->order(); }
289 [[deprecated(
"Use LocalInterpolation( space ) instead!")]]
302 auto lfe = (*lfeMap_)( entity );
309 return (*lfeMap_).localCoefficients(
type);
312 ShapeFunctionSetType getShapeFunctionSet ( std::tuple< std::size_t, const LocalBasisType &, const LocalInterpolationType & > lfe,
const GeometryType &
type )
const
314 auto &storedShapeFunctionSet = (*storedShapeFunctionSetVector_)[ std::get< 0 >( lfe ) ];
315 if( !storedShapeFunctionSet )
316 storedShapeFunctionSet.reset(
new StoredShapeFunctionSetType(
type, LocalFunctionsShapeFunctionSetType( std::get< 1 >( lfe ) ) ) );
320 std::unique_ptr< LFEMapType, typename LFEMapProviderType::Deleter > lfeMap_;
321 std::unique_ptr< StoredShapeFunctionSetVectorType, typename StoredShapeFunctionSetVectorProviderType::Deleter > storedShapeFunctionSetVector_;
322 std::unique_ptr< BlockMapperType, typename BlockMapperProviderType::Deleter > blockMapper_;
325 template<
class LFEMap,
class FunctionSpace,
class Storage,
int newRange >
332 class NewFunctionSpace>
Provides a proxy class for pointers to a shape function set.
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
DofMapperCode generateCodimensionCode(const RefElement &refElement, int codim, unsigned int blockSize=1)
Definition: compile.hh:26
typename Impl::GridFunctionSpace< GridPart, T >::Type GridFunctionSpace
Definition: functionspace.hh:317
Definition: space/basisfunctionset/default.hh:52
implementation of a basis function set for given entity
Definition: transformed.hh:44
Default communication handler for discrete functions.
Definition: defaultcommhandler.hh:29
Definition: discretefunctionspace.hh:133
Traits::FunctionSpaceType FunctionSpaceType
type of function space
Definition: discretefunctionspace.hh:193
Traits::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: discretefunctionspace.hh:200
GridPartType::IntersectionType IntersectionType
type of the intersections
Definition: discretefunctionspace.hh:225
int order() const
get global order of space
Definition: discretefunctionspace.hh:345
This is the class with default implementations for discrete function. The methods not marked with hav...
Definition: discretefunctionspace.hh:628
BaseType::EntityType EntityType
Definition: discretefunctionspace.hh:644
BaseType::BlockMapperType BlockMapperType
Definition: discretefunctionspace.hh:660
BaseType::GridPartType GridPartType
Definition: discretefunctionspace.hh:640
GridPartType & gridPart() const
Definition: discretefunctionspace.hh:745
A vector valued function space.
Definition: functionspace.hh:60
convert functions space to space with new dim range
Definition: functionspace.hh:250
Rannacher-Turek Space.
Definition: dgspace.hh:130
bool multipleGeometryTypes() const
returns true if the grid has more than one geometry type
Definition: dgspace.hh:270
Traits::LFEMapType LFEMapType
Definition: dgspace.hh:153
BaseType::EntityType EntityType
Definition: dgspace.hh:142
InterpolationImplType localInterpolation(const EntityType &entity) const
return local interpolation
Definition: dgspace.hh:300
BaseType::GridPartType GridPartType
Definition: dgspace.hh:141
LFEMapType::KeyType KeyType
Definition: dgspace.hh:155
BaseType::Traits::ShapeFunctionSetType ShapeFunctionSetType
Definition: dgspace.hh:145
LFEMapType::LocalCoefficientsType QuadratureType
Definition: dgspace.hh:306
bool continuous(const IntersectionType &intersection) const
returns true if the space contains only globally continuous functions
Definition: dgspace.hh:264
const QuadratureType & quadrature(const GeometryType &type) const
Definition: dgspace.hh:307
BaseType::IntersectionType IntersectionType
Definition: dgspace.hh:143
DiscontinuousLocalFiniteElementSpace(GridPart &gridPart, const KeyType &key, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: dgspace.hh:224
Traits::LocalFiniteElementType LocalFiniteElementType
Definition: dgspace.hh:150
DFSpaceIdentifier type() const
return type identifier of discrete function space
Definition: dgspace.hh:240
bool continuous() const
returns true if the space contains only globally continuous functions
Definition: dgspace.hh:261
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition: dgspace.hh:146
BaseType::BlockMapperType BlockMapperType
Definition: dgspace.hh:148
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition: dgspace.hh:273
LocalFEInterpolationWrapper< ThisType > InterpolationType
Interpolation object.
Definition: dgspace.hh:209
BaseType::FunctionSpaceType FunctionSpaceType
Definition: dgspace.hh:139
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition: dgspace.hh:243
DiscontinuousLocalFiniteElementSpace(GridPart &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: dgspace.hh:214
ShapeFunctionSetType shapeFunctionSet(const EntityType &entity) const
return shape function set for given entity
Definition: dgspace.hh:255
int order() const
get global order of space
Definition: dgspace.hh:267
LocalFiniteElementInterpolation< ThisType, LocalInterpolationType, LocalBasisType::dimRange==1 > InterpolationImplType
Definition: dgspace.hh:206
DiscontinuousLocalFiniteElementSpace(const ThisType &)=delete
InterpolationType interpolation() const
return local interpolation object (uninitialized)
Definition: dgspace.hh:279
DiscontinuousLocalFiniteElementSpace(ThisType &&)=delete
InterpolationImplType interpolation(const EntityType &entity) const
return local interpolation
Definition: dgspace.hh:290
ThisType & operator=(const ThisType &)=delete
Definition: dgspace.hh:40
SelectCachingShapeFunctionSet< LocalFunctionsShapeFunctionSetType, Storage > StoredShapeFunctionSetType
Definition: dgspace.hh:69
LFEMapType::GridPartType GridPartType
Definition: dgspace.hh:45
static constexpr bool isScalar
Definition: dgspace.hh:51
DiscontinuousLocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > DiscreteFunctionSpaceType
Definition: dgspace.hh:41
LocalFunctionsShapeFunctionSet< typename LocalFiniteElementType::Traits::LocalBasisType, LFEMap::pointSetId > LocalFunctionsShapeFunctionSetType
Definition: dgspace.hh:68
ShapeFunctionSetProxy< StoredShapeFunctionSetType > ShapeFunctionSetProxyType
Definition: dgspace.hh:71
static constexpr int codimension
Definition: dgspace.hh:50
LFEMapType::LocalFiniteElementType LocalFiniteElementType
Definition: dgspace.hh:46
std::conditional_t<!fullBlocking, IndexSetDofMapper< GridPartType >, CodimensionMapper< GridPartType, codimension > > BlockMapperType
Definition: dgspace.hh:65
static constexpr bool fullBlocking
Definition: dgspace.hh:52
std::conditional_t< isScalar, Hybrid::IndexRange< int, FunctionSpace::dimRange *scalarBlockSize >, Hybrid::IndexRange< int, 1 > > LocalBlockIndices
Definition: dgspace.hh:57
LFEMap LFEMapType
Definition: dgspace.hh:43
std::conditional_t< isScalar, VectorialShapeFunctionSet< ShapeFunctionSetProxyType, typename FunctionSpaceType::RangeType >, ShapeFunctionSetProxyType > ShapeFunctionSetType
Definition: dgspace.hh:76
decltype(basisFunctionSet(std::declval< const LFEMapType & >())) BasisFunctionSetType
Definition: dgspace.hh:85
GridFunctionSpace< GridPartType, FunctionSpace > FunctionSpaceType
Definition: dgspace.hh:48
Definition: dgspace.hh:89
Operation OperationType
Definition: dgspace.hh:91
DefaultCommunicationHandler< DiscreteFunction, Operation > Type
Definition: dgspace.hh:90
Definition: dgspace.hh:111
static const unsigned int scalarBlockSize
Definition: dgspace.hh:112
DiscontinuousLocalFiniteElementSpace< LFEMap, typename ToNewDimRangeFunctionSpace< FunctionSpace, newRange >::Type, Storage > Type
Definition: dgspace.hh:329
DiscontinuousLocalFiniteElementSpace< LFEMap, NewFunctionSpace, Storage > Type
Definition: dgspace.hh:336
Definition: localfiniteelement/interpolation.hh:105
Definition: localfiniteelement/interpolation.hh:346
Definition: localfiniteelement/shapefunctionset.hh:49
mapper allocating one DoF per subentity of a given codimension
Definition: codimensionmapper.hh:345
Definition: indexsetdofmapper.hh:719
Definition: selectcaching.hh:26
Definition: shapefunctionset/vectorial.hh:447
Singleton list for key/object pairs.
Definition: singletonlist.hh:53