dune-fem  2.4.1-rc
hierarchiclegendre.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_HLEGENDRE_HH
2 #define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_HLEGENDRE_HH
3 
4 #include <cassert>
5 
6 #include <dune/common/power.hh>
7 
8 #include <dune/geometry/type.hh>
9 
10 #include <dune/grid/common/gridenums.hh>
11 
19 
20 #include "basisfunctionsets.hh"
21 #include "generic.hh"
22 #include "interpolation.hh"
23 #include "shapefunctionsets.hh"
24 
25 namespace Dune
26 {
27 
28  namespace Fem
29  {
30 
31  // HierarchicLegendreDiscontinuousGalerkinSpaceTraits
32  // --------------------------------------------------
33 
34  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
36  {
38 
40  typedef GridPart GridPartType;
41 
42  static const int codimension = 0;
43 
46  GridPartType::dimension, 1
48 
50  : public Dune::Fem::HierarchicLegendreShapeFunctionSet< ScalarShapeFunctionSpaceType >
51  {
53 
54  static const int numberShapeFunctions =
55  StaticPower<polOrder+1,ScalarShapeFunctionSpaceType::dimDomain>::power;
56  public:
57  explicit ScalarShapeFunctionSet ( Dune::GeometryType type )
58  : BaseType( polOrder )
59  {
60  assert( type.isCube() );
61  assert( size() == BaseType::size() );
62  }
63 
64  // overload size method because it's a static value
65  unsigned int size() const { return numberShapeFunctions; }
66  };
67 
70 
73 
75  static const int localBlockSize
76  = FunctionSpaceType::dimRange*StaticPower< polOrder+1, GridPartType::dimension >::power;
77 
78  template <class DiscreteFunction, class Operation = DFCommunicationOperation::Copy >
80  {
81  typedef Operation OperationType;
83  };
84  };
85 
86 
87 
88  // HierarchicLegendreDiscontinuousGalerkinSpace
89  // --------------------------------------------
90 
91  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage = CachingStorage >
93  : public GenericDiscontinuousGalerkinSpace< HierarchicLegendreDiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, polOrder, Storage > >
94  {
96 
97  public:
98  using BaseType::basisFunctionSet;
99 
100  static const int polynomialOrder = polOrder;
101 
102  typedef typename BaseType::GridPartType GridPartType;
103  typedef typename BaseType::EntityType EntityType;
104 
105  typedef typename BaseType::BasisFunctionSetsType BasisFunctionSetsType;
106  typedef typename BaseType::BasisFunctionSetType BasisFunctionSetType;
107 
109 
110  explicit HierarchicLegendreDiscontinuousGalerkinSpace ( GridPartType &gridPart,
111  const InterfaceType commInterface = InteriorBorder_All_Interface,
112  const CommunicationDirection commDirection = ForwardCommunication )
113  : BaseType( gridPart, basisFunctionSets( gridPart ), commInterface, commDirection )
114  {}
115 
117 
118  InterpolationType interpolation ( const EntityType &entity ) const
119  {
120  return InterpolationType( basisFunctionSet( entity ) );
121  }
122 
123  private:
124  static BasisFunctionSetsType basisFunctionSets ( const GridPartType &gridPart )
125  {
127  ShapeFunctionSetsType shapeFunctionSets( gridPart );
128  return BasisFunctionSetsType( std::move( shapeFunctionSets ) );
129  }
130  };
131 
132 
133 
134  namespace Capabilities
135  {
136 
137  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
139  {
140  static const bool v = true;
141  };
142 
143  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
145  {
146  static const bool v = true;
147  static const int order = polOrder;
148  };
149 
150  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
152  {
153  static const bool v = false;
154  };
155 
156  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
158  {
159  static const bool v = true;
160  };
161 
162  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
164  {
166  };
167 
168  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
170  {
171  static const bool v = true;
172  };
173 
174  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
176  {
177  static const bool v = false;
178  };
179 
180  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
182  {
183  static const bool v = true;
184  };
185 
186  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
188  {
189  static const bool v = true;
190  };
191 
192  } // namespace Capabilities
193 
194  } // namespace Fem
195 
196 } // namespace Dune
197 
198 #endif // #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_HLEGENDRE_HH
Definition: shapefunctionsets.hh:268
DefaultCommunicationHandler< DiscreteFunction, Operation > Type
Definition: hierarchiclegendre.hh:82
DiscontinuousGalerkinLocalL2Projection< GridPartType, BasisFunctionSetType > InterpolationType
Definition: hierarchiclegendre.hh:108
Definition: selectcaching.hh:17
VectorSpaceTraits< DomainField, RangeField, dimD, dimR >::RangeFieldType RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspaceinterface.hh:62
specialize with true if the space is localized, * i.e., the basis function set is based on a shape fu...
Definition: space/common/capabilities.hh:64
A vector valued function space.
Definition: functionspace.hh:16
GridPart GridPartType
Definition: hierarchiclegendre.hh:40
Default communication handler for discrete functions.
Definition: defaultcommhandler.hh:23
specialize with &#39;true&#39; if implementation supports parallelism (default=false)
Definition: gridpart/common/capabilities.hh:59
BaseType::GridPartType GridPartType
Definition: hierarchiclegendre.hh:102
HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > DiscreteFunctionSpaceType
Definition: hierarchiclegendre.hh:37
DFSpaceIdentifier
enumerator for identification of spaces
Definition: discretefunctionspace.hh:88
specialize with true if for a space the basis functions are sorted by the polynomial order...
Definition: space/common/capabilities.hh:128
HierarchicLegendreDiscontinuousGalerkinSpace(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: hierarchiclegendre.hh:110
ShapeFunctionSets ShapeFunctionSetsType
shape function sets type
Definition: discontinuousgalerkin/basisfunctionsets.hh:91
dimension of range vector space
Definition: functionspaceinterface.hh:47
InterpolationType interpolation(const EntityType &entity) const
Definition: hierarchiclegendre.hh:118
mapper allocating one DoF per subentity of a given codimension
Definition: codimensionmapper.hh:28
ScalarShapeFunctionSet(Dune::GeometryType type)
Definition: hierarchiclegendre.hh:57
VectorSpaceTraits< DomainField, RangeField, dimD, dimR >::DomainFieldType DomainFieldType
Intrinsic type used for values in the domain field (usually a double)
Definition: functionspaceinterface.hh:59
specialize with true if space is always continuous
Definition: space/common/capabilities.hh:46
specialize with true if space can be used with AdaptiveDiscreteFunction
Definition: space/common/capabilities.hh:89
Definition: space/discontinuousgalerkin/declaration.hh:36
Definition: coordinate.hh:4
static DFSpaceIdentifier type()
Definition: hierarchiclegendre.hh:116
CodimensionMapper< GridPartType, codimension > BlockMapperType
Definition: hierarchiclegendre.hh:74
specialize with true if space can be used in parallel
Definition: space/common/capabilities.hh:76
Dune::Fem::FunctionSpace< typename FunctionSpace::DomainFieldType, typename FunctionSpace::RangeFieldType, GridPartType::dimension, 1 > ScalarShapeFunctionSpaceType
Definition: hierarchiclegendre.hh:47
generic implementation of a Discontinuous Galerkin space based on a fixed family of basis function se...
Definition: discontinuousgalerkin/generic.hh:33
Definition: discontinuousgalerkin/interpolation.hh:24
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition: hierarchiclegendre.hh:106
SelectCachingShapeFunctionSets< GridPartType, ScalarShapeFunctionSet, Storage > ScalarShapeFunctionSetsType
Definition: hierarchiclegendre.hh:68
static const int localBlockSize
Definition: hierarchiclegendre.hh:76
DefaultBasisFunctionSets< GridPartType, ShapeFunctionSetsType > BasisFunctionSetsType
Definition: hierarchiclegendre.hh:71
BaseType::BasisFunctionSetsType BasisFunctionSetsType
Definition: hierarchiclegendre.hh:105
void move(ArrayInterface< T > &array, const unsigned int oldOffset, const unsigned int newOffset, const unsigned int length)
Definition: array_inline.hh:38
FunctionSpace FunctionSpaceType
Definition: hierarchiclegendre.hh:39
generate a set of default basis function sets from given set of shape function sets ...
Definition: discontinuousgalerkin/basisfunctionsets.hh:82
BaseType::EntityType EntityType
Definition: hierarchiclegendre.hh:103
Dune::Fem::HierarchicLegendreShapeFunctionSet< ScalarShapeFunctionSpaceType > BaseType
Definition: hierarchiclegendre.hh:52
specialize with true if polynomial order does not depend on the grid (part) entity ...
Definition: space/common/capabilities.hh:20
specialize with true if the space implementation is thread safe
Definition: space/common/capabilities.hh:102
std::size_t size() const noexcept
return number of shape functions
Definition: shapefunctionset/legendre.hh:283
specialize with true if polynomial order fixed and compile time static
Definition: space/common/capabilities.hh:33
VectorialShapeFunctionSets< ScalarShapeFunctionSetsType, typename FunctionSpaceType::RangeType > ShapeFunctionSetsType
Definition: hierarchiclegendre.hh:69
static const int numberShapeFunctions
Definition: hierarchiclegendre.hh:54
specialize with true if the space implementation is thread safe, while it is not modified ...
Definition: space/common/capabilities.hh:116
static const int codimension
Definition: hierarchiclegendre.hh:42
Definition: shapefunctionsets.hh:196
int order() const noexcept
return order of shape functions
Definition: shapefunctionset/legendre.hh:280
unsigned int size() const
Definition: hierarchiclegendre.hh:65
BasisFunctionSetsType::BasisFunctionSetType BasisFunctionSetType
Definition: hierarchiclegendre.hh:72
please doc me
Definition: shapefunctionset/legendre.hh:343
implementation of a basis function set for given entity
Definition: default.hh:46
id for Hierarchic Legendre Discontinuous Galerkin Space
Definition: discretefunctionspace.hh:98