dune-fem  2.4.1-rc
discontinuousgalerkin/generic.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_GENERIC_HH
2 #define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_GENERIC_HH
3 
4 #include <utility>
5 
6 #include <dune/common/deprecated.hh>
7 #include <dune/common/std/constexpr.hh>
8 
12 
13 #include "localinterpolation.hh"
14 #include "localrestrictprolong.hh"
15 
16 namespace Dune
17 {
18 
19  namespace Fem
20  {
21 
22  // GenericDiscontinuousGalerkinSpace
23  // ---------------------------------
24 
32  template< class Traits >
34  : public DiscreteFunctionSpaceDefault< Traits >
35  {
38 
39  public:
41  static const int codimension = Traits::codimension;
42 
46  typedef typename BaseType::EntityType EntityType;
49 
54 
57 
58  protected:
59  using BaseType::asImp;
60 
61  public:
66  explicit GenericDiscontinuousGalerkinSpace ( GridPartType &gridPart, BasisFunctionSetsType &&basisFunctionSets,
67  const InterfaceType commInterface = InteriorBorder_All_Interface,
68  const CommunicationDirection commDirection = ForwardCommunication )
69  : BaseType( gridPart, commInterface, commDirection ),
70  basisFunctionSets_( std::forward< BasisFunctionSetsType >( basisFunctionSets ) ),
71  blockMapper_( gridPart )
72  {}
73 
80  GenericDiscontinuousGalerkinSpace ( const ThisType & ) = delete;
81 
83  GenericDiscontinuousGalerkinSpace ( ThisType &&other )
84  : BaseType( other ),
85  basisFunctionSets_( std::move( other.basisFunctionSets_ ) ),
86  blockMapper_( std::move( blockMapper_ ) )
87  {}
88 
89  GenericDiscontinuousGalerkinSpace &operator= ( const ThisType & ) = default;
90 
98  static DFSpaceIdentifier type () { return DGSpace_id; }
99 
101  BasisFunctionSetType basisFunctionSet ( const EntityType &entity ) const
102  {
103  return basisFunctionSets_.basisFunctionSet( entity );
104  }
105 
107  static DUNE_CONSTEXPR bool continuous () { return false; }
108 
110  static DUNE_CONSTEXPR bool continuous ( const IntersectionType &intersection ) { return false; }
111 
113  int order () const { return basisFunctionSets_.order(); }
114 
116  int order ( const EntityType &entity ) const { return basisFunctionSets_.order( entity ); }
117 
119  BlockMapperType &blockMapper () const { return blockMapper_; }
120 
132  template< class LocalFunction, class LocalDofVector >
133  DUNE_DEPRECATED
134  void interpolate ( const LocalFunction &localFunction, LocalDofVector &localDofVector ) const
135  {
136  const EntityType &entity = localFunction.entity();
137  asImp().interpolation( entity )( localFunction, localDofVector );
138  }
139 
142  private:
143  BasisFunctionSetsType basisFunctionSets_;
144  mutable BlockMapperType blockMapper_;
145  };
146 
147  } // namespace Fem
148 
149 } // namespace Dune
150 
151 #endif // #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_GENERIC_HH
BaseType::EntityType EntityType
Definition: discretefunctionspace.hh:613
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition: discontinuousgalerkin/generic.hh:119
DFSpaceIdentifier
enumerator for identification of spaces
Definition: discretefunctionspace.hh:88
Local interpolation for Discontinuous Galerkin spaces.
Traits::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: discretefunctionspace.hh:179
LocalFunctionType localFunction(const EntityType &entity) const
Definition: discretefunctionspace.hh:692
int order(const EntityType &entity) const
get global order of space
Definition: discontinuousgalerkin/generic.hh:116
Traits::BlockMapperType BlockMapperType
type of block mapper of this space
Definition: discretefunctionspace.hh:181
interface for local functions
Definition: localfunction.hh:41
const DiscreteFunctionSpaceType & asImp() const
Definition: discretefunctionspace.hh:546
GenericDiscontinuousGalerkinSpace(ThisType &&other)
move constructor
Definition: discontinuousgalerkin/generic.hh:83
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition: discontinuousgalerkin/generic.hh:101
Definition: coordinate.hh:4
BaseType::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: discontinuousgalerkin/generic.hh:53
static const int codimension
Definition: discontinuousgalerkin/generic.hh:41
const EntityType & entity() const
obtain the entity, this local function lives on
Definition: localfunction.hh:285
GenericDiscontinuousGalerkinSpace(GridPartType &gridPart, BasisFunctionSetsType &&basisFunctionSets, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: discontinuousgalerkin/generic.hh:66
generic implementation of a Discontinuous Galerkin space based on a fixed family of basis function se...
Definition: discontinuousgalerkin/generic.hh:33
STL namespace.
BaseType::GridPartType GridPartType
Definition: discretefunctionspace.hh:609
GenericDiscontinuousGalerkinSpace & operator=(const ThisType &)=default
static DUNE_CONSTEXPR bool continuous()
returns true if the space contains only globally continuous functions
Definition: discontinuousgalerkin/generic.hh:107
id for Discontinuous Galerkin Space
Definition: discretefunctionspace.hh:91
BaseType::IntersectionType IntersectionType
type of the intersections
Definition: discontinuousgalerkin/generic.hh:48
void move(ArrayInterface< T > &array, const unsigned int oldOffset, const unsigned int newOffset, const unsigned int length)
Definition: array_inline.hh:38
This is the class with default implementations for discrete function. The methods not marked with hav...
Definition: discretefunctionspace.hh:595
generate a set of default basis function sets from given set of shape function sets ...
Definition: discontinuousgalerkin/basisfunctionsets.hh:82
BaseType::GridPartType GridPartType
type of underlying grid part
Definition: discontinuousgalerkin/generic.hh:44
GridPartType::IntersectionType IntersectionType
type of the intersections
Definition: discretefunctionspace.hh:202
GridPartType & gridPart() const
Definition: discretefunctionspace.hh:714
BaseType::BlockMapperType BlockMapperType
type of block mapper of this space
Definition: discontinuousgalerkin/generic.hh:56
BaseType::EntityType EntityType
type of entity of codimension 0
Definition: discontinuousgalerkin/generic.hh:46
static DUNE_CONSTEXPR bool continuous(const IntersectionType &intersection)
returns true if the space contains only globally continuous functions
Definition: discontinuousgalerkin/generic.hh:110
static DFSpaceIdentifier type()
return type identifier of discrete function space
Definition: discontinuousgalerkin/generic.hh:98
Traits::BasisFunctionSetsType BasisFunctionSetsType
basis function sets
Definition: discontinuousgalerkin/generic.hh:51
int order() const
get global order of space
Definition: discontinuousgalerkin/generic.hh:113
void interpolate(const LocalFunction &localFunction, LocalDofVector &localDofVector) const
local interpolation using discontinuous L2-projection
Definition: discontinuousgalerkin/generic.hh:134