DUNE-FEM (unstable)

lagrange.hh
1#ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_LAGRANGE_HH
2#define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_LAGRANGE_HH
3
5
6#include <dune/grid/common/gridenums.hh>
7
8#include <dune/fem/common/hybrid.hh>
9
10#include <dune/fem/gridpart/common/capabilities.hh>
11#include <dune/fem/operator/projection/local/l2projection.hh>
12#include <dune/fem/operator/projection/local/riesz.hh>
13#include <dune/fem/quadrature/cachingquadrature.hh>
14#include <dune/fem/space/common/capabilities.hh>
15#include <dune/fem/space/common/commoperations.hh>
16#include <dune/fem/space/common/defaultcommhandler.hh>
17#include <dune/fem/space/common/functionspace.hh>
18#include <dune/fem/space/common/localinterpolation.hh>
19#include <dune/fem/space/lagrange/genericbasefunctions.hh>
20#include <dune/fem/space/lagrange/shapefunctionset.hh>
21#include <dune/fem/space/shapefunctionset/selectcaching.hh>
22
23#include "basisfunctionsets.hh"
24#include "declaration.hh"
25#include "generic.hh"
26#include "shapefunctionsets.hh"
27#include "localinterpolation.hh"
28
29namespace Dune
30{
31
32 namespace Fem
33 {
34
35 // LagrangeDiscontinuousGalerkinSpaceTraits
36 // ----------------------------------------
37
38 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
39 struct LagrangeDiscontinuousGalerkinSpaceTraits
40 {
41 typedef LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > DiscreteFunctionSpaceType;
42
43 typedef GridPart GridPartType;
44 typedef GridFunctionSpace< GridPartType, FunctionSpace > FunctionSpaceType;
45
46 static const int codimension = 0;
47
50 GridPartType::dimension, 1
51 > ScalarShapeFunctionSpaceType;
52
53 typedef SelectCachingShapeFunctionSets< GridPartType, LagrangeShapeFunctionSet< ScalarShapeFunctionSpaceType, polOrder >, Storage > ScalarShapeFunctionSetsType;
54 typedef VectorialShapeFunctionSets< ScalarShapeFunctionSetsType, typename FunctionSpaceType::RangeType > ShapeFunctionSetsType;
55
56 typedef DefaultBasisFunctionSets< GridPartType, ShapeFunctionSetsType > BasisFunctionSetsType;
57 typedef typename BasisFunctionSetsType::BasisFunctionSetType BasisFunctionSetType;
58
59 typedef CodimensionMapper< GridPartType, codimension > BlockMapperType;
60
61 typedef typename GeometryWrapper<
63 >::ImplType ImplType;
64 typedef GenericLagrangeBaseFunction<
65 typename FunctionSpaceType::ScalarFunctionSpaceType, ImplType, polOrder
66 > GenericBaseFunctionType;
67
68 typedef Hybrid::IndexRange< int, FunctionSpaceType::dimRange * GenericBaseFunctionType::numBaseFunctions > LocalBlockIndices;
69
70 template <class DiscreteFunction, class Operation = DFCommunicationOperation::Copy >
71 struct CommDataHandle
72 {
73 typedef Operation OperationType;
74 typedef DefaultCommunicationHandler< DiscreteFunction, Operation > Type;
75 };
76 };
77
78
79
80 // LagrangeDiscontinuousGalerkinSpace
81 // ----------------------------------
82
83 template< class FunctionSpace, class GridPart, int polOrder, class Storage = CachingStorage >
84 class LagrangeDiscontinuousGalerkinSpace
85 : public GenericDiscontinuousGalerkinSpace< LagrangeDiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, polOrder, Storage > >
86 {
87 typedef GenericDiscontinuousGalerkinSpace< LagrangeDiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, polOrder, Storage > > BaseType;
88 typedef LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > ThisType;
89
90 public:
92
93 static const int polynomialOrder = polOrder;
94
95 typedef typename BaseType::GridPartType GridPartType;
96 typedef typename BaseType::EntityType EntityType;
97
98 typedef typename BaseType::BasisFunctionSetsType BasisFunctionSetsType;
99 typedef typename BaseType::BasisFunctionSetType BasisFunctionSetType;
100
101 private:
102 typedef CachingQuadrature< GridPart, EntityType::codimension > QuadratureType;
103 typedef DenseLocalRieszProjection< BasisFunctionSetType, QuadratureType > LocalRieszProjectionType;
104
105 public:
106 typedef DefaultLocalL2Projection< LocalRieszProjectionType, QuadratureType > InterpolationImplType;
107 typedef LocalInterpolationWrapper< ThisType > InterpolationType;
108
109 explicit LagrangeDiscontinuousGalerkinSpace ( GridPartType &gridPart,
110 const InterfaceType commInterface = InteriorBorder_All_Interface,
111 const CommunicationDirection commDirection = ForwardCommunication )
112 : BaseType( gridPart, makeBasisFunctionSets( gridPart ), commInterface, commDirection )
113 {}
114
115 static DFSpaceIdentifier type () { return LagrangeDGSpace_id; }
116
117 InterpolationType interpolation () const
118 {
119 return InterpolationType( *this );
120 }
121
122 [[deprecated]]
123 InterpolationImplType interpolation ( const EntityType &entity ) const
124 {
125 return InterpolationImplType( basisFunctionSet( entity ) );
126 }
127
128 InterpolationImplType localInterpolation ( const EntityType &entity ) const
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 >
156 struct hasFixedPolynomialOrder< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
157 {
158 static const bool v = true;
159 };
160
161 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
162 struct hasStaticPolynomialOrder< LagrangeDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, 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
Dune::Fem::DefaultBasisFunctionSet< EntityType, ShapeFunctionSetType > BasisFunctionSetType
entity type
Definition: basisfunctionsets.hh:105
DFSpaceIdentifier type() const
return type identifier of discrete function space
Definition: discretefunctionspace.hh:294
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
FunctionSpaceTraits::ScalarFunctionSpaceType ScalarFunctionSpaceType
corresponding scalar function space
Definition: functionspaceinterface.hh:83
A vector valued function space.
Definition: functionspace.hh:60
BaseType::GridPartType GridPartType
type of underlying grid part
Definition: generic.hh:40
BaseType::EntityType EntityType
type of entity of codimension 0
Definition: generic.hh:42
BaseType::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: generic.hh:49
Traits::BasisFunctionSetsType BasisFunctionSetsType
basis function sets
Definition: generic.hh:47
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition: generic.hh:106
DFSpaceIdentifier
enumerator for identification of spaces
Definition: discretefunctionspace.hh:95
@ LagrangeDGSpace_id
id for Lagrange Discontinuous Galerkin Space
Definition: discretefunctionspace.hh:106
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:170
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:86
@ ForwardCommunication
communicate as given in InterfaceType
Definition: gridenums.hh:171
@ InteriorBorder_All_Interface
send interior and border, receive all entities
Definition: gridenums.hh:88
Dune namespace.
Definition: alignedallocator.hh:13
specialize with 'true' for if the codimension 0 entity of the grid part has only one possible geometr...
Definition: capabilities.hh:29
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)