1#ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_SHAPEFUNCTIONSETS_HH
2#define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_SHAPEFUNCTIONSETS_HH
12#include <dune/fem/space/common/allgeomtypes.hh>
13#include <dune/fem/space/common/basesetlocalkeystorage.hh>
15#include <dune/fem/space/shapefunctionset/selectcaching.hh>
16#include <dune/fem/space/shapefunctionset/vectorial.hh>
17#include <dune/fem/storage/singletonlist.hh>
63 const std::vector< Dune::GeometryType > &
types ()
const;
88 class Factory = Dune::Fem::DefaultSingletonFactory< Dune::GeometryType, ShapeFunctionSet > >
89 class CachedShapeFunctionSets
91 typedef CachedShapeFunctionSets< GridPart, ShapeFunctionSet, Factory > ThisType;
95 typedef GridPart GridPartType;
97 typedef Dune::Fem::ShapeFunctionSetProxy< ShapeFunctionSet > ShapeFunctionSetType;
100 static const int dimension = GridPartType::dimension;
102 static const int codimension = dimension - mydimension;
112 explicit CachedShapeFunctionSets (
const GridPartType &gridPart )
113 : types_( types( gridPart ) )
115 typedef typename std::vector< Dune::GeometryType >::const_iterator const_iterator;
116 const const_iterator end = types_.end();
117 for( const_iterator it = types_.begin(); it != end; ++it )
120 shapeFunctionSets_.template insert< SingletonProviderType >( type );
130 CachedShapeFunctionSets (
const ThisType & ) =
delete;
132 CachedShapeFunctionSets ( ThisType &&other )
133 : types_(
std::move( other.types_ ) ),
134 shapeFunctionSets_(
std::move( other.shapeFunctionSets_ ) )
137 CachedShapeFunctionSets &operator= (
const ThisType & ) =
delete;
146 const std::vector< Dune::GeometryType > &types ()
const {
return types_; }
153 typedef typename std::vector< Dune::GeometryType >::const_iterator const_iterator;
154 const const_iterator end = types_.end();
155 for( const_iterator it = types_.begin(); it != end; ++it )
158 order = std::max( this->order( type ), order );
167 return shapeFunctionSet( type ).order();
173 return ShapeFunctionSetType( &shapeFunctionSets_[ type ] );
179 static std::vector< Dune::GeometryType > types (
const GridPartType &gridPart )
181 typedef typename GridPartType::GridType GridType;
186 std::vector< Dune::GeometryType > types_;
187 ShapeFunctionSetStorageType shapeFunctionSets_;
195 template<
class Gr
idPart,
class ShapeFunctionSet,
class Storage >
196 class SelectCachingShapeFunctionSets
198 typedef SelectCachingShapeFunctionSets< GridPart, ShapeFunctionSet, Storage > ThisType;
200 typedef SelectCachingShapeFunctionSet< ShapeFunctionSet, Storage > CachedShapeFunctionSetType;
206 typedef typename CachedShapeFunctionSetType::ImplementationType ImplementationType;
207 return new CachedShapeFunctionSetType( type, ImplementationType( type ) );
210 static void deleteObject ( CachedShapeFunctionSetType *
object ) {
delete object; }
213 typedef CachedShapeFunctionSets< GridPart, CachedShapeFunctionSetType, Factory > Implementation;
217 typedef typename Implementation::ShapeFunctionSetType ShapeFunctionSetType;
219 static constexpr bool codegenShapeFunctionSet = detail::IsCodegenShapeFunctionSet< CachedShapeFunctionSetType >::value;
225 explicit SelectCachingShapeFunctionSets (
const GridPart &gridPart )
235 SelectCachingShapeFunctionSets (
const ThisType & ) =
delete;
237 SelectCachingShapeFunctionSets ( ThisType &&other )
238 : impl_(
std::move( other.impl_ ) )
241 SelectCachingShapeFunctionSets &operator= (
const ThisType & ) =
delete;
246 const std::vector< Dune::GeometryType > &types ()
const {
return impl_.types(); }
249 int order ()
const {
return impl_.order(); }
257 return impl_.shapeFunctionSet( type );
261 Implementation impl_;
269 template<
class Implementation,
class Range >
270 class VectorialShapeFunctionSets
272 typedef VectorialShapeFunctionSets< Implementation, Range > ThisType;
275 static constexpr bool codegenShapeFunctionSet = detail::IsCodegenShapeFunctionSet< Implementation >::value;
278 typedef VectorialShapeFunctionSet< typename Implementation::ShapeFunctionSetType, Range > ShapeFunctionSetType;
284 explicit VectorialShapeFunctionSets ( Implementation &&impl )
288 template<
class... Args >
289 explicit VectorialShapeFunctionSets ( Args &&...args )
290 : impl_(
std::forward< Args >( args )... )
299 VectorialShapeFunctionSets (
const ThisType & ) =
delete;
301 VectorialShapeFunctionSets ( ThisType & ) =
delete;
303 VectorialShapeFunctionSets ( ThisType &&other )
304 : impl_(
std::move( other.impl_ ) )
307 VectorialShapeFunctionSets &operator= (
const ThisType & ) =
delete;
316 const std::vector< Dune::GeometryType > &types ()
const {
return impl().types(); }
319 int order ()
const {
return impl().order(); }
327 return ShapeFunctionSetType( impl().shapeFunctionSet( type ) );
333 const Implementation &impl ()
const {
return impl_; }
335 Implementation impl_;
consecutive, persistent index set for the leaf level based on the grid's hierarchy index set
Definition: adaptiveleafindexset.hh:1351
default implementation uses method geomTypes of given index set. Used in DiscreteFunctionSpaces.
Definition: allgeomtypes.hh:99
const std ::vector< GeometryType > & geomTypes(unsigned int codim) const
returns vector with geometry tpyes this index set has indices for
Definition: allgeomtypes.hh:171
@ dimDomain
dimension of domain vector space
Definition: functionspaceinterface.hh:46
Interface class for shape function sets.
Definition: shapefunctionset.hh:33
interface class representing a family of shape function sets
Definition: shapefunctionsets.hh:33
ShapeFunctionSets(ShapeFunctionSets &&)
move constructor
int order(Dune::GeometryType type) const
return order per geometry type
ShapeFunctionSetType shapeFunctionSet(const Dune::GeometryType &type) const
return shape function set
ImplementationDefined ShapeFunctionSetType
shape function set type
Definition: shapefunctionsets.hh:36
ShapeFunctionSets & operator=(const ShapeFunctionSets &)=delete
assignment operator
ShapeFunctionSets(const ShapeFunctionSets &)=delete
copy constructor
const std::vector< Dune::GeometryType > & types() const
return vector of geometry types
int order() const
return maximum order
Singleton list for key/object pairs.
Definition: singletonlist.hh:53
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Documentation related stuff.
Dune namespace.
Definition: alignedallocator.hh:13
Provides a proxy class for pointers to a shape function set.
Dummy struct used for documentation purposes.
Definition: documentation.hh:42
A unique label for each type of element that can occur in a grid.