1#ifndef DUNE_FEM_HPDG_SPACE_BASISFUNCTIONSETS_ORTHOGONAL_HH
2#define DUNE_FEM_HPDG_SPACE_BASISFUNCTIONSETS_ORTHOGONAL_HH
13#include <dune/geometry/type.hh>
15#include <dune/grid/common/capabilities.hh>
41 template<
class FunctionSpace,
class Gr
idPart,
int maxOrder,
class Storage >
42 class OrthogonalBasisFunctionSets;
51 template<
class FunctionSpace,
int order,
class Storage >
52 class OrthonormalShapeFunctionSets
54 using ThisType = OrthonormalShapeFunctionSets< FunctionSpace, order, Storage >;
58 using ShapeFunctionSetType =
62 static const int dimension = ShapeFunctionSetType::DomainType::dimension;
65 OrthonormalShapeFunctionSets ()
67 using GeometryTypeIndexSet = LocalGeometryTypeIndexSet< dimension, true >;
68 const std::size_t types = GeometryTypeIndexSet::size();
69 for( std::size_t i = 0u; i < types; ++i )
71 GeometryType type = GeometryTypeIndexSet::type( i );
72 assert( !type.isNone() );
73 types_.push_back( type );
74 for(
int p = 0; p <= order; ++p )
75 shapeFunctionSets_[ type ][ p ].reset(
new ShapeFunctionSetType( type,
typename ShapeFunctionSetType::ImplementationType( type, p ) ) );
79 static const ThisType &instance ()
81 static ThisType instance;
87 static const std::vector< GeometryType > &types ()
89 return instance().types();
93 static std::size_t maxSize ()
95 return OrthonormalShapeFunctions< dimension >::size( order );
99 static std::size_t size ( GeometryType type,
int p )
101 return OrthonormalShapeFunctions< dimension >::size( p );
105 static const ShapeFunctionSetType &
get ( GeometryType type,
int p )
107 return *instance().shapeFunctionSets_[ type ][ p ];
111 std::vector< GeometryType > types_;
120 template<
class FunctionSpace,
class Gr
idPart,
int maxOrder,
class Storage >
121 class OrthogonalBasisFunctionSetsTraits
124 using ImplementationType = OrthogonalBasisFunctionSets< FunctionSpace, GridPart, maxOrder, Storage >;
126 using GridPartType = GridPart;
127 using Types =
const std::vector< GeometryType > &;
130 using DataType = KeyType;
132 using EntityType =
typename GridPartType::template Codim< 0 >::EntityType;
134 using ShapeFunctionSetsType = OrthonormalShapeFunctionSets< Dune::Fem::FunctionSpace< typename FunctionSpace::DomainFieldType, typename FunctionSpace::RangeFieldType, EntityType::mydimension, 1 >, maxOrder, Storage >;
137 using BasisFunctionSetType = DefaultBasisFunctionSet< EntityType, ShapeFunctionSetType >;
139 static const int localBlockSize = BasisFunctionSetType::RangeType::dimension;
158 template<
class FunctionSpace,
class Gr
idPart,
int maxOrder,
class Storage >
160 :
public BasisFunctionSets< OrthogonalBasisFunctionSetsTraits< FunctionSpace, GridPart, maxOrder, Storage > >
172 using ShapeFunctionSetsType =
typename BaseType::Traits::ShapeFunctionSetsType;
173 using ShapeFunctionSetType =
typename BaseType::Traits::ShapeFunctionSetType;
191 using RangeType =
typename FunctionSpaceType :: RangeType;
221 static const std::vector< GeometryType > &
types ()
223 return ShapeFunctionSetsType::types();
229 return ShapeFunctionSetsType::maxSize();
235 return contains( type ) ?
maxBlocks() : 0u;
241 return contains( type ) ? ShapeFunctionSetsType::size( type, key ) : 0u;
259 static constexpr int order () noexcept {
return maxOrder; }
262 static int order ( GeometryType type )
noexcept {
return order(); }
267 assert( contains( type ) );
268 return static_cast< int >( key );
274 assert( contains( entity.type() ) );
279 static bool contains ( GeometryType type )
281 return (type.dim() <= 3 && !type.isNone());
284 static ShapeFunctionSetType shapeFunctionSet ( GeometryType type,
KeyType key )
286 return ShapeFunctionSetType( &ShapeFunctionSetsType::get( type,
static_cast< int >( key ) ) );
Provides a proxy class for pointers to a shape function set.
Definition: bindguard.hh:11
std::tuple_element< i, Tuple >::type & get(Dune::TypeIndexedTuple< Tuple, Types > &tuple)
Definition: typeindexedtuple.hh:122
abstract interface class for a family of local basis function sets
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:30
typename Traits::DataType DataType
data type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:53
typename Traits::BasisFunctionSetType BasisFunctionSetType
basis function set type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:42
typename BasisFunctionSetType::EntityType EntityType
entity type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:44
typename Traits::KeyType KeyType
key type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:39
typename Traits::GridPartType GridPartType
grid part type
Definition: basisfunctionset/hpdg/basisfunctionsets.hh:36
A family of orthogonal local basis function sets.
Definition: basisfunctionset/hpdg/orthogonal.hh:161
static std::size_t maxBlocks(GeometryType type)
Definition: basisfunctionset/hpdg/orthogonal.hh:233
static const std::vector< GeometryType > & types()
Definition: basisfunctionset/hpdg/orthogonal.hh:221
OrthogonalBasisFunctionSets(const ThisType &)=default
copy constructor
typename BaseType::GridPartType GridPartType
Definition: basisfunctionset/hpdg/orthogonal.hh:167
typename BaseType::DataType DataType
Definition: basisfunctionset/hpdg/orthogonal.hh:182
static int order(GeometryType type, KeyType key)
return maximum order
Definition: basisfunctionset/hpdg/orthogonal.hh:265
static BasisFunctionSetType basisFunctionSet(const EntityType &entity, KeyType key)
return basis function set for given entity
Definition: basisfunctionset/hpdg/orthogonal.hh:272
OrthogonalBasisFunctionSets()=default
constructor
static std::size_t blocks(GeometryType type, KeyType key)
Definition: basisfunctionset/hpdg/orthogonal.hh:239
static KeyType decode(const DataType &data) noexcept
Definition: basisfunctionset/hpdg/orthogonal.hh:248
static std::size_t maxBlocks()
Definition: basisfunctionset/hpdg/orthogonal.hh:227
typename BaseType::EntityType EntityType
entity type
Definition: basisfunctionset/hpdg/orthogonal.hh:169
typename FunctionSpaceType ::DomainType DomainType
range type of basis functions
Definition: basisfunctionset/hpdg/orthogonal.hh:188
static constexpr bool orthogonal() noexcept
Definition: basisfunctionset/hpdg/orthogonal.hh:251
typename BaseType::BasisFunctionSetType BasisFunctionSetType
basis function set
Definition: basisfunctionset/hpdg/orthogonal.hh:177
typename BaseType::KeyType KeyType
Definition: basisfunctionset/hpdg/orthogonal.hh:180
static constexpr int order() noexcept
return maximum order
Definition: basisfunctionset/hpdg/orthogonal.hh:259
static int order(GeometryType type) noexcept
return maximum order
Definition: basisfunctionset/hpdg/orthogonal.hh:262
OrthogonalBasisFunctionSets(ThisType &&)=default
move constructor
ThisType & operator=(const ThisType &)=default
assignment operator
static DataType encode(const KeyType &key) noexcept
Definition: basisfunctionset/hpdg/orthogonal.hh:245
typename FunctionSpaceType ::RangeType RangeType
range type of basis functions
Definition: basisfunctionset/hpdg/orthogonal.hh:191
A vector valued function space.
Definition: functionspace.hh:60
Definition: selectcaching.hh:26
Definition: shapefunctionset/vectorial.hh:447