entity.hh 13.8 KB
Newer Older
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
1
2
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
Praetorius, Simon's avatar
Praetorius, Simon committed
3
4
#ifndef DUNE_CURVED_SURFACE_GRID_ENTITY_HH
#define DUNE_CURVED_SURFACE_GRID_ENTITY_HH
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
5

6
#include <dune/common/std/optional.hh>
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
7
8
9
10
11
12
#include <dune/geometry/referenceelements.hh>

#include <dune/grid/common/grid.hh>

namespace Dune
{
Praetorius, Simon's avatar
Praetorius, Simon committed
13
  namespace CGeo
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
14
15
16
17
18
19
20
  {

    // Internal Forward Declarations
    // -----------------------------

    /** \class EntityBase
     *  \brief actual implementation of the entity
Praetorius, Simon's avatar
Praetorius, Simon committed
21
     *  \ingroup CurvedGeo
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
22
23
24
25
     *
     *  \tparam  codim  codimension of the entity
     *  \tparam  Grid   CurvedSurfaceGrid, this entity belongs to
     */
Praetorius, Simon's avatar
Praetorius, Simon committed
26
    template< int codim, class Grid >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
27
28
29
30
    class EntityBase;

    /** \class Entity
     *  \brief DUNE-conform implementation of the entity
Praetorius, Simon's avatar
Praetorius, Simon committed
31
     *  \ingroup CurvedGeo
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
     *
     *  This class merely changes the template parameters of the entity to make
     *  DUNE happy. The actual implementation of the entity can be found in
     *  EntityBase.
     *
     *  \tparam  codim  codimension of the entity
     *  \tparam  dim    dimension of the Grid (redundant information)
     *  \tparam  Grid   CurvedSurfaceGrid, this entity belongs to
     */
    template< int codim, int dim, class Grid >
    class Entity;



    // External Forward Declarations
    // -----------------------------

    template< class Grid >
    class HierarchicIterator;

    template< class Grid, class HostIntersectionIterator >
    class IntersectionIterator;



    // EntityBase (real)
    // -----------------

    /** \copydoc EntityBase
     *
     *  This specialization implements the case, where the host grid provides
     *  the entity for this codimension, i.e., \em fake = \b false.
     *
     *  \nosubgrouping
     */
    template< int codim, class Grid >
Praetorius, Simon's avatar
Praetorius, Simon committed
68
    class EntityBase
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
69
    {
Praetorius, Simon's avatar
Praetorius, Simon committed
70
      using Traits = typename std::remove_const_t<Grid>::Traits;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

    public:
      /** \name Attributes
       *  \{ */

      //! codimensioon of the entity
      static const int codimension = codim;
      //! dimension of the grid
      static const int dimension = Traits::dimension;
      //! dimension of the entity
      static const int mydimension = dimension - codimension;
      //! dimension of the world
      static const int dimensionworld = Traits::dimensionworld;

      /** \} */

      /** \name Types Required by DUNE
       *  \{ */

      //! coordinate type of the grid
Praetorius, Simon's avatar
Praetorius, Simon committed
91
      using ctype = typename Traits::ctype;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
92
93

      //! type of corresponding geometry
Praetorius, Simon's avatar
Praetorius, Simon committed
94
95
      using Geometry = typename Traits::template Codim<codimension>::Geometry;

Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
96
97
98
      /** \} */

    private:
Praetorius, Simon's avatar
Praetorius, Simon committed
99
      using HostGrid = typename Traits::HostGrid;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
100
101
102
103
104
105

    public:
      /** \name Host Types
       *  \{ */

      //! type of corresponding host entity
Praetorius, Simon's avatar
Praetorius, Simon committed
106
      using HostEntity = typename HostGrid::template Codim<codimension>::Entity;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
107
108

      //! type of corresponding entity seed
Praetorius, Simon's avatar
Praetorius, Simon committed
109
      using EntitySeed = typename Traits::template Codim<codimension>::EntitySeed;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
110
111

      //! type of host elements, i.e., of host entities of codimension 0
Praetorius, Simon's avatar
Praetorius, Simon committed
112
      using HostElement = typename HostGrid::template Codim<0>::Entity;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
113

Praetorius, Simon's avatar
Praetorius, Simon committed
114
      /** \} */
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
115
116

    private:
Praetorius, Simon's avatar
Praetorius, Simon committed
117
118
      using GeometryImpl = typename Traits::template Codim<codimension>::GeometryImpl;
      using HostGeometry = typename HostGrid::template Codim<codimension>::Geometry;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
119
120
121
122
123

    public:
      /** \name Construction, Initialization and Destruction
       *  \{ */

Praetorius, Simon's avatar
Praetorius, Simon committed
124
      EntityBase () = default;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
125

Praetorius, Simon's avatar
Praetorius, Simon committed
126
127
128
129
      // Construct the entity from an entity seed
      EntityBase (const Grid& grid, const EntitySeed& seed)
        : hostEntity_(grid.hostGrid().entity(seed.impl().hostEntitySeed()))
        , grid_(&grid)
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
130
131
      {}

Praetorius, Simon's avatar
Praetorius, Simon committed
132
133
134
135
      // construct the entity from a subentity of a host-entity
      EntityBase (const Grid& grid, const HostElement& hostElement, int i)
        : hostEntity_(hostElement.template subEntity<codim>(i))
        , grid_(&grid)
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
136
137
      {}

Praetorius, Simon's avatar
Praetorius, Simon committed
138
139
140
141
142
      // construct the entity from a host-entity and a transformed geometry
      EntityBase (const GeometryImpl& geo, const HostEntity& hostEntity)
        : hostEntity_(hostEntity)
        , grid_(&geo.grid())
        , geo_(geo)
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
143
144
      {}

Praetorius, Simon's avatar
Praetorius, Simon committed
145
146
147
148
149
      // construct the entity from a host-entity and a transformed geometry
      EntityBase (const GeometryImpl& geo, HostEntity&& hostEntity)
        : hostEntity_(std::move(hostEntity))
        , grid_(&geo.grid())
        , geo_(geo)
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
150
151
      {}

Praetorius, Simon's avatar
Praetorius, Simon committed
152
153
154
155
      // construct the entity from a host-entity
      EntityBase (const Grid& grid, const HostEntity& hostEntity)
        : hostEntity_(hostEntity)
        , grid_(&grid)
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
156
157
      {}

Praetorius, Simon's avatar
Praetorius, Simon committed
158
159
160
161
      // construct the entity from a host-entity
      EntityBase (const Grid& grid, HostEntity&& hostEntity)
        : hostEntity_(std::move(hostEntity))
        , grid_(&grid)
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
162
163
164
165
      {}

      /** \} */

Praetorius, Simon's avatar
Praetorius, Simon committed
166
167
      //! compare two entities
      bool equals (const EntityBase& other) const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
168
169
170
171
172
173
174
175
      {
        return hostEntity_ == other.hostEntity_;
      }

    public:
      /** \name Methods Shared by Entities of All Codimensions
       *  \{ */

Praetorius, Simon's avatar
Praetorius, Simon committed
176
177
      //! obtain the name of the corresponding reference element
      /**
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
178
179
180
181
182
183
184
       *  This type can be used to access the DUNE reference element.
       */
      GeometryType type () const
      {
        return hostEntity().type();
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
185
      //! obtain the level of this entity
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
186
187
188
189
190
      int level () const
      {
        return hostEntity().level();
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
191
      //! obtain the partition type of this entity
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
192
193
194
195
196
      PartitionType partitionType () const
      {
        return hostEntity().partitionType();
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
197
198
199
200
201
202
203
204
205
206
      GeometryImpl makeGeometry () const
      {
        auto ff = [f=grid().coordFunction(),geo=hostEntity().geometry()](const auto& local) {
          return f(geo.global(local));
        };
        return GeometryImpl(type(), ff);
      }

      //! obtain the geometry of this entity
      /**
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
207
208
209
210
       *  Each DUNE entity encapsulates a geometry object, representing the map
       *  from the reference element to world coordinates. Wrapping the geometry
       *  is the main objective of the CurvedSurfaceGrid.
       *
Praetorius, Simon's avatar
Praetorius, Simon committed
211
212
       *  The CurvedSurfaceGrid provides geometries by parametrization with local basis
       *  functions, using the CurvedGeometry.
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
213
       *
Praetorius, Simon's avatar
Praetorius, Simon committed
214
       *  \returns a new curvedgeometry object
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
215
216
217
       */
      Geometry geometry () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
218
        if (!geo_) {
219
          if (grid_->useGeometryCaching())
Stenger, Florian's avatar
Stenger, Florian committed
220
          {
Praetorius, Simon's avatar
Praetorius, Simon committed
221
222
223
224
            auto const& idSet = grid_->hostGrid().localIdSet();
            auto& cached_geo = std::get<codim>(grid_->geometryCache_)[id(idSet)];

            // if geometry is already in cache
225
226
            if (cached_geo)
              geo_ = *cached_geo;
Praetorius, Simon's avatar
Praetorius, Simon committed
227
            // otherwise cache a new constructed geometry
228
229
230
231
            else {
              geo_ = makeGeometry();
              *cached_geo = *geo_;
            }
Stenger, Florian's avatar
Stenger, Florian committed
232
          }
Praetorius, Simon's avatar
Praetorius, Simon committed
233
234
235
          else
          {
            geo_ = makeGeometry();
Stenger, Florian's avatar
Stenger, Florian committed
236
          }
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
237
238
        }

Praetorius, Simon's avatar
Praetorius, Simon committed
239
        return Geometry(*geo_);
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
240
241
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
242
243
      //! obtain number of sub-entities of the current entity
      unsigned int subEntities (unsigned int cc) const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
244
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
245
        return hostEntity().subEntities( cc );
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
246
247
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
248
249
      //! return EntitySeed of host grid entity
      EntitySeed seed () const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
250
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
251
        return typename EntitySeed::Implementation(hostEntity().seed());
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
252
253
254
255
256
      }

      /** \} */


Praetorius, Simon's avatar
Praetorius, Simon committed
257
      /** \name Methods Supporting the Grid Implementation
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
258
259
       *  \{ */

Praetorius, Simon's avatar
Praetorius, Simon committed
260
      const Grid& grid () const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
261
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
262
263
        assert(grid_);
        return *grid_;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
264
265
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
266
267
      //! return the wrapped host-entity
      const HostEntity& hostEntity () const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
268
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
269
        return hostEntity_;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
270
271
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
272
273
274
      //! initiliaze an entity by a corresponding host-entity
      /**
       *  \param[in]  hostEntity  reference to the host entity
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
275
       */
Praetorius, Simon's avatar
Praetorius, Simon committed
276
      void initialize (const HostEntity& hostEntity)
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
277
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
278
        hostEntity_ = hostEntity;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
279
280
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
281
282
      //! obtain the entity's index from a host IndexSet
      /**
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
283
284
285
286
287
288
       *  \internal This method is provided by the entity, because its
       *  implementation is different for fake and non-fake entities.
       *
       *  \param[in]  indexSet  host IndexSet to use
       */
      template< class HostIndexSet >
Praetorius, Simon's avatar
Praetorius, Simon committed
289
290
      typename HostIndexSet::IndexType
      index (const HostIndexSet& indexSet) const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
291
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
292
        return indexSet.template index<codimension>(hostEntity());
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
293
294
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
295
296
      //! obtain the index of a subentity from a host IndexSet
      /**
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
297
298
299
300
301
302
303
304
305
       *  \internal This method is provided by the entity, because its
       *  implementation is different for fake and non-fake entities.
       *
       *  \param[in]  indexSet  host IndexSet to use
       *  \param[in]  i         number of the subentity
       *  \param[in]  cd        codimension of the subentity
       */
      template< class HostIndexSet >
      typename HostIndexSet::IndexType
Praetorius, Simon's avatar
Praetorius, Simon committed
306
      subIndex (const HostIndexSet& indexSet, int i, unsigned int cd) const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
307
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
308
        return indexSet.subIndex(hostEntity(), i, cd);
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
309
310
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
311
312
      //! check whether the entity is contained in a host index set
      /**
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
313
314
315
316
317
318
       *  \internal This method is provided by the entity, because its
       *  implementation is different for fake and non-fake entities.
       *
       *  \param  indexSet  host IndexSet to use
       */
      template< class HostIndexSet >
Praetorius, Simon's avatar
Praetorius, Simon committed
319
      bool isContained (const HostIndexSet& indexSet) const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
320
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
321
        return indexSet.contains(hostEntity());
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
322
323
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
324
325
      //! obtain the entity's id from a host IdSet
      /**
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
326
327
328
329
330
331
       *  \internal This method is provided by the entity, because its
       *  implementation is different for fake and non-fake entities.
       *
       *  \param  idSet  host IdSet to use
       */
      template< class HostIdSet >
Praetorius, Simon's avatar
Praetorius, Simon committed
332
      typename HostIdSet::IdType id (const HostIdSet& idSet) const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
333
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
334
        return idSet.template id<codimension>(hostEntity());
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
335
336
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
337
      /** \} */
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
338
339

    private:
Praetorius, Simon's avatar
Praetorius, Simon committed
340
341
      HostEntity hostEntity_ = {};
      const Grid* grid_ = nullptr;
342
      mutable Std::optional<GeometryImpl> geo_;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
343
344
345
346
347
348
349
350
    };


    // Entity
    // ------

    template< int codim, int dim, class Grid >
    class Entity
Praetorius, Simon's avatar
Praetorius, Simon committed
351
        : public EntityBase<codim, Grid>
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
352
    {
Praetorius, Simon's avatar
Praetorius, Simon committed
353
      using Super = EntityBase<codim, Grid>;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
354
355

    public:
Praetorius, Simon's avatar
Praetorius, Simon committed
356
357
      // import constructors from base class
      using Super::Super;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
358
359
360
361
362
363
364
    };


    // Entity for codimension 0
    // ------------------------

    template< int dim, class Grid >
Praetorius, Simon's avatar
Praetorius, Simon committed
365
366
    class Entity<0, dim, Grid>
        : public EntityBase<0, Grid>
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
367
    {
Praetorius, Simon's avatar
Praetorius, Simon committed
368
      using Super = EntityBase<0, Grid>;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
369

Praetorius, Simon's avatar
Praetorius, Simon committed
370
371
      using Traits = typename std::remove_const_t<Grid>::Traits;
      using HostGrid = typename Traits::HostGrid;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
372
373
374
375
376
377
378

    public:

      /** \name Types Required by DUNE
       *  \{ */

      //! type of corresponding local geometry
Praetorius, Simon's avatar
Praetorius, Simon committed
379
      using LocalGeometry = typename Traits::template Codim<0>::LocalGeometry;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
380

Praetorius, Simon's avatar
Praetorius, Simon committed
381
382
      //! facade type for entities
      using EntityFacade = Dune::Entity<0, dim, Grid, Dune::CGeo::Entity>;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
383
384

      //! type of hierarchic iterator
Praetorius, Simon's avatar
Praetorius, Simon committed
385
386
      using HierarchicIterator = typename Traits::HierarchicIterator;

Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
387
      //! type of leaf intersection iterator
Praetorius, Simon's avatar
Praetorius, Simon committed
388
389
      using LeafIntersectionIterator = typename Traits::LeafIntersectionIterator;

Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
390
      //! type of level intersection iterator
Praetorius, Simon's avatar
Praetorius, Simon committed
391
      using LevelIntersectionIterator = typename Traits::LevelIntersectionIterator;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
392
393
394

      /** \} */

Praetorius, Simon's avatar
Praetorius, Simon committed
395
396
      // import constructors from base class
      using Super::Super;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
397
398

      template< int codim >
Praetorius, Simon's avatar
Praetorius, Simon committed
399
      typename Grid::template Codim<codim>::Entity subEntity (int i) const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
400
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
401
402
        using EntityImpl = typename Traits::template Codim<codim>::EntityImpl;
        return EntityImpl(Super::grid(), Super::hostEntity(), i);
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
403
404
405
406
      }

      LevelIntersectionIterator ilevelbegin () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
407
408
        using LevelIntersectionIteratorImpl = CGeo::IntersectionIterator<Grid, typename HostGrid::LevelIntersectionIterator>;
        return LevelIntersectionIteratorImpl(*this, Super::hostEntity().ilevelbegin());
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
409
410
411
412
      }

      LevelIntersectionIterator ilevelend () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
413
414
        using LevelIntersectionIteratorImpl = CGeo::IntersectionIterator<Grid, typename HostGrid::LevelIntersectionIterator>;
        return LevelIntersectionIteratorImpl(*this, Super::hostEntity().ilevelend());
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
415
416
417
418
      }

      LeafIntersectionIterator ileafbegin () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
419
420
        using LeafIntersectionIteratorImpl = CGeo::IntersectionIterator<Grid, typename HostGrid::LeafIntersectionIterator>;
        return LeafIntersectionIteratorImpl(*this, Super::hostEntity().ileafbegin());
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
421
422
423
424
      }

