dune-fem  2.6-git
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 
49 
57  int order () const;
58 
60  int order ( const EntityType &entity ) const;
61 
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:
113  : shapeFunctionSets_( std::move( shapeFunctionSets ) )
114  {}
115 
116  template< class... Args, std::enable_if_t< std::is_constructible< ShapeFunctionSetsType, Args &&... >::value, int > = 0 >
117  explicit DefaultBasisFunctionSets ( Args &&... args )
118  : shapeFunctionSets_( std::forward< Args >( args )... )
119  {}
120 
127  DefaultBasisFunctionSets ( const ThisType & ) = delete;
128  DefaultBasisFunctionSets ( ThisType &&other ) = default;
129 
132 
140  int order () const { return shapeFunctionSets().order(); }
141 
143  int order ( const EntityType &entity ) const { return shapeFunctionSets().order( entity.type() ); }
144 
147  {
148  return BasisFunctionSetType( entity, shapeFunctionSets().shapeFunctionSet( entity.type() ) );
149  }
150 
153  const ShapeFunctionSetsType &shapeFunctionSets () const { return shapeFunctionSets_; }
154  ShapeFunctionSetsType &shapeFunctionSets () { return shapeFunctionSets_; }
155 
156  private:
157  ShapeFunctionSetsType shapeFunctionSets_;
158  };
159 
160  } // namespace Fem
161 
162 } // namespace Dune
163 
164 #endif // #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_BASISFUNCTIONSETS_HH
Definition: bindguard.hh:11
Definition: basisfunctionset/default.hh:47
interface class representing a family of basis function sets
Definition: discontinuousgalerkin/basisfunctionsets.hh:24
int order(const EntityType &entity) const
return order for given grid part entity
ImplementationDefined BasisFunctionSetType
basis function set
Definition: discontinuousgalerkin/basisfunctionsets.hh:27
int order() const
return maximum order
BasisFunctionSets & operator=(const BasisFunctionSets &)=delete
assignment constructor
BasisFunctionSets(const BasisFunctionSets &)=delete
copy constructor
ImplementationDefined EntityType
entity type
Definition: discontinuousgalerkin/basisfunctionsets.hh:29
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
return basis function set for given entity
BasisFunctionSets(BasisFunctionSets &&)
move constructor
generate a set of default basis function sets from given set of shape function sets
Definition: discontinuousgalerkin/basisfunctionsets.hh:83
int order(const EntityType &entity) const
return maximum order
Definition: discontinuousgalerkin/basisfunctionsets.hh:143
DefaultBasisFunctionSets & operator=(const ThisType &)=delete
GridPart GridPartType
grid part type
Definition: discontinuousgalerkin/basisfunctionsets.hh:88
GridPartType::template Codim< codimension >::EntityType EntityType
entity type
Definition: discontinuousgalerkin/basisfunctionsets.hh:102
int order() const
return maximum order
Definition: discontinuousgalerkin/basisfunctionsets.hh:140
DefaultBasisFunctionSets(ThisType &&other)=default
Dune::Fem::DefaultBasisFunctionSet< EntityType, ShapeFunctionSetType > BasisFunctionSetType
entity type
Definition: discontinuousgalerkin/basisfunctionsets.hh:105
ShapeFunctionSetsType & shapeFunctionSets()
Definition: discontinuousgalerkin/basisfunctionsets.hh:154
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
return basis function set for given entity
Definition: discontinuousgalerkin/basisfunctionsets.hh:146
DefaultBasisFunctionSets(ShapeFunctionSetsType &&shapeFunctionSets)
Definition: discontinuousgalerkin/basisfunctionsets.hh:112
DefaultBasisFunctionSets(Args &&... args)
Definition: discontinuousgalerkin/basisfunctionsets.hh:117
ShapeFunctionSets ShapeFunctionSetsType
shape function sets type
Definition: discontinuousgalerkin/basisfunctionsets.hh:91
ShapeFunctionSetsType::ShapeFunctionSetType ShapeFunctionSetType
shape function set type
Definition: discontinuousgalerkin/basisfunctionsets.hh:93
const ShapeFunctionSetsType & shapeFunctionSets() const
Definition: discontinuousgalerkin/basisfunctionsets.hh:153
DefaultBasisFunctionSets(const ThisType &)=delete
interface class representing a family of shape function sets
Definition: shapefunctionsets.hh:33
ImplementationDefined ShapeFunctionSetType
shape function set type
Definition: shapefunctionsets.hh:36
int order() const
return maximum order