Dune Core Modules (2.3.1)

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 AlbertaGridEntityPointer ( const GridImp &grid,
53 const ElementInfo &elementInfo,
54 int subEntity );
55
57 AlbertaGridEntityPointer ( const GridImp &grid );
58
60 AlbertaGridEntityPointer ( const EntityImp &entity );
61
62#if 0
64 AlbertaGridEntityPointer ( const This &other );
65#endif
66
67#if 0
70#endif
71
72#if 0
74 This &operator= ( const This &other );
75#endif
76
78 bool equals ( const This &other ) const;
79
81 Entity &dereference () const;
82
84 int level () const;
85
86 protected:
88 EntityImp &entityImp ();
89
91 const EntityImp &entityImp () const;
92
94 const GridImp &grid () const;
95
96 private:
97 mutable EntityObject entity_;
98 };
99
100
101
102 template< int codim, class GridImp >
103 inline AlbertaGridEntityPointer< codim, GridImp >
104 ::AlbertaGridEntityPointer ( const GridImp &grid,
105 const ElementInfo &elementInfo,
106 int subEntity )
107 : entity_( EntityImp( grid, elementInfo, subEntity ) )
108 {}
109
110
111 template<int codim, class GridImp >
114 : entity_( EntityImp( grid ) )
115 {}
116
117
118 template< int codim, class GridImp >
120 ::AlbertaGridEntityPointer ( const EntityImp &entity )
121 : entity_( entity )
122 {}
123
124
125#if 0
126 template< int codim, class GridImp >
128 ::AlbertaGridEntityPointer ( const This &other )
129 : entity_( other.entity_ )
130 {}
131#endif
132
133
134#if 0
135 template<int codim, class GridImp >
136 inline AlbertaGridEntityPointer< codim, GridImp >::~AlbertaGridEntityPointer ()
137 {}
138#endif
139
140
141#if 0
142 template< int codim, class GridImp >
143 inline typename AlbertaGridEntityPointer< codim, GridImp >::This &
144 AlbertaGridEntityPointer< codim, GridImp >::operator= ( const This &other )
145 {
146 entityImp().setEntity( other.entityImp() );
147 return *this;
148 }
149#endif
150
151
152 template<int codim, class GridImp >
153 inline bool
155 {
156 return entityImp().equals( other.entityImp() );
157 }
158
159
160 template<int codim, class GridImp >
161 inline typename AlbertaGridEntityPointer< codim, GridImp >::Entity &
163 {
164 return entity_;
165 }
166
167
168 template< int codim, class GridImp >
170 {
171 return entityImp().level();
172 }
173
174
175 template< int codim, class GridImp >
176 inline typename AlbertaGridEntityPointer< codim, GridImp >::EntityImp &
178 {
179 return GridImp::getRealImplementation( entity_ );
180 }
181
182
183 template< int codim, class GridImp >
184 inline const typename AlbertaGridEntityPointer< codim, GridImp >::EntityImp &
186 {
187 return GridImp::getRealImplementation( entity_ );
188 }
189
190
191 template< int codim, class GridImp >
193 {
194 return entityImp().grid();
195 }
196
197}
198
199#endif // #if HAVE_ALBERTA
200
201#endif // #ifndef DUNE_ALBERTA_ENTITYPOINTER_HH
EntityPointer implementation for AlbertaGrid.
Definition: entitypointer.hh:29
Entity & dereference() const
dereferencing
Definition: entitypointer.hh:162
const GridImp & grid() const
obtain a reference to the grid
Definition: entitypointer.hh:192
EntityImp & entityImp()
obtain reference to internal entity implementation
Definition: entitypointer.hh:177
AlbertaGridEntityPointer(const GridImp &grid, const ElementInfo &elementInfo, int subEntity)
make an EntityPointer that points to an element
Definition: entitypointer.hh:104
int level() const
ask for level of entities
Definition: entitypointer.hh:169
bool equals(const This &other) const
equality
Definition: entitypointer.hh:154
[ provides Dune::Grid ]
Definition: agrid.hh:140
Wrapper and interface classe for a static iterator (EntityPointer)
provides a wrapper for ALBERTA's el_info structure
Dune namespace.
Definition: alignment.hh:14
Definition: grid.hh:1376
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)