dune-fem  2.8-git
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 
9 
22 
23 #include "basisfunctionsets.hh"
24 #include "declaration.hh"
25 #include "generic.hh"
26 #include "shapefunctionsets.hh"
27 #include "localinterpolation.hh"
28 
29 namespace Dune
30 {
31 
32  namespace Fem
33  {
34 
35  // LagrangeDiscontinuousGalerkinSpaceTraits
36  // ----------------------------------------
37 
38  template< class FunctionSpace, class GridPart, int polOrder, class Storage >
40  {
42 
43  typedef GridPart GridPartType;
45 
46  static const int codimension = 0;
47 
50  GridPartType::dimension, 1
52 
55 
58 
60 
61  typedef typename GeometryWrapper<
65  typename FunctionSpaceType::ScalarFunctionSpaceType, ImplType, polOrder
67 
69 
70  template <class DiscreteFunction, class Operation = DFCommunicationOperation::Copy >
72  {
73  typedef Operation OperationType;
75  };
76  };
77 
78 
79 
80  // LagrangeDiscontinuousGalerkinSpace
81  // ----------------------------------
82 
83  template< class FunctionSpace, class GridPart, int polOrder, class Storage = CachingStorage >
85  : public GenericDiscontinuousGalerkinSpace< LagrangeDiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, polOrder, Storage > >
86  {
89 
90  public:
92 
93  static const int polynomialOrder = polOrder;
94 
96  typedef typename BaseType::EntityType EntityType;
97 
100 
101  private:
104 
105  public:
108 
110  const InterfaceType commInterface = InteriorBorder_All_Interface,
111  const CommunicationDirection commDirection = ForwardCommunication )
112  : BaseType( gridPart, makeBasisFunctionSets( gridPart ), commInterface, commDirection )
113  {}
114 
116 
118  {
119  return InterpolationType( *this );
120  }
121 
122  [[deprecated]]
124  {
125  return InterpolationImplType( basisFunctionSet( entity ) );
126  }
127 
129  {
130  return InterpolationImplType( basisFunctionSet( entity ) );
131  }
132 
133 
134  //const InterpolationType& interpolation ( const EntityType &entity ) const
135  //{
136  // return interpolation_;
137  //}
138 
139  private:
140  //InterpolationType interpolation_;
141 
142  static BasisFunctionSetsType makeBasisFunctionSets ( const GridPartType &gridPart )
143  {
144  typedef typename BasisFunctionSetsType::ShapeFunctionSetsType ShapeFunctionSetsType;
145  ShapeFunctionSetsType shapeFunctionSets( gridPart );
146  return BasisFunctionSetsType( std::move( shapeFunctionSets ) );
147  }
148  };
149 
150 
151 
152  namespace Capabilities
153  {
154 
155  template< class FunctionSpace, class GridPart, int polOrder, class Storage >
157  {
158  static const bool v = true;
159  };
160 
161  template< class FunctionSpace, class GridPart, int polOrder, class Storage >
163  {
164  static const bool v = true;
165  static const int order = polOrder;
166  };
167 
168  template< class FunctionSpace, class GridPart, int polOrder, class Storage >
169  struct isContinuous< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
170  {
171  static const bool v = false;
172  };
173 
174  template< class FunctionSpace, class GridPart, int polOrder, class Storage >
175  struct isLocalized< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
176  {
177  static const bool v = true;
178  };
179 
180  template< class FunctionSpace, class GridPart, int polOrder, class Storage >
181  struct isAdaptive< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
182  {
183  static const bool v = true;
184  };
185 
186  template< class FunctionSpace, class GridPart, int polOrder, class Storage >
187  struct threadSafe< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
188  {
189  static const bool v = false;
190  };
191 
192  template< class FunctionSpace, class GridPart, int polOrder, class Storage >
193  struct viewThreadSafe< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
194  {
195  static const bool v = true;
196  };
197 
198  } // namespace Capabilities
199 
200  } // namespace Fem
201 
202 } // namespace Dune
203 
204 #endif // #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_LAGRANGE_HH
DFSpaceIdentifier
enumerator for identification of spaces
Definition: discretefunctionspace.hh:94
@ LagrangeDGSpace_id
id for Lagrange Discontinuous Galerkin Space
Definition: discretefunctionspace.hh:105
Definition: bindguard.hh:11
typename Impl::GridFunctionSpace< GridPart, T >::Type GridFunctionSpace
Definition: functionspace.hh:317
Definition: hybrid.hh:86
specialize with 'true' for if the codimension 0 entity of the grid part has only one possible geometr...
Definition: gridpart/common/capabilities.hh:29
Definition: l2projection.hh:117
quadrature class supporting base function caching
Definition: cachingquadrature.hh:41
Definition: space/basisfunctionset/default.hh:52
specialize with true if polynomial order does not depend on the grid (part) entity
Definition: space/common/capabilities.hh:24
static const bool v
Definition: space/common/capabilities.hh:25
specialize with true if polynomial order fixed and compile time static
Definition: space/common/capabilities.hh:37
static const bool v
Definition: space/common/capabilities.hh:38
static const int order
Definition: space/common/capabilities.hh:39
specialize with true if space is always continuous
Definition: space/common/capabilities.hh:50
static const bool v
Definition: space/common/capabilities.hh:51
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:68
static const bool v
Definition: space/common/capabilities.hh:69
specialize with true if space can be used with AdaptiveDiscreteFunction
Definition: space/common/capabilities.hh:81
static const bool v
Definition: space/common/capabilities.hh:82
specialize with true if the space implementation is thread safe
Definition: space/common/capabilities.hh:94
static const bool v
Definition: space/common/capabilities.hh:95
specialize with true if the space implementation is thread safe, while it is not modified
Definition: space/common/capabilities.hh:108
static const bool v
Definition: space/common/capabilities.hh:109
Default communication handler for discrete functions.
Definition: defaultcommhandler.hh:29
Traits ::GridPartType GridPartType
type of underlying grid part
Definition: discretefunctionspace.hh:210
GridPartType ::template Codim< Traits::codimension >::EntityType EntityType
type of entity of codimension 0
Definition: discretefunctionspace.hh:223
GridPartType & gridPart() const
Definition: discretefunctionspace.hh:745
A vector valued function space.
Definition: functionspace.hh:60
FunctionSpaceTraits::DomainFieldType DomainFieldType
Intrinsic type used for values in the domain field (usually a double)
Definition: functionspaceinterface.hh:60
FunctionSpaceTraits::RangeFieldType RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspaceinterface.hh:63
Definition: common/localinterpolation.hh:74
generate a set of default basis function sets from given set of shape function sets
Definition: discontinuousgalerkin/basisfunctionsets.hh:83
Definition: discontinuousgalerkin/lagrange.hh:86
InterpolationType interpolation() const
Definition: discontinuousgalerkin/lagrange.hh:117
BaseType::BasisFunctionSetsType BasisFunctionSetsType
Definition: discontinuousgalerkin/lagrange.hh:98
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition: discontinuousgalerkin/lagrange.hh:99
BaseType::GridPartType GridPartType
Definition: discontinuousgalerkin/lagrange.hh:95
InterpolationImplType localInterpolation(const EntityType &entity) const
Definition: discontinuousgalerkin/lagrange.hh:128
DefaultLocalL2Projection< LocalRieszProjectionType, QuadratureType > InterpolationImplType
Definition: discontinuousgalerkin/lagrange.hh:106
BaseType::EntityType EntityType
Definition: discontinuousgalerkin/lagrange.hh:96
LagrangeDiscontinuousGalerkinSpace(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: discontinuousgalerkin/lagrange.hh:109
LocalInterpolationWrapper< ThisType > InterpolationType
Definition: discontinuousgalerkin/lagrange.hh:107
static DFSpaceIdentifier type()
Definition: discontinuousgalerkin/lagrange.hh:115
InterpolationImplType interpolation(const EntityType &entity) const
Definition: discontinuousgalerkin/lagrange.hh:123
static const int polynomialOrder
Definition: discontinuousgalerkin/lagrange.hh:93
generic implementation of a Discontinuous Galerkin space based on a fixed family of basis function se...
Definition: discontinuousgalerkin/generic.hh:31
BaseType::GridPartType GridPartType
type of underlying grid part
Definition: discontinuousgalerkin/generic.hh:40
BaseType::EntityType EntityType
type of entity of codimension 0
Definition: discontinuousgalerkin/generic.hh:42
BaseType::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: discontinuousgalerkin/generic.hh:49
Traits::BasisFunctionSetsType BasisFunctionSetsType
basis function sets
Definition: discontinuousgalerkin/generic.hh:47
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition: discontinuousgalerkin/generic.hh:106
Definition: discontinuousgalerkin/lagrange.hh:40
static const int codimension
Definition: discontinuousgalerkin/lagrange.hh:46
VectorialShapeFunctionSets< ScalarShapeFunctionSetsType, typename FunctionSpaceType::RangeType > ShapeFunctionSetsType
Definition: discontinuousgalerkin/lagrange.hh:54
Dune::Fem::FunctionSpace< typename FunctionSpace::DomainFieldType, typename FunctionSpace::RangeFieldType, GridPartType::dimension, 1 > ScalarShapeFunctionSpaceType
Definition: discontinuousgalerkin/lagrange.hh:51
SelectCachingShapeFunctionSets< GridPartType, LagrangeShapeFunctionSet< ScalarShapeFunctionSpaceType, polOrder >, Storage > ScalarShapeFunctionSetsType
Definition: discontinuousgalerkin/lagrange.hh:53
GridFunctionSpace< GridPartType, FunctionSpace > FunctionSpaceType
Definition: discontinuousgalerkin/lagrange.hh:44
BasisFunctionSetsType::BasisFunctionSetType BasisFunctionSetType
Definition: discontinuousgalerkin/lagrange.hh:57
GenericLagrangeBaseFunction< typename FunctionSpaceType::ScalarFunctionSpaceType, ImplType, polOrder > GenericBaseFunctionType
Definition: discontinuousgalerkin/lagrange.hh:66
Hybrid::IndexRange< int, FunctionSpaceType::dimRange *GenericBaseFunctionType::numBaseFunctions > LocalBlockIndices
Definition: discontinuousgalerkin/lagrange.hh:68
GeometryWrapper< Dune::Fem::GridPartCapabilities::hasSingleGeometryType< GridPartType >::topologyId, GridPartType::dimension >::ImplType ImplType
Definition: discontinuousgalerkin/lagrange.hh:63
LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > DiscreteFunctionSpaceType
Definition: discontinuousgalerkin/lagrange.hh:41
CodimensionMapper< GridPartType, codimension > BlockMapperType
Definition: discontinuousgalerkin/lagrange.hh:59
GridPart GridPartType
Definition: discontinuousgalerkin/lagrange.hh:43
DefaultBasisFunctionSets< GridPartType, ShapeFunctionSetsType > BasisFunctionSetsType
Definition: discontinuousgalerkin/lagrange.hh:56
Definition: discontinuousgalerkin/lagrange.hh:72
DefaultCommunicationHandler< DiscreteFunction, Operation > Type
Definition: discontinuousgalerkin/lagrange.hh:74
Operation OperationType
Definition: discontinuousgalerkin/lagrange.hh:73
Definition: shapefunctionsets.hh:197
Definition: shapefunctionsets.hh:271
Definition: genericbasefunctions.hh:15
Definition: genericgeometry.hh:175
mapper allocating one DoF per subentity of a given codimension
Definition: codimensionmapper.hh:330