dune-fem 2.12-git
Loading...
Searching...
No Matches
hpdg/anisotropic.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_HPDG_SPACE_DISCONTINUOUSGALERKIN_ANISOTROPIC_HH
2#define DUNE_FEM_HPDG_SPACE_DISCONTINUOUSGALERKIN_ANISOTROPIC_HH
3
4#include <algorithm>
5#include <utility>
6
8
14
17
18#include "blockmapper.hh"
19#include "space.hh"
20
21namespace Dune
22{
23
24 namespace Fem
25 {
26
27 namespace hpDG
28 {
29
30 // Internal forward declaration
31 // ----------------------------
32
33 template< class FunctionSpace, class GridPart, int order, class Storage = Fem::CachingStorage >
34 class AnisotropicDiscontinuousGalerkinSpace;
35
36
37
38#ifndef DOXYGEN
39
40 // AnisotropicDiscontinuousGalerkinSpaceTraits
41 // -------------------------------------------
42
43 template< class FunctionSpace, class GridPart, int order, class Storage >
44 struct AnisotropicDiscontinuousGalerkinSpaceTraits
45 {
46 using DiscreteFunctionSpaceType = hpDG::AnisotropicDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage >;
47
48 using FunctionSpaceType = FunctionSpace;
49
50 using GridPartType = GridPart;
51
52 using BasisFunctionSetsType = hpDG::AnisotropicBasisFunctionSets< FunctionSpaceType, GridPartType, order, Storage >;
53 using BasisFunctionSetType = typename BasisFunctionSetsType::BasisFunctionSetType;
54
55 static const int codimension = BasisFunctionSetType::EntityType::codimension;
56
57 using BlockMapperType = hpDG::DiscontinuousGalerkinBlockMapper< GridPartType, BasisFunctionSetsType >;
58 static const int localBlockSize = BasisFunctionSetsType::localBlockSize;
59
60 typedef Hybrid::IndexRange< int, localBlockSize > LocalBlockIndices;
61
62 template< class DiscreteFunction, class Operation = Dune::Fem::DFCommunicationOperation::Copy >
63 struct CommDataHandle
64 {
65 using OperationType = Operation;
67 };
68 };
69
70#endif // #ifndef DOXYGEN
71
72
73
74 // AnisotropicDiscontinuousGalerkinSpace
75 // --------------------------------
76
86 template< class FunctionSpace, class GridPart, int order, class Storage >
88 : public hpDG::DiscontinuousGalerkinSpace< AnisotropicDiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, order, Storage > >
89 {
91
92 public:
93 static const int polynomialOrder = order;
94
98 typedef typename BaseType::KeyType KeyType;
99
105
112
119
120 template <class Function,
123 decltype(Function(std::declval<const EntityType>()))>::value,int> i=0>
129
130 private:
131 KeyType convert( const std::vector<int>& v ) const
132 {
133 KeyType key;
134 assert( key.size() == v.size() );
135 for( unsigned int i=0; i<key.size(); ++i )
136 key[ i ] = v[ i ];
137 return key;
138 }
139
140 static KeyType defaultKey ()
141 {
142 KeyType key;
143 std::fill( key.begin(), key.end(), order );
144 return key;
145 }
146 };
147
148 } // namespace hpDG
149
150
151
152#ifndef DOXYGEN
153
154 // DefaultLocalRestrictProlong
155 // ---------------------------
156
157 template< class FunctionSpace, class GridPart, int order, class Storage >
158 class DefaultLocalRestrictProlong< hpDG::AnisotropicDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage > >
159 : public DiscontinuousGalerkinLocalRestrictProlong< hpDG::AnisotropicDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage >, false >
160 {
161 using BaseType = DiscontinuousGalerkinLocalRestrictProlong< hpDG::AnisotropicDiscontinuousGalerkinSpace< FunctionSpace, GridPart, order, Storage >, false >;
162
163 public:
164 explicit DefaultLocalRestrictProlong ( const typename BaseType::DiscreteFunctionSpaceType &space )
165 : BaseType( space )
166 {}
167 };
168
169
170#endif //#ifndef DOXYGEN
171
172 } // namespace Fem
173
174} // namespace Dune
175
176#endif // #ifndef DUNE_FEM_HPDG_SPACE_DISCONTINUOUSGALERKIN_ANISOTROPIC_HH
CommunicationDirection
InterfaceType
ForwardCommunication
InteriorBorder_All_Interface
Abstract class representing a function.
Definition common/function.hh:50
Default communication handler for discrete functions.
Definition defaultcommhandler.hh:38
GridPartType & gridPart() const
Definition discretefunctionspace.hh:766
Implementation of an -adaptive discrete function space using anisotropic product Legendre polynomials...
Definition hpdg/anisotropic.hh:89
AnisotropicDiscontinuousGalerkinSpace(GridPartType &gridPart, const typename BaseType::KeyType key, const Dune::InterfaceType interface=Dune::InteriorBorder_All_Interface, const Dune::CommunicationDirection direction=Dune::ForwardCommunication)
Definition hpdg/anisotropic.hh:106
typename BaseType::BasisFunctionSetsType BasisFunctionSetsType
Definition hpdg/anisotropic.hh:97
BaseType::KeyType KeyType
Definition hpdg/anisotropic.hh:98
AnisotropicDiscontinuousGalerkinSpace(GridPartType &gridPart, const Dune::InterfaceType interface=Dune::InteriorBorder_All_Interface, const Dune::CommunicationDirection direction=Dune::ForwardCommunication)
Definition hpdg/anisotropic.hh:100
static const int polynomialOrder
Definition hpdg/anisotropic.hh:93
typename BaseType::EntityType EntityType
Definition hpdg/anisotropic.hh:96
AnisotropicDiscontinuousGalerkinSpace(GridPartType &gridPart, const std::vector< int > &key, const Dune::InterfaceType interface=Dune::InteriorBorder_All_Interface, const Dune::CommunicationDirection direction=Dune::ForwardCommunication)
Definition hpdg/anisotropic.hh:113
typename BaseType::GridPartType GridPartType
Definition hpdg/anisotropic.hh:95
Generic implementation of a -adaptive discontinuous finite element space.
Definition hpdg/space.hh:46
const KeyType & key(const EntityType &entity) const
get identifiying basis function set key assigned to given entity
Definition hpdg/space.hh:231
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 fill(T... args)
T forward(T... args)
T size(T... args)