dune-fem  2.4.1-rc
storage.hh
Go to the documentation of this file.
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 
8 namespace Dune
9 {
10 
11  namespace Fem
12  {
13 
14  // LagrangeMapperSingletonKey
15  // --------------------------
16 
17  template< class GridPart, class LagrangePointSetContainer >
19  {
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  bool operator== ( const ThisType &other ) const
35  {
36  return ((&indexSet() == &other.indexSet()) && (polOrd_ == other.polOrd_));
37  }
38 
39  bool operator!= ( const ThisType &other ) const
40  {
41  return !( *this == other );
42  }
43 
44  const GridPartType &gridPart () const
45  {
46  return gridPart_;
47  }
48 
49  const typename GridPartType::IndexSetType &indexSet () const
50  {
51  return gridPart().indexSet();
52  }
53 
54  const LagrangePointSetContainerType &pointSet () const {
55  return pointSet_;
56  }
57 
58  private:
59  const GridPartType &gridPart_;
60  const LagrangePointSetContainerType &pointSet_;
61  const int polOrd_;
62  };
63 
64 
65 
66  // LagrangeMapperSingletonFactory
67  // ------------------------------
68 
69  template< class Key, class Object >
71  {
72  typedef typename Key::LagrangePointSetContainerType LagrangePointSetContainerType;
73 
74  static Object *createObject ( const Key &key )
75  {
77  return new Object( key.gridPart(), codeFactory );
78  }
79 
80  static void deleteObject ( Object *obj )
81  {
82  delete obj;
83  }
84  };
85 
86  } // namespace Fem
87 
88 } // namespace Dune
89 
90 #endif // #ifndef DUNE_FEM_SPACE_LAGRANGE_STORAGE_HH
Definition: lagrange/dofmappercode.hh:24
static Object * createObject(const Key &key)
Definition: storage.hh:74
Key::LagrangePointSetContainerType LagrangePointSetContainerType
Definition: storage.hh:72
bool operator!=(const ThisType &other) const
Definition: storage.hh:39
LagrangeMapperSingletonKey(const GridPartType &gridPart, const LagrangePointSetContainerType &pointSet, const int polOrd)
Definition: storage.hh:26
GridPart GridPartType
Definition: storage.hh:23
LagrangePointSetContainer LagrangePointSetContainerType
Definition: storage.hh:24
Definition: coordinate.hh:4
const GridPartType::IndexSetType & indexSet() const
Definition: storage.hh:49
const GridPartType & gridPart() const
Definition: storage.hh:44
static void deleteObject(Object *obj)
Definition: storage.hh:80
Definition: storage.hh:18
const LagrangePointSetContainerType & pointSet() const
Definition: storage.hh:54
bool operator==(const ThisType &other) const
Definition: storage.hh:34