      LeafIntersectionIterator ileafend () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
425
426
        using LeafIntersectionIteratorImpl = CGeo::IntersectionIterator<Grid, typename HostGrid::LeafIntersectionIterator>;
        return LeafIntersectionIteratorImpl(*this, Super::hostEntity().ileafend());
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
427
428
429
430
      }

      bool hasBoundaryIntersections () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
431
        return Super::hostEntity().hasBoundaryIntersections();
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
432
433
434
435
      }

      bool isLeaf () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
436
        return Super::hostEntity().isLeaf();
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
437
438
439
440
      }

      EntityFacade father () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
441
        return Entity(Super::grid(), Super::hostEntity().father());
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
442
443
444
445
      }

      bool hasFather () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
446
        return Super::hostEntity().hasFather();
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
447
448
449
450
      }

      LocalGeometry geometryInFather () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
451
        return Super::hostEntity().geometryInFather();
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
452
453
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
454
      HierarchicIterator hbegin (int maxLevel) const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
455
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
456
457
        using HierarchicIteratorImpl = CGeo::HierarchicIterator<Grid>;
        return HierarchicIteratorImpl(Super::grid(), Super::hostEntity().hbegin(maxLevel));
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
458
459
      }

Praetorius, Simon's avatar
Praetorius, Simon committed
460
      HierarchicIterator hend (int maxLevel) const
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
461
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
462
463
        using HierarchicIteratorImpl = CGeo::HierarchicIterator<Grid>;
        return HierarchicIteratorImpl(Super::grid(), Super::hostEntity().hend(maxLevel));
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
464
465
466
467
      }

      bool isRegular () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
468
        return Super::hostEntity().isRegular();
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
469
470
471
472
      }

      bool isNew () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
473
        return Super::hostEntity().isNew();
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
474
475
476
477
      }

      bool mightVanish () const
      {
Praetorius, Simon's avatar
Praetorius, Simon committed
478
        return Super::hostEntity().mightVanish();
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
479
480
481
      }
    };

Praetorius, Simon's avatar
Praetorius, Simon committed
482
  } // namespace CGeo
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
483
484
485

} // namespace Dune

Praetorius, Simon's avatar
Praetorius, Simon committed
486
#endif // DUNE_CURVED_SURFACE_GRID_ENTITY_HH