dune-fem 2.12-git
Loading...
Searching...
No Matches
hpdg/legendre.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_HPDG_SPACE_DISCONTINUOUSGALERKIN_LEGENDRE_HH
2#define DUNE_FEM_HPDG_SPACE_DISCONTINUOUSGALERKIN_LEGENDRE_HH
3
5
12
15
16#include "blockmapper.hh"
17#include "space.hh"
18
19namespace Dune
20{
21
22 namespace Fem
23 {
24
25 namespace hpDG
26 {
27
28 // Internal forward declaration
29 // ----------------------------
30
31 template< class FunctionSpace, class GridPart, int order, class Storage = Fem::CachingStorage >
32 class LegendreDiscontinuousGalerkinSpace;
33
34 template< class FunctionSpace, class GridPart, int order, class Storage = Fem::CachingStorage >
35 class HierarchicLegendreDiscontinuousGalerkinSpace;
36
37
38#ifndef DOXYGEN
39
40 // LegendreDiscontinuousGalerkinSpaceTraits
41 // ----------------------------------------
42
43 template< class FunctionSpace, class GridPart, int order, bool hierarchicalOrdering, class Storage >
44 struct LegendreDiscontinuousGalerkinSpaceTraits
45 {
46 // select space implementation depending on basis function ordering
47 typedef typename std::conditional< hierarchicalOrdering,
48 HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage >,
49 LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage > >::type DiscreteFunctionSpaceType;
50
51 using FunctionSpaceType = FunctionSpace;
52
53 using GridPartType = GridPart;
54
55 using BasisFunctionSetsType = hpDG::LegendreBasisFunctionSets< FunctionSpaceType, GridPartType, order, hierarchicalOrdering, Storage >;
56 using BasisFunctionSetType = typename BasisFunctionSetsType::BasisFunctionSetType;
57
58 static const int codimension = BasisFunctionSetType::EntityType::codimension;
59
60 using BlockMapperType = hpDG::DiscontinuousGalerkinBlockMapper< GridPartType, BasisFunctionSetsType >;
61 static const int localBlockSize = BasisFunctionSetsType::localBlockSize;
62
63 typedef Hybrid::IndexRange< int, localBlockSize > LocalBlockIndices;
64
65 template< class DiscreteFunction, class Operation = Dune::Fem::DFCommunicationOperation::Copy >
66 struct CommDataHandle
67 {
68 using OperationType = Operation;
70 };
71 };
72
73#endif // #ifndef DOXYGEN
74
75
76
77 // LegendreDiscontinuousGalerkinSpace
78 // ----------------------------------
79
89 template< class FunctionSpace, class GridPart, int order, class Storage >
91 : public hpDG::DiscontinuousGalerkinSpace< LegendreDiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, order, false, Storage > >
92 {
94
95 public:
96 static const int polynomialOrder = order;
97
100 using KeyType = typename BaseType::KeyType;
101
103 const KeyType initialOrder,
106 : BaseType( gridPart, BasisFunctionSetsType{}, initialOrder, interface, direction )
107 {}
108
114
115 template< class Function >
121 };
122
123 // HierarchicLegendreDiscontinuousGalerkinSpace
124 // --------------------------------------------
125
135 template< class FunctionSpace, class GridPart, int order, class Storage >
137 : public hpDG::DiscontinuousGalerkinSpace< LegendreDiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, order, true, Storage > >
138 {
140
141 public:
142 static const int polynomialOrder = order;
143
147 using KeyType = typename BaseType::KeyType;
148
150 const KeyType initialOrder,
153 : BaseType( gridPart, BasisFunctionSetsType{}, initialOrder, interface, direction )
154 {}
155
161
162 template <class Function,
165 decltype(Function(std::declval<const EntityType>()))>::value,int> i=0>
171 };
172
173 } // namespace hpDG
174
175
176
177#ifndef DOXYGEN
178
179 // DefaultLocalRestrictProlong
180 // ---------------------------
181
182 template< class FunctionSpace, class GridPart, int order, class Storage >
183 class DefaultLocalRestrictProlong< hpDG::LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage > >
184 : public DiscontinuousGalerkinLocalRestrictProlong< hpDG::LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage >, false >
185 {
186 using BaseType = DiscontinuousGalerkinLocalRestrictProlong< hpDG::LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage >, false >;
187
188 public:
189 explicit DefaultLocalRestrictProlong ( const typename BaseType::DiscreteFunctionSpaceType &space )
190 : BaseType( space )
191 {}
192 };
193
194
195 // DefaultLocalRestrictProlong
196 // ---------------------------
197
198 template< class FunctionSpace, class GridPart, int order, class Storage >
199 class DefaultLocalRestrictProlong< hpDG::HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage > >
200 : public DiscontinuousGalerkinLocalRestrictProlong< hpDG::HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage >, false >
201 {
202 using BaseType = DiscontinuousGalerkinLocalRestrictProlong< hpDG::HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage >, false >;
203
204 public:
205 explicit DefaultLocalRestrictProlong ( const typename BaseType::DiscreteFunctionSpaceType &space )
206 : BaseType( space )
207 {}
208 };
209
210
211#endif // #ifndef DOXYGEN
212
213
214 namespace Capabilities
215 {
217 // hpDG::LegendreDiscontinuousGalerkinSpace
219
220 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
221 struct hasStaticPolynomialOrder< hpDG::LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
222 {
223 static const bool v = true;
224 static const int order = polOrder;
225 };
226
227 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
228 struct isLocalized< hpDG::LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
229 {
230 static const bool v = true;
231 };
232
233 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
234 struct isAdaptive< hpDG::LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
235 {
236 static const bool v = true;
237 };
238
239 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
240 struct viewThreadSafe< hpDG::LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
241 {
242 static const bool v = true;
243 };
244
246 // hpDG::HierarchicLegendreDiscontinuousGalerkinSpace
248
249 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
250 struct hasStaticPolynomialOrder< hpDG::HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
251 {
252 static const bool v = true;
253 static const int order = polOrder;
254 };
255
256 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
257 struct isLocalized< hpDG::HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
258 {
259 static const bool v = true;
260 };
261
262 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
263 struct isAdaptive< hpDG::HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
264 {
265 static const bool v = true;
266 };
267
268 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
269 struct isPAdaptiveSpace< hpDG::HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
270 {
271 static const bool v = true;
272 };
273
274 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
275 struct viewThreadSafe< hpDG::HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
276 {
277 static const bool v = true;
278 };
279
280 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
281 struct isHierarchic< hpDG::HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
282 {
283 static const bool v = true;
284 };
285
286 } // namespace Capabilities
287
288 } // namespace Fem
289
290} // namespace Dune
291
292#endif // #ifndef DUNE_FEM_HPDG_SPACE_DISCONTINUOUSGALERKIN_LEGENDRE_HH
CommunicationDirection
InterfaceType
ForwardCommunication
InteriorBorder_All_Interface
Abstract class representing a function.
Definition common/function.hh:50
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 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 space can be used with p-adaptation
Definition space/common/capabilities.hh:93
static const bool v
Definition space/common/capabilities.hh:94
specialize with true if the space implementation is thread safe, while it is not modified
Definition space/common/capabilities.hh:119
static const bool v
Definition space/common/capabilities.hh:120
specialize with true if for a space the basis functions are sorted by the polynomial order,...
Definition space/common/capabilities.hh:131
static const bool v
Definition space/common/capabilities.hh:132
Default communication handler for discrete functions.
Definition defaultcommhandler.hh:38
GridPartType & gridPart() const
Definition discretefunctionspace.hh:766
Definition discontinuousgalerkin/legendre.hh:141
Implementation of an -adaptive discrete function space using product Legendre polynomials.
Definition hpdg/legendre.hh:92
typename BaseType::BasisFunctionSetsType BasisFunctionSetsType
Definition hpdg/legendre.hh:99
typename BaseType::GridPartType GridPartType
Definition hpdg/legendre.hh:98
LegendreDiscontinuousGalerkinSpace(GridPartType &gridPart, const Dune::InterfaceType interface=Dune::InteriorBorder_All_Interface, const Dune::CommunicationDirection direction=Dune::ForwardCommunication)
Definition hpdg/legendre.hh:109
static const int polynomialOrder
Definition hpdg/legendre.hh:96
typename BaseType::KeyType KeyType
Definition hpdg/legendre.hh:100
LegendreDiscontinuousGalerkinSpace(GridPartType &gridPart, Function function, const Dune::InterfaceType interface=Dune::InteriorBorder_All_Interface, const Dune::CommunicationDirection direction=Dune::ForwardCommunication)
Definition hpdg/legendre.hh:116
LegendreDiscontinuousGalerkinSpace(GridPartType &gridPart, const KeyType initialOrder, const Dune::InterfaceType interface=Dune::InteriorBorder_All_Interface, const Dune::CommunicationDirection direction=Dune::ForwardCommunication)
Definition hpdg/legendre.hh:102
Implementation of an -adaptive discrete function space using product Legendre polynomials.
Definition hpdg/legendre.hh:138
typename BaseType::EntityType EntityType
Definition hpdg/legendre.hh:145
HierarchicLegendreDiscontinuousGalerkinSpace(GridPartType &gridPart, const Dune::InterfaceType interface=Dune::InteriorBorder_All_Interface, const Dune::CommunicationDirection direction=Dune::ForwardCommunication)
Definition hpdg/legendre.hh:156
typename BaseType::KeyType KeyType
Definition hpdg/legendre.hh:147
static const int polynomialOrder
Definition hpdg/legendre.hh:142
typename BaseType::GridPartType GridPartType
Definition hpdg/legendre.hh:144
HierarchicLegendreDiscontinuousGalerkinSpace(GridPartType &gridPart, const KeyType initialOrder, const Dune::InterfaceType interface=Dune::InteriorBorder_All_Interface, const Dune::CommunicationDirection direction=Dune::ForwardCommunication)
Definition hpdg/legendre.hh:149
typename BaseType::BasisFunctionSetsType BasisFunctionSetsType
Definition hpdg/legendre.hh:146
Generic implementation of a -adaptive discontinuous finite element space.
Definition hpdg/space.hh:46
typename Traits::BasisFunctionSetsType BasisFunctionSetsType
basis function sets type
Definition hpdg/space.hh:56
typename BasisFunctionSetsType::KeyType KeyType
key type identifying a basis function set
Definition hpdg/space.hh:58
T forward(T... args)