gridfamily.hh 4.55 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_GRIDFAMILY_HH
#define DUNE_CURVED_SURFACE_GRID_GRIDFAMILY_HH
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
5
6

#include <dune/grid/common/grid.hh>
Praetorius, Simon's avatar
Praetorius, Simon committed
7
#include <dune/curvedgeometry/curvedgeometry.hh>
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
8
9
10
#include <dune/curvedsurfacegrid/capabilities.hh>
#include <dune/curvedsurfacegrid/entity.hh>
#include <dune/curvedsurfacegrid/entityseed.hh>
11
//#include <dune/curvedsurfacegrid/geometry.hh>
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
12
13
14
15
16
17
18
19
20
21
22
#include <dune/curvedsurfacegrid/gridview.hh>
#include <dune/curvedsurfacegrid/intersection.hh>
#include <dune/curvedsurfacegrid/intersectioniterator.hh>
#include <dune/curvedsurfacegrid/iterator.hh>
#include <dune/curvedsurfacegrid/idset.hh>
#include <dune/curvedsurfacegrid/indexsets.hh>

namespace Dune
{

  /** \brief namespace containing the implementations of CurvedSurfaceGrid
Praetorius, Simon's avatar
Praetorius, Simon committed
23
   *  \ingroup CurvedGeo
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
24
   */
Praetorius, Simon's avatar
Praetorius, Simon committed
25
  namespace CGeo
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
26
27
28
29
  {
    // GridFamily
    // ----------

30
    template< class HG, class CF, int order, class Allocator >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
31
32
33
34
    struct GridFamily
    {
      struct Traits
      {
35
        using Grid = CurvedSurfaceGrid<HG, CF, order, Allocator>;
Praetorius, Simon's avatar
Praetorius, Simon committed
36
        using HostGrid = HG;
37
        using CoordFunction = CF;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
38

Praetorius, Simon's avatar
Praetorius, Simon committed
39
        using ctype = typename HostGrid::ctype;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
40

41
42
        static const int dimension = HostGrid::dimension;
        static const int dimensionworld = CoordFunction::dimRange;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
43

Praetorius, Simon's avatar
Praetorius, Simon committed
44
45
        using LeafIntersection = Dune::Intersection<const Grid, CGeo::Intersection<const Grid, typename HostGrid::LeafIntersection> >;
        using LevelIntersection = Dune::Intersection<const Grid, CGeo::Intersection<const Grid, typename HostGrid::LevelIntersection> >;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
46

Praetorius, Simon's avatar
Praetorius, Simon committed
47
48
49
50
        using LeafIntersectionIterator
          = Dune::IntersectionIterator<const Grid, CGeo::IntersectionIterator<const Grid, typename HostGrid::LeafIntersectionIterator>, CGeo::Intersection<const Grid, typename HostGrid::LeafIntersection> >;
        using LevelIntersectionIterator
          = Dune::IntersectionIterator<const Grid, CGeo::IntersectionIterator<const Grid, typename HostGrid::LevelIntersectionIterator >, CGeo::Intersection<const Grid, typename HostGrid::LevelIntersection> >;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
51

Praetorius, Simon's avatar
Praetorius, Simon committed
52
        using HierarchicIterator = Dune::EntityIterator<0, const Grid, CGeo::HierarchicIterator<const Grid> >;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
53
54
55
56

        template< int codim >
        struct Codim
        {
Praetorius, Simon's avatar
Praetorius, Simon committed
57
          template < int mydim, int cdim, class GridImpl >
58
59
          using GeometryImplTemplate = Dune::LagrangeCurvedGeometry<ctype,mydim,cdim,order>;

Praetorius, Simon's avatar
Praetorius, Simon committed
60
61
62
63
          // geometry types
          using GeometryImpl = GeometryImplTemplate<dimension-codim, dimensionworld, const Grid>;
          using Geometry = Dune::Geometry<dimension-codim, dimensionworld, const Grid, GeometryImplTemplate>;
          using LocalGeometry = typename HostGrid::template Codim<codim>::LocalGeometry;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
64

Praetorius, Simon's avatar
Praetorius, Simon committed
65
66
67
          // entity types
          using EntityImpl = CGeo::Entity<codim, dimension, const Grid>;
          using Entity = Dune::Entity<codim, dimension, const Grid, CGeo::Entity>;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
68

Praetorius, Simon's avatar
Praetorius, Simon committed
69
          using EntitySeed = Dune::EntitySeed<const Grid, CGeo::EntitySeed<codim, const Grid> >;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
70
71
72
73

          template< PartitionIteratorType pitype >
          struct Partition
          {
Praetorius, Simon's avatar
Praetorius, Simon committed
74
75
            using LeafIteratorImp = CGeo::Iterator<typename HostGrid::LeafGridView, codim, pitype, const Grid>;
            using LeafIterator = Dune::EntityIterator<codim, const Grid, LeafIteratorImp>;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
76

Praetorius, Simon's avatar
Praetorius, Simon committed
77
78
            using LevelIteratorImp = CGeo::Iterator<typename HostGrid::LevelGridView, codim, pitype, const Grid>;
            using LevelIterator = Dune::EntityIterator<codim, const Grid, LevelIteratorImp>;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
79
80
          };

Praetorius, Simon's avatar
Praetorius, Simon committed
81
82
          using LeafIterator = typename Partition< All_Partition >::LeafIterator;
          using LevelIterator = typename Partition< All_Partition >::LevelIterator;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
83
84
        };

Praetorius, Simon's avatar
Praetorius, Simon committed
85
86
87
        // index-sets
        using LeafIndexSet = CGeo::IndexSet<const Grid, typename HostGrid::Traits::LeafIndexSet>;
        using LevelIndexSet = CGeo::IndexSet<const Grid, typename HostGrid::Traits::LevelIndexSet>;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
88

Praetorius, Simon's avatar
Praetorius, Simon committed
89
90
91
        // id-sets
        using GlobalIdSet = CGeo::IdSet<const Grid, typename HostGrid::Traits::GlobalIdSet>;
        using LocalIdSet = CGeo::IdSet<const Grid, typename HostGrid::Traits::LocalIdSet>;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
92

Praetorius, Simon's avatar
Praetorius, Simon committed
93
        using CollectiveCommunication = typename HostGrid::Traits::CollectiveCommunication;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
94

Praetorius, Simon's avatar
Praetorius, Simon committed
95
        // grid views
96
97
        using LeafGridView = Dune::GridView< CGeo::GridViewTraits< typename HostGrid::LeafGridView, CF, order, Allocator > >;
        using LevelGridView = Dune::GridView< CGeo::GridViewTraits< typename HostGrid::LevelGridView, CF, order, Allocator > >;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
98
99
100
      };
    };

Praetorius, Simon's avatar
Praetorius, Simon committed
101
  } // namespace CGeo
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
102
103
} // namespace Dune

Praetorius, Simon's avatar
Praetorius, Simon committed
104
#endif // DUNE_CURVED_SURFACE_GRID_GRIDFAMILY_HH