dune-fem  2.4.1-rc
rannacherturek/dofmappercode.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_RANNACHERTUREK_DOFMAPPERCODE_HH
2 #define DUNE_FEM_SPACE_RANNACHERTUREK_DOFMAPPERCODE_HH
3 
4 // dune-geometry includes
5 #include <dune/geometry/referenceelements.hh>
6 
7 // dune-fem includes
11 
12 
13 namespace Dune
14 {
15 
16  namespace Fem
17  {
18 
19  // RannacherTurekBlockMapperSingletonKey
20  // -------------------------------------
21 
22  template< class GridPart >
24  {
26 
27  public:
28  typedef GridPart GridPartType;
29 
31  : gridPart_( gridPart )
32  {}
33 
34  const GridPartType &gridPart () const { return gridPart_; }
35 
36  bool operator== ( const ThisType &other ) const
37  {
38  return ( &gridPart_ == &(other.gridPart_) );
39  }
40 
41  bool operator!= ( const ThisType &other ) const
42  {
43  return !( *this == other );
44  }
45 
46  private:
47  const GridPartType &gridPart_;
48  };
49 
50 
51 
52  // RannacherTurekDofMapperCodeFactory
53  // ----------------------------------
54 
55  template< class LocalCoefficients >
57  {
58  typedef LocalCoefficients LocalCoefficientsType;
59 
60  RannacherTurekDofMapperCodeFactory ( const LocalCoefficients &localCoefficients = LocalCoefficients() )
61  : localCoefficients_( localCoefficients )
62  {}
63 
64  template< class Field, int dim >
65  Dune::Fem::DofMapperCode operator() ( const Dune::ReferenceElement< Field, dim > &refElement ) const
66  {
67  return Dune::Fem::compile( refElement, localCoefficients() );
68  }
69 
70  const LocalCoefficientsType &localCoefficients () const
71  {
72  return localCoefficients_;
73  }
74 
75  private:
76  LocalCoefficientsType localCoefficients_;
77  };
78 
79 
80 
81  // RannacherTurekBlockMapperFactory
82  // --------------------------------
83 
84  template< class GridPart, class LocalCoefficients >
86  {
87  typedef GridPart GridPartType;
88  typedef LocalCoefficients LocalCoefficientsType;
89 
91 
93  {
94  return createObject( key.gridPart() );
95  }
96 
97  static BlockMapperType *createObject ( const GridPart &gridPart )
98  {
100  return new BlockMapperType( gridPart, codeFactory );
101  }
102 
103  static void deleteObject ( BlockMapperType *blockMapper )
104  {
105  delete blockMapper;
106  }
107  };
108 
109  } // namespace Fem
110 
111 } // namespace Dune
112 
113 #endif // #ifndef DUNE_FEM_SPACE_RANNACHERTUREK_DOFMAPPERCODE_HH
LocalCoefficients LocalCoefficientsType
Definition: rannacherturek/dofmappercode.hh:58
Definition: rannacherturek/dofmappercode.hh:56
GridPart GridPartType
Definition: rannacherturek/dofmappercode.hh:87
static BlockMapperType * createObject(const RannacherTurekBlockMapperSingletonKey< GridPartType > &key)
Definition: rannacherturek/dofmappercode.hh:92
Dune::Fem::IndexSetDofMapper< GridPartType > BlockMapperType
Definition: rannacherturek/dofmappercode.hh:90
bool operator!=(const ThisType &other) const
Definition: rannacherturek/dofmappercode.hh:41
DofMapperCode compile(const Dune::ReferenceElement< Field, dim > &refElement, const LocalCoefficients &localCoefficients)
Definition: compile.hh:44
LocalCoefficients LocalCoefficientsType
Definition: rannacherturek/dofmappercode.hh:88
const GridPartType & gridPart() const
Definition: rannacherturek/dofmappercode.hh:34
GridPart GridPartType
Definition: rannacherturek/dofmappercode.hh:28
RannacherTurekDofMapperCodeFactory(const LocalCoefficients &localCoefficients=LocalCoefficients())
Definition: rannacherturek/dofmappercode.hh:60
const LocalCoefficientsType & localCoefficients() const
Definition: rannacherturek/dofmappercode.hh:70
Definition: rannacherturek/dofmappercode.hh:85
static BlockMapperType * createObject(const GridPart &gridPart)
Definition: rannacherturek/dofmappercode.hh:97
Definition: coordinate.hh:4
Definition: rannacherturek/dofmappercode.hh:23
static void deleteObject(BlockMapperType *blockMapper)
Definition: rannacherturek/dofmappercode.hh:103
Definition: indexsetdofmapper.hh:743
RannacherTurekBlockMapperSingletonKey(const GridPartType &gridPart)
Definition: rannacherturek/dofmappercode.hh:30
Definition: code.hh:17
bool operator==(const ThisType &other) const
Definition: rannacherturek/dofmappercode.hh:36