3#ifndef DUNE_GRID_HOSTGRIDACCESS_HH
4#define DUNE_GRID_HOSTGRIDACCESS_HH
8#include <dune/grid/geometrygrid/intersection.hh>
16 template<
class HostGr
id,
class CoordFunction,
class Allocator >
26 template<
class Gr
id >
27 struct HostGridAccess;
38 template<
class HG,
class CoordFunction,
class Allocator >
39 struct HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >
44 typedef GeometryGrid< HG, CoordFunction, Allocator > Grid;
47 typedef typename Grid::HostGrid HostGrid;
66 typedef typename Grid::Traits::LeafIntersection LeafIntersection;
68 typedef typename Grid::Traits::LevelIntersection LevelIntersection;
71 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
73 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
79 static const HostGrid &hostGrid (
const Grid &grid )
84 template<
class Entity >
86 hostEntity (
const Entity &entity )
88 return hostEntity< Entity::codimension >( entity );
92 static const typename Codim< codim >::HostEntity &
93 hostEntity (
const typename Codim< codim >::Entity &entity )
95 return Grid::getRealImplementation( entity ).hostEntity();
98 template<
class HostIntersection >
99 static const HostIntersection &
100 hostIntersection (
const Intersection<
const Grid, GeoGrid::Intersection< const Grid, HostIntersection > > &intersection )
102 return Grid::getRealImplementation( intersection ).hostIntersection();
115 struct HostGridAccess< IdentityGrid< HG > >
120 typedef IdentityGrid< HG > Grid;
131 template<
int codim >
147 typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
149 typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
155 static const HostGrid &hostGrid (
const Grid &grid )
160 template<
class Entity >
162 hostEntity (
const Entity &entity )
164 return hostEntity< Entity::codimension >( entity );
167 template<
int codim >
168 static const typename Codim< codim >::HostEntity &
169 hostEntity (
const typename Codim< codim >::Entity &entity )
171 return *Grid::getRealImplementation( entity ).hostEntity_;
174 static const HostLeafIntersection &
175 hostIntersection (
const LeafIntersection &intersection )
177 return *Grid::getRealImplementation( intersection ).hostIterator_;
180 static const HostLevelIntersection &
181 hostIntersection (
const LevelIntersection &intersection )
183 return *Grid::getRealImplementation( intersection ).hostIterator_;
Wrapper class for entities.
Definition: entity.hh:64
grid wrapper replacing the geometries
Definition: grid.hh:82
const HostGrid & hostGrid() const
obtain constant reference to the host grid
Definition: grid.hh:548
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:460
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:465
Provides a meta grid that is identical to its host.
Definition: identitygrid.hh:87
HostGridType & getHostGrid() const
Returns the hostgrid this IdentityGrid lives in.
Definition: identitygrid.hh:393
Dune namespace.
Definition: alignedallocator.hh:10
Static tag representing a codimension.
Definition: dimension.hh:22
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:59
Grid::template Codim< codim >::Entity Entity
type of the IdGrid entity
Definition: hostgridaccess.hh:135
HostGrid::template Codim< codim >::Entity HostEntity
type of the host entity
Definition: hostgridaccess.hh:138