dune-fem  2.4.1-rc
discontinuousgalerkin/basisfunctionsets.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_BASISFUNCTIONSETS_HH
2 #define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_BASISFUNCTIONSETS_HH
3 
4 #include <utility>
5 
6 #include <dune/common/documentation.hh>
7 
9 
10 namespace Dune
11 {
12 
13  namespace Fem
14  {
15 
16  // BasisFunctionSets
17  // -----------------
18 
24  {
25  public:
27  typedef ImplementationDefined BasisFunctionSetType;
29  typedef ImplementationDefined EntityType;
30 
37 
45  BasisFunctionSets ( const BasisFunctionSets & ) = delete;
46 
48  BasisFunctionSets &operator= ( const BasisFunctionSets & ) = delete;
49 
57  int order () const;
58 
60  int order ( const EntityType &entity ) const;
61 
63  BasisFunctionSetType basisFunctionSet ( const EntityType &entity ) const;
64 
66  };
67 
68 
69 
70  // DefaultBasisFunctionSets
71  // ------------------------
72 
81  template< class GridPart, class ShapeFunctionSets >
83  {
85 
86  public:
88  typedef GridPart GridPartType;
89 
94 
95  private:
96  static const int dimension = GridPartType::dimension;
97  static const int mydimension = ShapeFunctionSetType::FunctionSpaceType::dimDomain;
98  static const int codimension = dimension - mydimension;
99 
100  public:
102  typedef typename GridPartType::template Codim< codimension >::EntityType EntityType;
103 
106 
107  public:
112  explicit DefaultBasisFunctionSets ( ShapeFunctionSetsType &&shapeFunctionSets )
113  : shapeFunctionSets_( std::forward< ShapeFunctionSetsType >( shapeFunctionSets ) )
114  {}
115 
116  template< class... Args >
117  explicit DefaultBasisFunctionSets ( Args &&... args )
118  : shapeFunctionSets_( std::forward< Args >( args )... )
119  {}
120 
127  DefaultBasisFunctionSets ( const ThisType & ) = delete;
128 
129  DefaultBasisFunctionSets ( ThisType & ) = delete;
130 
131  DefaultBasisFunctionSets ( ThisType &&other )
132  : shapeFunctionSets_( std::move( other.shapeFunctionSets_ ) )
133  {}
134 
135  DefaultBasisFunctionSets &operator= ( const ThisType & ) = delete;
136 
144  int order () const { return shapeFunctionSets_.order(); }
145 
147  int order ( const EntityType &entity ) const
148  {
149  return shapeFunctionSets_.order( entity.type() );
150  }
151 
153  BasisFunctionSetType basisFunctionSet ( const EntityType &entity ) const
154  {
155  return BasisFunctionSetType( entity, shapeFunctionSet( entity.type() ) );
156  }
157 
160  private:
161  ShapeFunctionSetType shapeFunctionSet ( const Dune::GeometryType &type ) const
162  {
163  return shapeFunctionSets_.shapeFunctionSet( type );
164  }
165 
166  ShapeFunctionSetsType shapeFunctionSets_;
167  };
168 
169  } // namespace Fem
170 
171 } // namespace Dune
172 
173 #endif // #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_BASISFUNCTIONSETS_HH
ShapeFunctionSetsType::ShapeFunctionSetType ShapeFunctionSetType
shape function set type
Definition: discontinuousgalerkin/basisfunctionsets.hh:93
Dune::Fem::DefaultBasisFunctionSet< EntityType, ShapeFunctionSetType > BasisFunctionSetType
entity type
Definition: discontinuousgalerkin/basisfunctionsets.hh:105
DefaultBasisFunctionSets(ShapeFunctionSetsType &&shapeFunctionSets)
Definition: discontinuousgalerkin/basisfunctionsets.hh:112
interface class representing a family of shape function sets
Definition: shapefunctionsets.hh:32
ShapeFunctionSets ShapeFunctionSetsType
shape function sets type
Definition: discontinuousgalerkin/basisfunctionsets.hh:91
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
return basis function set for given entity
interface class representing a family of basis function sets
Definition: discontinuousgalerkin/basisfunctionsets.hh:23
int order() const
return maximum order
Definition: discontinuousgalerkin/basisfunctionsets.hh:144
GridPartType::template Codim< codimension >::EntityType EntityType
entity type
Definition: discontinuousgalerkin/basisfunctionsets.hh:102
int order() const
return maximum order
Definition: coordinate.hh:4
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
return basis function set for given entity
Definition: discontinuousgalerkin/basisfunctionsets.hh:153
DefaultBasisFunctionSets(ThisType &&other)
Definition: discontinuousgalerkin/basisfunctionsets.hh:131
BasisFunctionSets(BasisFunctionSets &&)
move constructor
STL namespace.
BasisFunctionSets & operator=(const BasisFunctionSets &)=delete
assignment constructor
int order(const EntityType &entity) const
return maximum order
Definition: discontinuousgalerkin/basisfunctionsets.hh:147
ImplementationDefined BasisFunctionSetType
basis function set
Definition: discontinuousgalerkin/basisfunctionsets.hh:27
void move(ArrayInterface< T > &array, const unsigned int oldOffset, const unsigned int newOffset, const unsigned int length)
Definition: array_inline.hh:38
ImplementationDefined EntityType
entity type
Definition: discontinuousgalerkin/basisfunctionsets.hh:29
generate a set of default basis function sets from given set of shape function sets ...
Definition: discontinuousgalerkin/basisfunctionsets.hh:82
DefaultBasisFunctionSets(Args &&...args)
Definition: discontinuousgalerkin/basisfunctionsets.hh:117
ImplementationDefined ShapeFunctionSetType
shape function set type
Definition: shapefunctionsets.hh:36
GridPart GridPartType
grid part type
Definition: discontinuousgalerkin/basisfunctionsets.hh:88
implementation of a basis function set for given entity
Definition: default.hh:46