Dune Core Modules (2.3.1)

hostgridaccess.hh
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
8#include <dune/grid/geometrygrid/intersection.hh>
9
10namespace 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 &
102 hostIntersection ( const Intersection< const Grid, GeoGrid::Intersection< const Grid, HostIntersection > > &intersection )
103 {
104 return Grid::getRealImplementation( intersection ).hostIntersection();
105 }
106 };
107
108} // namespace Dune
109
110#endif // #ifndef DUNE_GRID_HOSTGRIDACCESS_HH
Wrapper class for entities.
Definition: entity.hh:57
grid wrapper replacing the geometries
Definition: grid.hh:83
Grid abstract base class.
Definition: grid.hh:386
Dune namespace.
Definition: alignment.hh:14
Grid::template Codim< codim >::EntityPointer EntityPointer
type of the GeometryGrid entity pointer
Definition: hostgridaccess.hh:59
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
HostGrid::template Codim< codim >::EntityPointer HostEntityPointer
type of the host entity pointer
Definition: hostgridaccess.hh:64
provides access to host grid objects
Definition: hostgridaccess.hh:25
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)