DUNE-FEM (unstable)

discontinuousgalerkin.hh
1#ifndef DUNE_FEM_SPACE_PADAPTIVE_DISCONTINUOUSGALERKIN_HH
2#define DUNE_FEM_SPACE_PADAPTIVE_DISCONTINUOUSGALERKIN_HH
3
4#include <dune/fem/common/hybrid.hh>
5#include <dune/fem/space/common/defaultcommhandler.hh>
6#include <dune/fem/space/mapper/nonblockmapper.hh>
7
8#include "adaptmanager.hh"
9#include "declaration.hh"
10#include "generic.hh"
11#include "lagrange.hh"
12#include "mapper.hh"
13#include "restrictprolong.hh"
14
15#include <dune/fem/space/discontinuousgalerkin/interpolation.hh>
16
17namespace Dune
18{
19
20 namespace Fem
21 {
22
39 // PAdaptiveDGSpaceTraits
40 // ----------------------
41
42 template< class FunctionSpace, class GridPart, int polOrder, class Storage >
43 struct PAdaptiveDGSpaceTraits
44 : public PAdaptiveLagrangeSpaceTraits< FunctionSpace, GridPart, polOrder, Storage >
45 {
46 typedef PAdaptiveDGSpace< FunctionSpace, GridPart, polOrder, Storage > DiscreteFunctionSpaceType;
47
48 static const bool continuousSpace = false ;
49 typedef Hybrid::IndexRange< int, FunctionSpace::dimRange > LocalBlockIndices;
50
51 typedef PAdaptiveDGMapper< GridPart, polOrder > BlockMapperType;
52
53 template< class DiscreteFunction,
54 class Operation = DFCommunicationOperation :: Copy >
55 struct CommDataHandle
56 {
57 typedef DefaultCommunicationHandler< DiscreteFunction, Operation > Type;
58 typedef Operation OperationType;
59 };
60 };
61
62
63
64 // PAdaptiveDGSpace
65 // ----------------
66
73 template< class FunctionSpace, class GridPart, int polOrder, class Storage = CachingStorage >
75 : public GenericDiscreteFunctionSpace< PAdaptiveDGSpaceTraits< FunctionSpace, GridPart, polOrder, Storage > >
76 {
79
80 public:
82
83 typedef typename BaseType::Traits Traits;
84
85 typedef typename BaseType::GridPartType GridPartType;
86 typedef typename BaseType::IntersectionType IntersectionType;
87 typedef typename BaseType::EntityType EntityType;
88
89 typedef typename BaseType::BasisFunctionSetType BasisFunctionSetType;
90 typedef typename BaseType::CompiledLocalKeyType CompiledLocalKeyType;
91 typedef CompiledLocalKeyType LagrangePointSetType;
92
93 typedef DiscontinuousGalerkinLocalL2Projection< GridPartType, BasisFunctionSetType > InterpolationImplType;
94 typedef LocalInterpolationWrapper< ThisType > InterpolationType;
95
96 public:
102
103 // default communication interface
104 static const InterfaceType defaultInterface = InteriorBorder_All_Interface;
105 // default communication direction
106 static const CommunicationDirection defaultDirection = ForwardCommunication;
107
115 explicit PAdaptiveDGSpace ( GridPartType &gridPart,
116 const int order,
117 const InterfaceType commInterface = defaultInterface,
118 const CommunicationDirection commDirection = defaultDirection )
119 : BaseType( gridPart, order, commInterface, commDirection )
120 {}
121
128 explicit PAdaptiveDGSpace ( GridPartType &gridPart,
129 const InterfaceType commInterface = defaultInterface,
130 const CommunicationDirection commDirection = defaultDirection )
131 : BaseType( gridPart, polOrder, commInterface, commDirection )
132 {}
133
134 // copy constructor needed for p-adaption
135 PAdaptiveDGSpace ( const PAdaptiveDGSpace &other )
136 : BaseType( other )
137 {}
138
140 inline bool continuous (const IntersectionType &intersection) const
141 {
142 return false;
143 }
144
146 inline const CompiledLocalKeyType &lagrangePointSet( const GeometryType &type, const int order = BaseType::polynomialOrder ) const
147 {
148 return compiledLocalKey( type, order );
149 }
150
151 InterpolationType interpolation() const
152 {
153 return InterpolationType( *this );
154 }
155
156 [[deprecated]]
157 InterpolationImplType interpolation ( const EntityType &entity ) const
158 {
159 return localInterpolation( entity );
160 }
161
162 InterpolationImplType localInterpolation ( const EntityType &entity ) const
163 {
164 return InterpolationImplType( basisFunctionSet( entity ) );
165 }
166
167 };
168
169 } // namespace Fem
170
171} // Dune namespace
172
173#endif // #ifndef DUNE_FEM_SPACE_PADAPTIVE_DISCONTINUOUSGALERKIN_HH
GridPartType & gridPart() const
Definition: discretefunctionspace.hh:766
Traits Traits
type of traits class
Definition: discretefunctionspace.hh:188
Please doc me.
Definition: generic.hh:43
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition: generic.hh:162
static const int polynomialOrder
maximal available polynomial order
Definition: generic.hh:66
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition: generic.hh:141
bool continuous() const
returns true if the space contains only globally continuous functions
Definition: generic.hh:147
DFSpaceIdentifier type() const
return type identifier of discrete function space
Definition: generic.hh:138
const CompiledLocalKeyType & compiledLocalKey(const EntityType &entity) const
provide access to the compiled local keys for an entity
Definition: generic.hh:208
adaptive DG discrete function space
Definition: discontinuousgalerkin.hh:76
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition: generic.hh:141
PAdaptiveDGSpace(GridPartType &gridPart, const int order, const InterfaceType commInterface=defaultInterface, const CommunicationDirection commDirection=defaultDirection)
constructor
Definition: discontinuousgalerkin.hh:115
const CompiledLocalKeyType & lagrangePointSet(const GeometryType &type, const int order=BaseType::polynomialOrder) const
Please doc me.
Definition: discontinuousgalerkin.hh:146
const CompiledLocalKeyType & compiledLocalKey(const EntityType &entity) const
provide access to the compiled local keys for an entity
Definition: generic.hh:208
bool continuous(const IntersectionType &intersection) const
returns true if the space contains only globally continuous functions
Definition: discontinuousgalerkin.hh:140
PAdaptiveDGSpace(GridPartType &gridPart, const InterfaceType commInterface=defaultInterface, const CommunicationDirection commDirection=defaultDirection)
constructor
Definition: discontinuousgalerkin.hh:128
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Provides classes with basic mappers which are used to attach data to a grid.
Convenience header that includes all implementations of Lagrange finite elements.
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
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)