dune-fem  2.4.1-rc
discontinuousgalerkin/lagrange.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_LAGRANGE_HH
2 #define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_LAGRANGE_HH
3 
4 #include <dune/geometry/type.hh>
5 
6 #include <dune/grid/common/gridenums.hh>
7 
19 
20 #include "basisfunctionsets.hh"
21 #include "declaration.hh"
22 #include "generic.hh"
23 #include "shapefunctionsets.hh"
24 
25 namespace Dune
26 {
27 
28  namespace Fem
29  {
30 
31  // LagrangeDiscontinuousGalerkinSpaceTraits
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 
51 
54 
56 
57  typedef typename GeometryWrapper<
63 
64  static const int localBlockSize
65  = FunctionSpaceType::dimRange*GenericBaseFunctionType::numBaseFunctions;
66 
67  template <class DiscreteFunction, class Operation = DFCommunicationOperation::Copy >
69  {
70  typedef Operation OperationType;
72  };
73  };
74 
75 
76 
77  // LagrangeDiscontinuousGalerkinSpace
78  // ----------------------------------
79 
80  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage = CachingStorage >
82  : public GenericDiscontinuousGalerkinSpace< LagrangeDiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, polOrder, Storage > >
83  {
85 
86  public:
87  using BaseType::basisFunctionSet;
88 
89  static const int polynomialOrder = polOrder;
90 
91  typedef typename BaseType::GridPartType GridPartType;
92  typedef typename BaseType::EntityType EntityType;
93 
94  typedef typename BaseType::BasisFunctionSetsType BasisFunctionSetsType;
95  typedef typename BaseType::BasisFunctionSetType BasisFunctionSetType;
96 
97  private:
100 
101  public:
103 
104  explicit LagrangeDiscontinuousGalerkinSpace ( GridPartType &gridPart,
105  const InterfaceType commInterface = InteriorBorder_All_Interface,
106  const CommunicationDirection commDirection = ForwardCommunication )
107  : BaseType( gridPart, basisFunctionSets( gridPart ), commInterface, commDirection )
108  {}
109 
111 
112  InterpolationType interpolation ( const EntityType &entity ) const
113  {
114  return InterpolationType( basisFunctionSet( entity ) );
115  }
116 
117  private:
118  static BasisFunctionSetsType basisFunctionSets ( const GridPartType &gridPart )
119  {
121  ShapeFunctionSetsType shapeFunctionSets( gridPart );
122  return BasisFunctionSetsType( std::move( shapeFunctionSets ) );
123  }
124  };
125 
126 
127 
128  namespace Capabilities
129  {
130 
131  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
133  {
134  static const bool v = true;
135  };
136 
137  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
139  {
140  static const bool v = true;
141  static const int order = polOrder;
142  };
143 
144  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
145  struct isContinuous< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
146  {
147  static const bool v = false;
148  };
149 
150  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
151  struct isLocalized< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
152  {
153  static const bool v = true;
154  };
155 
156  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
157  struct isParallel< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
158  {
160  };
161 
162  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
163  struct isAdaptive< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
164  {
165  static const bool v = true;
166  };
167 
168  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
169  struct threadSafe< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
170  {
171  static const bool v = false;
172  };
173 
174  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
175  struct viewThreadSafe< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
176  {
177  static const bool v = true;
178  };
179 
180  } // namespace Capabilities
181 
182  } // namespace Fem
183 
184 } // namespace Dune
185 
186 #endif // #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_LAGRANGE_HH
Definition: shapefunctionsets.hh:268
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
Definition: local/l2projection.hh:114
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
BaseType::EntityType EntityType
Definition: discontinuousgalerkin/lagrange.hh:92
A vector valued function space.
Definition: functionspace.hh:16
CodimensionMapper< GridPartType, codimension > BlockMapperType
Definition: discontinuousgalerkin/lagrange.hh:55
Definition: space/discontinuousgalerkin/declaration.hh:22
Default communication handler for discrete functions.
Definition: defaultcommhandler.hh:23
GridPart GridPartType
Definition: discontinuousgalerkin/lagrange.hh:40
specialize with &#39;true&#39; if implementation supports parallelism (default=false)
Definition: gridpart/common/capabilities.hh:59
DFSpaceIdentifier
enumerator for identification of spaces
Definition: discretefunctionspace.hh:88
DefaultBasisFunctionSets< GridPartType, ShapeFunctionSetsType > BasisFunctionSetsType
Definition: discontinuousgalerkin/lagrange.hh:52
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition: discontinuousgalerkin/lagrange.hh:95
LagrangeDiscontinuousGalerkinSpace(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: discontinuousgalerkin/lagrange.hh:104
SelectCachingShapeFunctionSets< GridPartType, LagrangeShapeFunctionSet< ScalarShapeFunctionSpaceType, polOrder >, Storage > ScalarShapeFunctionSetsType
Definition: discontinuousgalerkin/lagrange.hh:49
VectorialShapeFunctionSets< ScalarShapeFunctionSetsType, typename FunctionSpaceType::RangeType > ShapeFunctionSetsType
Definition: discontinuousgalerkin/lagrange.hh:50
BaseType::BasisFunctionSetsType BasisFunctionSetsType
Definition: discontinuousgalerkin/lagrange.hh:94
ShapeFunctionSets ShapeFunctionSetsType
shape function sets type
Definition: discontinuousgalerkin/basisfunctionsets.hh:91
quadrature class supporting base function caching
Definition: cachingquadrature.hh:41
dimension of range vector space
Definition: functionspaceinterface.hh:47
mapper allocating one DoF per subentity of a given codimension
Definition: codimensionmapper.hh:28
GeometryWrapper< Dune::Fem::GridPartCapabilities::hasSingleGeometryType< GridPartType >::topologyId, GridPartType::dimension >::GenericGeometryType GenericGeometryType
Definition: discontinuousgalerkin/lagrange.hh:59
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
DefaultCommunicationHandler< DiscreteFunction, Operation > Type
Definition: discontinuousgalerkin/lagrange.hh:71
specialize with true if space can be used with AdaptiveDiscreteFunction
Definition: space/common/capabilities.hh:89
id for Lagrange Discontinuous Galerkin Space
Definition: discretefunctionspace.hh:99
Definition: discontinuousgalerkin/lagrange.hh:68
LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > DiscreteFunctionSpaceType
Definition: discontinuousgalerkin/lagrange.hh:37
GenericLagrangeBaseFunction< typename FunctionSpaceType::ScalarFunctionSpaceType, GenericGeometryType, polOrder > GenericBaseFunctionType
Definition: discontinuousgalerkin/lagrange.hh:62
Dune::Fem::FunctionSpace< typename FunctionSpace::DomainFieldType, typename FunctionSpace::RangeFieldType, GridPartType::dimension, 1 > ScalarShapeFunctionSpaceType
Definition: discontinuousgalerkin/lagrange.hh:47
BaseType::GridPartType GridPartType
Definition: discontinuousgalerkin/lagrange.hh:91
Definition: coordinate.hh:4
Definition: genericgeometry.hh:172
static const int localBlockSize
Definition: discontinuousgalerkin/lagrange.hh:65
specialize with true if space can be used in parallel
Definition: space/common/capabilities.hh:76
generic implementation of a Discontinuous Galerkin space based on a fixed family of basis function se...
Definition: discontinuousgalerkin/generic.hh:33
DefaultLocalL2Projection< LocalRieszProjectionType, QuadratureType > InterpolationType
Definition: discontinuousgalerkin/lagrange.hh:102
specialize with &#39;true&#39; for if the codimension 0 entity of the grid part has only one possible geometr...
Definition: gridpart/common/capabilities.hh:28
void move(ArrayInterface< T > &array, const unsigned int oldOffset, const unsigned int newOffset, const unsigned int length)
Definition: array_inline.hh:38
generate a set of default basis function sets from given set of shape function sets ...
Definition: discontinuousgalerkin/basisfunctionsets.hh:82
static DFSpaceIdentifier type()
Definition: discontinuousgalerkin/lagrange.hh:110
specialize with true if polynomial order does not depend on the grid (part) entity ...
Definition: space/common/capabilities.hh:20
Definition: discontinuousgalerkin/lagrange.hh:35
specialize with true if the space implementation is thread safe
Definition: space/common/capabilities.hh:102
BasisFunctionSetsType::BasisFunctionSetType BasisFunctionSetType
Definition: discontinuousgalerkin/lagrange.hh:53
specialize with true if polynomial order fixed and compile time static
Definition: space/common/capabilities.hh:33
InterpolationType interpolation(const EntityType &entity) const
Definition: discontinuousgalerkin/lagrange.hh:112
FunctionSpace FunctionSpaceType
Definition: discontinuousgalerkin/lagrange.hh:39
Definition: genericbasefunctions.hh:15
specialize with true if the space implementation is thread safe, while it is not modified ...
Definition: space/common/capabilities.hh:116
VectorSpaceTraits< DomainField, RangeField, dimD, dimR >::ScalarFunctionSpaceType ScalarFunctionSpaceType
corresponding scalar function space
Definition: functionspaceinterface.hh:82
Definition: shapefunctionsets.hh:196
Operation OperationType
Definition: discontinuousgalerkin/lagrange.hh:70
implementation of a basis function set for given entity
Definition: default.hh:46
static const int codimension
Definition: discontinuousgalerkin/lagrange.hh:42