Dune Core Modules (2.5.0)

entitypointer.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_ALBERTA_ENTITYPOINTER_HH
4#define DUNE_ALBERTA_ENTITYPOINTER_HH
5
7
9
10#if HAVE_ALBERTA
11
12namespace Dune
13{
14
15 // External Forward Declarations
16 // -----------------------------
17
18 template< int dim, int dimworld >
19 class AlbertaGrid;
20
21
22
27 template< int codim, class GridImp >
29 {
31
32 friend class AlbertaGrid< GridImp::dimension, GridImp::dimensionworld >;
33
34 public:
35 static const int dimension = GridImp::dimension;
36 static const int codimension = codim;
37 static const int mydimension = dimension - codimension;
38 static const int dimensionworld = GridImp::dimensionworld;
39
40 typedef typename GridImp::template Codim< codimension >::Entity Entity;
41
42 protected:
43 typedef MakeableInterfaceObject< Entity > EntityObject;
44 typedef typename EntityObject::ImplementationType EntityImp;
45
46 public:
47 typedef AlbertaGridEntityPointer< codimension, GridImp > EntityPointerImp;
48
49 typedef typename EntityImp::ElementInfo ElementInfo;
50
52
54 AlbertaGridEntityPointer ( const GridImp &grid,
55 const ElementInfo &elementInfo,
56 int subEntity );
57
59 AlbertaGridEntityPointer ( const GridImp &grid );
60
62 AlbertaGridEntityPointer ( const EntityImp &entity );
63
64#if 0
67#endif
68
70 bool equals ( const This &other ) const;
71
73 Entity &dereference () const;
74
76 int level () const;
77
78 protected:
80 EntityImp &entityImp ();
81
83 const EntityImp &entityImp () const;
84
86 const GridImp &grid () const;
87
88 private:
89 mutable Entity entity_;
90 };
91
92
93
94 template< int codim, class GridImp >
95 inline AlbertaGridEntityPointer< codim, GridImp >
96 ::AlbertaGridEntityPointer ()
97 {}
98
99
100 template< int codim, class GridImp >
103 const ElementInfo &elementInfo,
104 int subEntity )
105 : entity_( EntityImp( grid, elementInfo, subEntity ) )
106 {}
107
108
109 template<int codim, class GridImp >
111 ::AlbertaGridEntityPointer ( const GridImp &grid )
112 : entity_( EntityImp( grid ) )
113 {}
114
115
116 template< int codim, class GridImp >
118 ::AlbertaGridEntityPointer ( const EntityImp &entity )
119 : entity_( entity )
120 {}
121
122
123#if 0
124 template<int codim, class GridImp >
126 {}
127#endif
128
129
130 template<int codim, class GridImp >
131 inline bool
133 {
134 return entityImp().equals( other.entityImp() );
135 }
136
137
138 template<int codim, class GridImp >
139 inline typename AlbertaGridEntityPointer< codim, GridImp >::Entity &
141 {
142 return entity_;
143 }
144
145
146 template< int codim, class GridImp >
148 {
149 return entityImp().level();
150 }
151
152
153 template< int codim, class GridImp >
154 inline typename AlbertaGridEntityPointer< codim, GridImp >::EntityImp &
156 {
157 return GridImp::getRealImplementation( entity_ );
158 }
159
160
161 template< int codim, class GridImp >
162 inline const typename AlbertaGridEntityPointer< codim, GridImp >::EntityImp &
164 {
165 return GridImp::getRealImplementation( entity_ );
166 }
167
168
169 template< int codim, class GridImp >
171 {
172 return entityImp().grid();
173 }
174
175}
176
177#endif // #if HAVE_ALBERTA
178
179#endif // #ifndef DUNE_ALBERTA_ENTITYPOINTER_HH
EntityPointer implementation for AlbertaGrid.
Definition: entitypointer.hh:29
Entity & dereference() const
dereferencing
Definition: entitypointer.hh:140
const GridImp & grid() const
obtain a reference to the grid
Definition: entitypointer.hh:170
EntityImp & entityImp()
obtain reference to internal entity implementation
Definition: entitypointer.hh:155
int level() const
ask for level of entities
Definition: entitypointer.hh:147
bool equals(const This &other) const
equality
Definition: entitypointer.hh:132
[ provides Dune::Grid ]
Definition: agrid.hh:140
Wrapper and interface class for a static iterator (EntityPointer)
provides a wrapper for ALBERTA's el_info structure
Dune namespace.
Definition: alignment.hh:11
Static tag representing a codimension.
Definition: dimension.hh:22
Definition: grid.hh:1261
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 23, 23:29, 2024)