dune-fem 2.12-git
Loading...
Searching...
No Matches
padaptivespace/lagrange.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_SPACE_PADAPTIVE_LAGRANGE_HH
2#define DUNE_FEM_SPACE_PADAPTIVE_LAGRANGE_HH
3
9
10#include "adaptmanager.hh"
11#include "declaration.hh"
12#include "generic.hh"
13#include "mapper.hh"
14#include "restrictprolong.hh"
15
16
17namespace Dune
18{
19
20 namespace Fem
21 {
22
39 // PAdaptiveLagrangeSpaceTraits
40 // ----------------------------
41
42 template< class FunctionSpace, class GridPart, int maxPolOrder, class Storage >
44 {
45 static_assert((maxPolOrder > 0), "LagrangeSpace only defined for maxPolOrder > 0" );
46
48
50 typedef GridPart GridPartType;
51
52 static const int polynomialOrder = maxPolOrder;
53
54 static const bool continuousSpace = true ;
56
58
60
61 static const int codimension = 0;
62
63 private:
64 typedef typename GridPartType::template Codim< codimension >::EntityType EntityType;
65
66 static const int dimLocal = GridPartType::dimension;
67 typedef typename FunctionSpace::ScalarFunctionSpaceType ScalarFunctionSpaceType;
69
72
73 public:
75
76 template< int pOrd >
78 {
79 struct Type
80 {
82 {
83 typedef LagrangeShapeFunctionFactory< ShapeFunctionSpaceType, maxPolOrder > SimpleShapeFunctionSetFactoryType;
84 return new ScalarShapeFunctionSetType( type, SimpleShapeFunctionSetType( SimpleShapeFunctionSetFactoryType( type, pOrd ) ) );
85 }
86
87 static void deleteObject ( ScalarShapeFunctionSetType *object ) { delete object; }
88 };
89 };
90
93
95
96 template< class DiscreteFunction, class Operation = DFCommunicationOperation::Add >
102 };
103
104
105
106 // PAdaptiveLagrangeSpace
107 // ----------------------
108
115 template< class FunctionSpace, class GridPart, int maxPolOrder, class Storage = CachingStorage >
117 : public GenericDiscreteFunctionSpace< PAdaptiveLagrangeSpaceTraits< FunctionSpace, GridPart, maxPolOrder, Storage > >
118 {
121
122 public:
124
125 typedef typename BaseType::Traits Traits;
126
131
134
137
138 public:
142 using BaseType::gridPart;
143 using BaseType::order;
145
146 // default communication interface
147 static const InterfaceType defaultInterface = GridPart::indexSetInterfaceType;
148
149 // default communication direction
151
160 const int order,
161 const InterfaceType commInterface = defaultInterface,
162 const CommunicationDirection commDirection = defaultDirection )
163 : BaseType( gridPart, order, commInterface, commDirection )
164 {}
165
173 const InterfaceType commInterface = defaultInterface,
174 const CommunicationDirection commDirection = defaultDirection )
175 : BaseType( gridPart, maxPolOrder, commInterface, commDirection )
176 {}
177
178 // copy constructor needed for p-adaption
180 : BaseType( other )
181 {}
182
184 bool continuous (const IntersectionType &intersection) const
185 {
186 if ( order() > 0 && intersection.conforming())
187 {
188 return true;
189 if (intersection.neighbor())
190 return (order(intersection.inside()) == order(intersection.outside()));
191 else
192 return true;
193 }
194 return false;
195 }
196
206 template< class EntityType >
207 const CompiledLocalKeyType &lagrangePointSet ( const EntityType &entity ) const
208 {
209 return compiledLocalKey( entity.type(), blockMapper().polynomOrder( entity ) );
210 }
211
213 {
214 return InterpolationType( *this );
215 }
216
217 [[deprecated]]
219 {
220 return localInterpolation( entity );
221 }
222
224 {
225 return InterpolationImplType( lagrangePointSet( entity ), basisFunctionSet( entity ) );
226 }
227
228 };
229
230 } // namespace Fem
231
232} // namespace Dune
233
234#endif // #ifndef DUNE_FEM_SPACE_PADAPTIVE_LAGRANGE_HH
CommunicationDirection
InterfaceType
ForwardCommunication
Definition hybrid.hh:86
Definition space/basisfunctionset/default.hh:124
Default communication handler for discrete functions.
Definition defaultcommhandler.hh:38
FunctionSpaceTraits Traits
type of traits class
Definition discretefunctionspace.hh:188
GridPartType & gridPart()
get a reference to the associated grid partition
Definition discretefunctionspace.hh:405
GridPartType & gridPart() const
Definition discretefunctionspace.hh:766
A vector valued function space.
Definition functionspace.hh:60
convert functions space to space with new dim domain
Definition functionspace.hh:246
FunctionSpaceTraits::ScalarFunctionSpaceType ScalarFunctionSpaceType
corresponding scalar function space
Definition functionspaceinterface.hh:83
Definition common/localinterpolation.hh:75
Definition lagrange/interpolation.hh:21
Definition lagrangepoints.hh:688
abstract base class for Lagrange shape functions
Definition lagrange/shapefunctionset.hh:41
factory class
Definition lagrange/shapefunctionset.hh:126
Lagrange discrete function space.
Definition padaptivespace/lagrange.hh:118
PAdaptiveLagrangeSpace(GridPartType &gridPart, const InterfaceType commInterface=defaultInterface, const CommunicationDirection commDirection=defaultDirection)
constructor
Definition padaptivespace/lagrange.hh:172
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition padaptivespace/lagrange.hh:129
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition padaptivespace/generic.hh:162
PAdaptiveLagrangeSpace(GridPartType &gridPart, const int order, const InterfaceType commInterface=defaultInterface, const CommunicationDirection commDirection=defaultDirection)
constructor
Definition padaptivespace/lagrange.hh:159
bool continuous(const IntersectionType &intersection) const
returns true if the space contains only globally continuous functions
Definition padaptivespace/lagrange.hh:184
LagrangeLocalInterpolation< GridPartType, maxPolOrder, BasisFunctionSetType > InterpolationImplType
Definition padaptivespace/lagrange.hh:135
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition padaptivespace/generic.hh:141
BaseType::GridPartType GridPartType
Definition padaptivespace/lagrange.hh:127
static const CommunicationDirection defaultDirection
Definition padaptivespace/lagrange.hh:150
BaseType::CompiledLocalKeyType CompiledLocalKeyType
Definition padaptivespace/lagrange.hh:132
BaseType::Traits Traits
Definition padaptivespace/lagrange.hh:125
LocalInterpolationWrapper< ThisType > InterpolationType
Definition padaptivespace/lagrange.hh:136
BaseType::IntersectionType IntersectionType
Definition padaptivespace/lagrange.hh:128
const CompiledLocalKeyType & lagrangePointSet(const EntityType &entity) const
provide access to the Lagrange point set for an entity
Definition padaptivespace/lagrange.hh:207
ThisType PAdaptiveLagrangeSpaceType
Definition padaptivespace/lagrange.hh:123
InterpolationType interpolation() const
Definition padaptivespace/lagrange.hh:212
PAdaptiveLagrangeSpace(const PAdaptiveLagrangeSpace &other)
Definition padaptivespace/lagrange.hh:179
static const InterfaceType defaultInterface
Definition padaptivespace/lagrange.hh:147
BaseType::EntityType EntityType
Definition padaptivespace/lagrange.hh:130
InterpolationImplType interpolation(const EntityType &entity) const
Definition padaptivespace/lagrange.hh:218
CompiledLocalKeyType LagrangePointSetType
Definition padaptivespace/lagrange.hh:133
const CompiledLocalKeyType & compiledLocalKey(const EntityType &entity) const
provide access to the compiled local keys for an entity
Definition padaptivespace/generic.hh:208
InterpolationImplType localInterpolation(const EntityType &entity) const
Definition padaptivespace/lagrange.hh:223
int order() const
get global order of space
Definition padaptivespace/generic.hh:150
Please doc me.
Definition padaptivespace/generic.hh:43
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition padaptivespace/generic.hh:162
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition padaptivespace/generic.hh:141
bool continuous() const
returns true if the space contains only globally continuous functions
Definition padaptivespace/generic.hh:147
BaseType::GridPartType GridPartType
Definition padaptivespace/generic.hh:53
BaseType::IntersectionType IntersectionType
Definition padaptivespace/generic.hh:58
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition padaptivespace/generic.hh:61
Traits::CompiledLocalKeyType CompiledLocalKeyType
Definition padaptivespace/generic.hh:88
const CompiledLocalKeyType & compiledLocalKey(const EntityType &entity) const
provide access to the compiled local keys for an entity
Definition padaptivespace/generic.hh:208
IteratorType::Entity EntityType
Definition padaptivespace/generic.hh:57
int order() const
get global order of space
Definition padaptivespace/generic.hh:150
Definition padaptivespace/lagrange.hh:44
static const int polynomialOrder
Definition padaptivespace/lagrange.hh:52
SelectCachingShapeFunctionSet< SimpleShapeFunctionSetType, Storage > ScalarShapeFunctionSetType
Definition padaptivespace/lagrange.hh:74
static const int codimension
Definition padaptivespace/lagrange.hh:61
FunctionSpace FunctionSpaceType
Definition padaptivespace/lagrange.hh:49
LagrangePointSet< GridPartType, polynomialOrder > CompiledLocalKeyType
Definition padaptivespace/lagrange.hh:59
ShapeFunctionSetProxy< ScalarShapeFunctionSetType > ScalarShapeFunctionSetProxyType
Definition padaptivespace/lagrange.hh:91
Dune::Fem::DefaultBasisFunctionSet< EntityType, ShapeFunctionSetType > BasisFunctionSetType
Definition padaptivespace/lagrange.hh:94
PAdaptiveLagrangeSpace< FunctionSpace, GridPart, maxPolOrder, Storage > DiscreteFunctionSpaceType
Definition padaptivespace/lagrange.hh:47
VectorialShapeFunctionSet< ScalarShapeFunctionSetProxyType, typename FunctionSpaceType::RangeType > ShapeFunctionSetType
Definition padaptivespace/lagrange.hh:92
PAdaptiveLagrangeMapper< GridPartType, polynomialOrder > BlockMapperType
Definition padaptivespace/lagrange.hh:57
static const bool continuousSpace
Definition padaptivespace/lagrange.hh:54
GridPart GridPartType
Definition padaptivespace/lagrange.hh:50
Hybrid::IndexRange< int, FunctionSpaceType::dimRange > LocalBlockIndices
Definition padaptivespace/lagrange.hh:55
static void deleteObject(ScalarShapeFunctionSetType *object)
Definition padaptivespace/lagrange.hh:87
static ScalarShapeFunctionSetType * createObject(const GeometryType &type)
Definition padaptivespace/lagrange.hh:81
Definition padaptivespace/lagrange.hh:98
Operation OperationType
Definition padaptivespace/lagrange.hh:100
DefaultCommunicationHandler< DiscreteFunction, Operation > Type
Definition padaptivespace/lagrange.hh:99
Definition mapper.hh:67
Definition proxy.hh:35
Definition selectcaching.hh:26
Definition space/shapefunctionset/simple.hh:50
Definition shapefunctionset/vectorial.hh:447