DUNE-FEM (unstable)

storage.hh
1#ifndef DUNE_FEM_SPACE_LAGRANGE_STORAGE_HH
2#define DUNE_FEM_SPACE_LAGRANGE_STORAGE_HH
3
4// local includes
5#include "dofmappercode.hh"
6
7
8namespace Dune
9{
10
11 namespace Fem
12 {
13
14 // LagrangeMapperSingletonKey
15 // --------------------------
16
17 template< class GridPart, class LagrangePointSetContainer >
18 class LagrangeMapperSingletonKey
19 {
20 typedef LagrangeMapperSingletonKey< GridPart, LagrangePointSetContainer > ThisType;
21
22 public:
23 typedef GridPart GridPartType;
24 typedef LagrangePointSetContainer LagrangePointSetContainerType;
25
26 LagrangeMapperSingletonKey ( const GridPartType &gridPart,
27 const LagrangePointSetContainerType &pointSet,
28 const int polOrd )
29 : gridPart_( gridPart ),
30 pointSet_( pointSet ),
31 polOrd_( polOrd )
32 {
33 }
34
35 bool operator== ( const ThisType &other ) const
36 {
37 return ((&indexSet() == &other.indexSet()) && (polOrd_ == other.polOrd_));
38 }
39
40 bool operator!= ( const ThisType &other ) const
41 {
42 return !( *this == other );
43 }
44
45 const GridPartType &gridPart () const
46 {
47 return gridPart_;
48 }
49
50 const typename GridPartType::IndexSetType &indexSet () const
51 {
52 return gridPart().indexSet();
53 }
54
55 const LagrangePointSetContainerType &pointSet () const {
56 return pointSet_;
57 }
58
59 private:
60 const GridPartType &gridPart_;
61 const LagrangePointSetContainerType &pointSet_;
62 const int polOrd_;
63 };
64
65
66
67 // LagrangeMapperSingletonFactory
68 // ------------------------------
69
70 template< class Key, class Object >
71 struct LagrangeMapperSingletonFactory
72 {
73 typedef typename Key::LagrangePointSetContainerType LagrangePointSetContainerType;
74
75 static Object *createObject ( const Key &key )
76 {
77 LagrangeDofMapperCodeFactory< LagrangePointSetContainerType > codeFactory( key.pointSet() );
78 return new Object( key.gridPart(), codeFactory );
79 }
80
81 static void deleteObject ( Object *obj )
82 {
83 delete obj;
84 }
85 };
86
87 } // namespace Fem
88
89} // namespace Dune
90
91#endif // #ifndef DUNE_FEM_SPACE_LAGRANGE_STORAGE_HH
consecutive, persistent index set for the leaf level based on the grid's hierarchy index set
Definition: adaptiveleafindexset.hh:1351
EnableIfInterOperable< T1, T2, bool >::type operator==(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for equality.
Definition: iteratorfacades.hh:238
EnableIfInterOperable< T1, T2, bool >::type operator!=(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for inequality.
Definition: iteratorfacades.hh:260
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)