5#ifndef DUNE_GRID_HOSTGRIDACCESS_HH
6#define DUNE_GRID_HOSTGRIDACCESS_HH
10#include <dune/grid/geometrygrid/intersection.hh>
18 template<
class HostGr
id,
class CoordFunction,
class Allocator >
28 template<
class Gr
id >
29 struct HostGridAccess;
40 template<
class HG,
class CoordFunction,
class Allocator >
41 struct HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >
46 typedef GeometryGrid< HG, CoordFunction, Allocator > Grid;
49 typedef typename Grid::HostGrid HostGrid;
68 typedef typename Grid::Traits::LeafIntersection LeafIntersection;
70 typedef typename Grid::Traits::LevelIntersection LevelIntersection;
73 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
75 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
81 static const HostGrid &hostGrid (
const Grid &grid )
86 template<
class Entity >
88 hostEntity (
const Entity &entity )
90 return hostEntity< Entity::codimension >( entity );
94 static const typename Codim< codim >::HostEntity &
95 hostEntity (
const typename Codim< codim >::Entity &entity )
97 return entity.impl().hostEntity();
100 template<
class HostIntersection >
101 static const HostIntersection &
102 hostIntersection (
const Intersection<
const Grid, GeoGrid::Intersection< const Grid, HostIntersection > > &intersection )
104 return intersection.impl().hostIntersection();
117 struct HostGridAccess< IdentityGrid< HG > >
122 typedef IdentityGrid< HG > Grid;
133 template<
int codim >
149 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
151 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
157 static const HostGrid &hostGrid (
const Grid &grid )
162 template<
class Entity >
164 hostEntity (
const Entity &entity )
166 return hostEntity< Entity::codimension >( entity );
169 template<
int codim >
170 static const typename Codim< codim >::HostEntity &
171 hostEntity (
const typename Codim< codim >::Entity &entity )
173 return *entity.impl().hostEntity_;
176 static const HostLeafIntersection &
177 hostIntersection (
const LeafIntersection &intersection )
179 return *intersection.impl().hostIterator_;
182 static const HostLevelIntersection &
183 hostIntersection (
const LevelIntersection &intersection )
185 return *intersection.impl().hostIterator_;
Wrapper class for entities.
Definition: entity.hh:66
grid wrapper replacing the geometries
Definition: grid.hh:86
const HostGrid & hostGrid() const
obtain constant reference to the host grid
Definition: grid.hh:533
GridFamily::Traits::LeafIntersection LeafIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition: grid.hh:456
GridFamily::Traits::LevelIntersection LevelIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition: grid.hh:461
Provides a meta grid that is identical to its host.
Definition: identitygrid.hh:93
HostGridType & getHostGrid() const
Returns the hostgrid this IdentityGrid lives in.
Definition: identitygrid.hh:415
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24
HostGrid::template Codim< codim >::Entity HostEntity
type of the host entity
Definition: hostgridaccess.hh:64
Grid::template Codim< codim >::Entity Entity
type of the GeometryGrid entity
Definition: hostgridaccess.hh:61
Grid::template Codim< codim >::Entity Entity
type of the IdGrid entity
Definition: hostgridaccess.hh:137
HostGrid::template Codim< codim >::Entity HostEntity
type of the host entity
Definition: hostgridaccess.hh:140