dune-grid  2.3.1
hostgridaccess.hh
Go to the documentation of this file.
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_GRID_HOSTGRIDACCESS_HH
4 #define DUNE_GRID_HOSTGRIDACCESS_HH
5 
6 #include <string>
7 
9 
10 namespace Dune
11 {
12 
13  // External Forward Declarations
14  // -----------------------------
15 
16  template< class HostGrid, class CoordFunction, class Allocator >
17  class GeometryGrid;
18 
19 
20 
21  // HostGridAccess
22  // --------------
23 
24  template< class Grid >
26 
27 
28 
36  template< class HG, class CoordFunction, class Allocator >
37  struct HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >
38  {
43 
45  typedef typename Grid::HostGrid HostGrid;
46 
53  template< int codim >
54  struct Codim
55  {
57  typedef typename Grid::template Codim< codim >::Entity Entity;
59  typedef typename Grid::template Codim< codim >::EntityPointer EntityPointer;
60 
62  typedef typename HostGrid::template Codim< codim >::Entity HostEntity;
64  typedef typename HostGrid::template Codim< codim >::EntityPointer HostEntityPointer;
65  };
66 
68  typedef typename Grid::Traits::LeafIntersection LeafIntersection;
70  typedef typename Grid::Traits::LevelIntersection LevelIntersection;
71 
73  typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
75  typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
76 
81  static const HostGrid &hostGrid ( const Grid &grid )
82  {
83  return grid.hostGrid();
84  }
85 
86  template< class Entity >
87  static const typename Codim< Entity::codimension >::HostEntity &
88  hostEntity ( const Entity &entity )
89  {
90  return hostEntity< Entity::codimension >( entity );
91  }
92 
93  template< int codim >
94  static const typename Codim< codim >::HostEntity &
95  hostEntity ( const typename Codim< codim >::Entity &entity )
96  {
97  return Grid::getRealImplementation( entity ).hostEntity();
98  }
99 
100  template< class HostIntersection >
101  static const HostIntersection &
103  {
104  return Grid::getRealImplementation( intersection ).hostIntersection();
105  }
106  };
107 
108 } // namespace Dune
109 
110 #endif // #ifndef DUNE_GRID_HOSTGRIDACCESS_HH
GeometryGrid< HG, CoordFunction, Allocator > Grid
Definition: hostgridaccess.hh:42
Grid::template Codim< codim >::EntityPointer EntityPointer
type of the GeometryGrid entity pointer
Definition: hostgridaccess.hh:59
Wrapper class for entities.
Definition: common/entity.hh:56
HostGrid::template Codim< codim >::Entity HostEntity
type of the host entity
Definition: hostgridaccess.hh:62
Grid::template Codim< codim >::Entity Entity
type of the GeometryGrid entity
Definition: hostgridaccess.hh:57
const HostGrid & hostGrid() const
Definition: geometrygrid/grid.hh:696
Grid::Traits::LeafIntersection LeafIntersection
type of the GeometryGrid leaf intersection
Definition: hostgridaccess.hh:68
Grid::HostGrid HostGrid
type of HostGrid
Definition: hostgridaccess.hh:45
static const HostGrid & hostGrid(const Grid &grid)
Get underlying HostGrid.
Definition: hostgridaccess.hh:81
Definition: geometrygrid/intersection.hh:20
static const HostIntersection & hostIntersection(const Intersection< const Grid, GeoGrid::Intersection< const Grid, HostIntersection > > &intersection)
Definition: hostgridaccess.hh:102
static const Codim< Entity::codimension >::HostEntity & hostEntity(const Entity &entity)
Definition: hostgridaccess.hh:88
Intersection of a mesh entities of codimension 0 ("elements") with a "neighboring" element or with th...
Definition: albertagrid/dgfparser.hh:26
HostGrid::template Codim< codim >::EntityPointer HostEntityPointer
type of the host entity pointer
Definition: hostgridaccess.hh:64
HostGrid::Traits::LevelIntersection HostLevelIntersection
type of the host level intersection
Definition: hostgridaccess.hh:75
provides access to host grid objects
Definition: hostgridaccess.hh:25
HostGrid::Traits::LeafIntersection HostLeafIntersection
type of the host leaf intersection
Definition: hostgridaccess.hh:73
Grid::Traits::LevelIntersection LevelIntersection
type of the GeometryGrid level intersection
Definition: hostgridaccess.hh:70
grid wrapper replacing the geometriesGeometryGrid wraps another DUNE grid and replaces its geometry b...
Definition: geometrygrid/declaration.hh:10
static const Codim< codim >::HostEntity & hostEntity(const typename Codim< codim >::Entity &entity)
Definition: hostgridaccess.hh:95