dune-fem 2.12-git
Loading...
Searching...
No Matches
discontinuousgalerkin/legendre.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_LEGENDRE_HH
2#define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_LEGENDRE_HH
3
4#include <cassert>
5
6#include <dune/common/math.hh>
7
9
11
20
21#include "basisfunctionsets.hh"
22#include "declaration.hh"
23#include "generic.hh"
24#include "localinterpolation.hh"
25#include "shapefunctionsets.hh"
26
27namespace Dune
28{
29
30 namespace Fem
31 {
32 // Forward declaration
33 template< class FunctionSpace, class GridPart, int polOrder, class Storage = CachingStorage >
34 class LegendreDiscontinuousGalerkinSpace;
35
36 template< class FunctionSpace, class GridPart, int polOrder, class Storage = CachingStorage >
37 class HierarchicLegendreDiscontinuousGalerkinSpace;
38
39 // LegendreDiscontinuousGalerkinSpaceTraits
40 // ----------------------------------------
41
42 template< class FunctionSpace, class GridPart, int polOrder, class Storage, bool hierarchicalOrdering >
44 {
45 // select space implementation depending on basis function ordering
46 typedef typename std::conditional< hierarchicalOrdering,
49
50 typedef GridPart GridPartType;
52
53 static const int codimension = 0;
54
57 GridPartType::dimension, 1
59
61 : public Dune::Fem::LegendreShapeFunctionSet< ScalarShapeFunctionSpaceType, hierarchicalOrdering >
62 {
65
66 public:
68 : BaseType( polOrder )
69 {
70 assert( type.isCube() );
71 assert( size() == BaseType::size() );
72 }
73
74 // overload size method because it's a static value
75 static constexpr unsigned int size() { return numberShapeFunctions; }
76 };
77
80
83
85
87
88 template <class DiscreteFunction, class Operation = DFCommunicationOperation::Copy >
94 };
95
96
97 // LegendreDiscontinuousGalerkinSpaceBase
98 // --------------------------------------
99
100 template< class FunctionSpace, class GridPart, int polOrder, class Storage, bool hierarchicalOrdering >
102 : public GenericDiscontinuousGalerkinSpace< LegendreDiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, polOrder, Storage, hierarchicalOrdering > >
103 {
106
107 public:
109
110 static const int polynomialOrder = polOrder;
111
114
117
119 const InterfaceType commInterface = InteriorBorder_All_Interface,
120 const CommunicationDirection commDirection = ForwardCommunication )
121 : BaseType( gridPart, makeBasisFunctionSets( gridPart ), commInterface, commDirection )
122 {}
123
125
126 private:
127 static BasisFunctionSetsType makeBasisFunctionSets ( const GridPartType &gridPart )
128 {
129 typedef typename BasisFunctionSetsType::ShapeFunctionSetsType ShapeFunctionSetsType;
130 ShapeFunctionSetsType shapeFunctionSets( gridPart );
131 return BasisFunctionSetsType( std::move( shapeFunctionSets ) );
132 }
133 };
134
135 // LegendreDiscontinuousGalerkinSpace
136 // ----------------------------------
137
138 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
140 : public LegendreDiscontinuousGalerkinSpaceBase< FunctionSpace, GridPart, polOrder, Storage, false >
141 {
142 // hierarchicalOrdering = false
145
146 public:
151
153 const InterfaceType commInterface = InteriorBorder_All_Interface,
154 const CommunicationDirection commDirection = ForwardCommunication )
155 : BaseType( gridPart, commInterface, commDirection )
156 {}
157
159 {
160 return InterpolationType( *this );
161 }
162
163 [[deprecated]]
165 {
166 return interpolation();
167 }
168
170 {
171 return interpolation();
172 }
173 };
174
175
176 namespace Capabilities
177 {
178
179 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
181 {
182 static const bool v = true;
183 };
184
185 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
187 {
188 static const bool v = true;
189 static const int order = polOrder;
190 };
191
192 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
193 struct isContinuous< LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
194 {
195 static const bool v = false;
196 };
197
198 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
199 struct isLocalized< LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
200 {
201 static const bool v = true;
202 };
203
204 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
205 struct isAdaptive< LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
206 {
207 static const bool v = true;
208 };
209
210 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
211 struct threadSafe< LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
212 {
213 static const bool v = false;
214 };
215
216 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
217 struct viewThreadSafe< LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
218 {
219 static const bool v = true;
220 };
221
222 } // namespace Capabilities
223
224 } // namespace Fem
225
226} // namespace Dune
227
228#endif // #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_LEGENDRE_HH
constexpr Base power(Base m, Exponent p)
CommunicationDirection
InterfaceType
ForwardCommunication
InteriorBorder_All_Interface
DFSpaceIdentifier
enumerator for identification of spaces
Definition discretefunctionspace.hh:95
@ LegendreDGSpace_id
id for Legendre Discontinuous Galerkin Space
Definition discretefunctionspace.hh:104
typename Impl::GridFunctionSpace< GridPart, T >::Type GridFunctionSpace
Definition functionspace.hh:317
constexpr bool isCube() const
Definition hybrid.hh:86
Definition space/basisfunctionset/default.hh:124
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:105
static const bool v
Definition space/common/capabilities.hh:106
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
Default communication handler for discrete functions.
Definition defaultcommhandler.hh:38
GridPartType & gridPart() const
Definition discretefunctionspace.hh:766
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
@ dimDomain
dimension of domain vector space
Definition functionspaceinterface.hh:46
generate a set of default basis function sets from given set of shape function sets
Definition discontinuousgalerkin/basisfunctionsets.hh:83
Definition discontinuousgalerkin/legendre.hh:141
BaseType::GridPartType GridPartType
Definition discontinuousgalerkin/legendre.hh:147
InterpolationType localInterpolation(const EntityType &entity) const
Definition discontinuousgalerkin/legendre.hh:169
BaseType::EntityType EntityType
Definition discontinuousgalerkin/legendre.hh:148
LegendreDiscontinuousGalerkinSpace(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition discontinuousgalerkin/legendre.hh:152
InterpolationType interpolation(const EntityType &entity) const
Definition discontinuousgalerkin/legendre.hh:164
InterpolationType interpolation() const
Definition discontinuousgalerkin/legendre.hh:158
InterpolationType InterpolationImplType
Definition discontinuousgalerkin/legendre.hh:150
DiscontinuousGalerkinLocalInterpolation< ThisType > InterpolationType
Definition discontinuousgalerkin/legendre.hh:149
generic implementation of a Discontinuous Galerkin space based on a fixed family of basis function se...
Definition discontinuousgalerkin/generic.hh:31
BaseType::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition discontinuousgalerkin/generic.hh:49
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition discontinuousgalerkin/generic.hh:106
Definition discontinuousgalerkin/legendre.hh:44
std::conditional< hierarchicalOrdering, HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage >, LegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >::type DiscreteFunctionSpaceType
Definition discontinuousgalerkin/legendre.hh:48
static const int codimension
Definition discontinuousgalerkin/legendre.hh:53
Dune::Fem::FunctionSpace< typename FunctionSpace::DomainFieldType, typename FunctionSpace::RangeFieldType, GridPartType::dimension, 1 > ScalarShapeFunctionSpaceType
Definition discontinuousgalerkin/legendre.hh:58
Hybrid::IndexRange< int, FunctionSpaceType::dimRange *ScalarShapeFunctionSet::numberShapeFunctions > LocalBlockIndices
Definition discontinuousgalerkin/legendre.hh:86
GridFunctionSpace< GridPartType, FunctionSpace > FunctionSpaceType
Definition discontinuousgalerkin/legendre.hh:51
VectorialShapeFunctionSets< ScalarShapeFunctionSetsType, typename FunctionSpaceType::RangeType > ShapeFunctionSetsType
Definition discontinuousgalerkin/legendre.hh:79
GridPart GridPartType
Definition discontinuousgalerkin/legendre.hh:50
CodimensionMapper< GridPartType, codimension > BlockMapperType
Definition discontinuousgalerkin/legendre.hh:84
DefaultBasisFunctionSets< GridPartType, ShapeFunctionSetsType > BasisFunctionSetsType
Definition discontinuousgalerkin/legendre.hh:81
SelectCachingShapeFunctionSets< GridPartType, ScalarShapeFunctionSet, Storage > ScalarShapeFunctionSetsType
Definition discontinuousgalerkin/legendre.hh:78
BasisFunctionSetsType::BasisFunctionSetType BasisFunctionSetType
Definition discontinuousgalerkin/legendre.hh:82
Dune::Fem::LegendreShapeFunctionSet< ScalarShapeFunctionSpaceType, hierarchicalOrdering > BaseType
Definition discontinuousgalerkin/legendre.hh:63
static const int numberShapeFunctions
Definition discontinuousgalerkin/legendre.hh:64
static constexpr unsigned int size()
Definition discontinuousgalerkin/legendre.hh:75
ScalarShapeFunctionSet(Dune::GeometryType type)
Definition discontinuousgalerkin/legendre.hh:67
Definition discontinuousgalerkin/legendre.hh:90
Operation OperationType
Definition discontinuousgalerkin/legendre.hh:91
DefaultCommunicationHandler< DiscreteFunction, Operation > Type
Definition discontinuousgalerkin/legendre.hh:92
Definition discontinuousgalerkin/legendre.hh:103
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition discontinuousgalerkin/legendre.hh:116
static const int polynomialOrder
Definition discontinuousgalerkin/legendre.hh:110
LegendreDiscontinuousGalerkinSpaceBase(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition discontinuousgalerkin/legendre.hh:118
static DFSpaceIdentifier type()
Definition discontinuousgalerkin/legendre.hh:124
BaseType::BasisFunctionSetsType BasisFunctionSetsType
Definition discontinuousgalerkin/legendre.hh:115
BaseType::EntityType EntityType
Definition discontinuousgalerkin/legendre.hh:113
BaseType::GridPartType GridPartType
Definition discontinuousgalerkin/legendre.hh:112
Definition discontinuousgalerkin/localinterpolation.hh:30
Definition shapefunctionsets.hh:197
Definition shapefunctionsets.hh:271
mapper allocating one DoF per subentity of a given codimension
Definition codimensionmapper.hh:357
a Dune::Fem::ShapeFunctionSet of Legendre ansatz polynomials
Definition shapefunctionset/legendre.hh:218
std::size_t size() const noexcept
return number of shape functions
Definition shapefunctionset/legendre.hh:308