dune-fem  2.4.1-rc
fourier/dofmapper.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_FOURIER_DOFMAPPER_HH
2 #define DUNE_FEM_SPACE_FOURIER_DOFMAPPER_HH
3 
4 #include <cstddef>
5 
7 
8 namespace Dune
9 {
10 
11  namespace Fem
12  {
13 
14  // Internal forward declaration
15  // ----------------------------
16 
17  template< class GridPart, int order > class FourierDofMapper;
18 
19 
20 
21  // FourierDofMapperTraits
22  // ----------------------
23 
24  template< class GridPart, int order >
26  {
28 
29  typedef GridPart GridPartType;
30  typedef typename GridPartType::template Codim< 0 >::EntityType ElementType;
31 
32  typedef std::size_t SizeType;
33  };
34 
35 
36 
37  // FourierDofMapper
38  // ----------------
39 
40  template< class GridPart, int order >
41  class FourierDofMapper
42  : public AdaptiveDofMapper< FourierDofMapperTraits< GridPart, order > >
43  {
44  typedef FourierDofMapper< GridPart, order > ThisType;
46 
47  public:
48  typedef typename BaseType::Traits Traits;
51  typedef typename BaseType::SizeType SizeType;
52 
53 
55  // DofMapper interface methods //
57 
59  static SizeType size () { return 1; }
60 
62  static bool contains ( int codim ) { return false; }
63 
65  static bool fixedDataSize ( int codim ) { return true; }
66 
68  template< class Functor >
69  static void mapEach ( const ElementType &element, Functor f )
70  {
71  f( 0, 0 );
72  }
73 
75  template< class Entity, class Functor >
76  static void mapEachEntityDof ( const Entity &entity, Functor f )
77  {}
78 
80  static SizeType maxNumDofs () { return size(); }
81 
83  static SizeType numDofs ( const ElementType &element ) { return size(); }
84 
86  template< class Entity >
87  static SizeType numEntityDofs ( const Entity &entity )
88  {
89  return 0;
90  }
91 
92 
94  // AdaptviveDofMapper interface methods //
96 
98  SizeType numberOfHoles ( const int block ) const { return SizeType( 0 ); }
99 
101  GlobalKeyType oldIndex ( const int hole, const int block ) const
102  {
103  DUNE_THROW( Dune::NotImplemented, "Method oldIndex() not implemented yet" );
104  }
105 
107  GlobalKeyType newIndex ( const int hole, const int block ) const
108  {
109  DUNE_THROW( Dune::NotImplemented, "Method newIndex() not implemented yet" );
110  }
111 
113  bool consecutive () const { return true; }
114 
116  SizeType oldOffSet ( const int block ) const { return SizeType( 0 ); }
117 
119  SizeType offSet ( const int block ) const { return SizeType( 0 ); }
120 
122  SizeType numBlocks () const { return SizeType( 1 ); }
123  };
124 
125  } // namespace Fem
126 
127 } // namespace Dune
128 
129 #endif // #ifndef DUNE_FEM_SPACE_FOURIER_DOFMAPPER_HH
Definition: fourier/dofmapper.hh:17
Extended interface for adaptive DoF mappers.
Definition: mapper/dofmapper.hh:204
static SizeType maxNumDofs()
obtain maximal number of DoFs on one entity
Definition: fourier/dofmapper.hh:80
SizeType offSet(const int block) const
return current offsets for given block
Definition: fourier/dofmapper.hh:119
BaseType::SizeType SizeType
Definition: fourier/dofmapper.hh:51
static bool contains(int codim)
returns true if DoFs for given codimension exist
Definition: fourier/dofmapper.hh:62
SizeType numBlocks() const
return number of supported blocks
Definition: fourier/dofmapper.hh:122
SizeType GlobalKeyType
at the moment this should be similar to SizeType
Definition: mapper/dofmapper.hh:217
GlobalKeyType newIndex(const int hole, const int block) const
return new index of hole for data block (with resprect to new offset)
Definition: fourier/dofmapper.hh:107
static SizeType numEntityDofs(const Entity &entity)
obtain number of DoFs actually belonging to an entity
Definition: fourier/dofmapper.hh:87
static SizeType numDofs(const ElementType &element)
obtain number of DoFs on an entity
Definition: fourier/dofmapper.hh:83
Traits::ElementType ElementType
type of codimension 0 entities
Definition: mapper/dofmapper.hh:54
FourierDofMapper< GridPart, order > DofMapperType
Definition: fourier/dofmapper.hh:27
static bool fixedDataSize(int codim)
Check, whether the data in a codimension has fixed size.
Definition: fourier/dofmapper.hh:65
GridPartType::template Codim< 0 >::EntityType ElementType
Definition: fourier/dofmapper.hh:30
BaseType::GlobalKeyType GlobalKeyType
Definition: fourier/dofmapper.hh:50
SizeType numberOfHoles(const int block) const
return number of holes for data block
Definition: fourier/dofmapper.hh:98
Definition: coordinate.hh:4
static void mapEachEntityDof(const Entity &entity, Functor f)
map each local DoF number to a global key
Definition: fourier/dofmapper.hh:76
std::size_t SizeType
Definition: fourier/dofmapper.hh:32
GlobalKeyType oldIndex(const int hole, const int block) const
return old index of hole for data block (with resprect to new offset)
Definition: fourier/dofmapper.hh:101
Definition: fourier/dofmapper.hh:25
BaseType::Traits Traits
Definition: fourier/dofmapper.hh:48
static void mapEach(const ElementType &element, Functor f)
map each local DoF number to a global key
Definition: fourier/dofmapper.hh:69
BaseType::SizeType SizeType
type of size integer
Definition: mapper/dofmapper.hh:214
bool consecutive() const
return true if compress will affect data
Definition: fourier/dofmapper.hh:113
SizeType oldOffSet(const int block) const
return old offsets for given block
Definition: fourier/dofmapper.hh:116
static SizeType size()
return number of dofs for special function space and grid on specified level
Definition: fourier/dofmapper.hh:59
BaseType::ElementType ElementType
Definition: fourier/dofmapper.hh:49
GridPart GridPartType
Definition: fourier/dofmapper.hh:29