/usr/include/dune/grid/utility/hostgridaccess.hh is in libdune-grid-dev 2.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_GRID_HOSTGRIDACCESS_HH
#define DUNE_GRID_HOSTGRIDACCESS_HH
#include <string>
#include <dune/grid/geometrygrid/intersection.hh>
namespace Dune
{
// External Forward Declarations
// -----------------------------
template< class HostGrid, class CoordFunction, class Allocator >
class GeometryGrid;
template< class >
class IdentityGrid;
// HostGridAccess
// --------------
template< class Grid >
struct HostGridAccess;
/** \class HostGridAccess
* \brief provides access to host grid objects from GeometryGrid
*
* \tparam GeometryGrid
*
* \nosubgrouping
*/
template< class HG, class CoordFunction, class Allocator >
struct HostGridAccess< GeometryGrid< HG, CoordFunction, Allocator > >
{
/** \name Exported Types
* \{ */
typedef GeometryGrid< HG, CoordFunction, Allocator > Grid;
//! type of HostGrid
typedef typename Grid::HostGrid HostGrid;
/** \} */
/** \brief A Traits struct that collects return types of class member methods.
*
* \tparam codim codimension
*/
template< int codim >
struct Codim
{
//! type of the GeometryGrid entity
typedef typename Grid::template Codim< codim >::Entity Entity;
//! type of the host entity
typedef typename HostGrid::template Codim< codim >::Entity HostEntity;
};
//! type of the GeometryGrid leaf intersection
typedef typename Grid::Traits::LeafIntersection LeafIntersection;
//! type of the GeometryGrid level intersection
typedef typename Grid::Traits::LevelIntersection LevelIntersection;
//! type of the host leaf intersection
typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
//! type of the host level intersection
typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
/** \brief Get underlying HostGrid.
* \param[in] grid GeometryGrid
* \returns HostGrid
*/
static const HostGrid &hostGrid ( const Grid &grid )
{
return grid.hostGrid();
}
template< class Entity >
static const typename Codim< Entity::codimension >::HostEntity &
hostEntity ( const Entity &entity )
{
return hostEntity< Entity::codimension >( entity );
}
template< int codim >
static const typename Codim< codim >::HostEntity &
hostEntity ( const typename Codim< codim >::Entity &entity )
{
return Grid::getRealImplementation( entity ).hostEntity();
}
template< class HostIntersection >
static const HostIntersection &
hostIntersection ( const Intersection< const Grid, GeoGrid::Intersection< const Grid, HostIntersection > > &intersection )
{
return Grid::getRealImplementation( intersection ).hostIntersection();
}
};
/** \class HostGridAccess
* \brief provides access to host grid objects from IdentityGrid
*
* \tparam IdentityGrid meta grid, whose host grid shall be accessed
*
* \nosubgrouping
*/
template< class HG >
struct HostGridAccess< IdentityGrid< HG > >
{
/** \name Exported Types
* \{ */
typedef IdentityGrid< HG > Grid;
//! type of HostGrid
typedef HG HostGrid;
/** \} */
/** \brief A Traits struct that collects return types of class member methods.
*
* \tparam codim codimension
*/
template< int codim >
struct Codim
{
//! type of the IdGrid entity
typedef typename Grid::template Codim< codim >::Entity Entity;
//! type of the host entity
typedef typename HostGrid::template Codim< codim >::Entity HostEntity;
};
//! type of the IdGrid leaf intersection
typedef typename Grid::Traits::LeafIntersection LeafIntersection;
//! type of the IdGrid level intersection
typedef typename Grid::Traits::LevelIntersection LevelIntersection;
//! type of the host leaf intersection
typedef typename HostGrid::Traits::LeafIntersection HostLeafIntersection;
//! type of the host level intersection
typedef typename HostGrid::Traits::LevelIntersection HostLevelIntersection;
/** \brief Get underlying HostGrid.
* \param[in] grid grid, whose host grid shall be returned
* \returns HostGrid
*/
static const HostGrid &hostGrid ( const Grid &grid )
{
return grid.getHostGrid();
}
template< class Entity >
static const typename Codim< Entity::codimension >::HostEntity &
hostEntity ( const Entity &entity )
{
return hostEntity< Entity::codimension >( entity );
}
template< int codim >
static const typename Codim< codim >::HostEntity &
hostEntity ( const typename Codim< codim >::Entity &entity )
{
return *Grid::getRealImplementation( entity ).hostEntity_;
}
static const HostLeafIntersection &
hostIntersection ( const LeafIntersection &intersection )
{
return *Grid::getRealImplementation( intersection ).hostIterator_;
}
static const HostLevelIntersection &
hostIntersection ( const LevelIntersection &intersection )
{
return *Grid::getRealImplementation( intersection ).hostIterator_;
}
};
} // namespace Dune
#endif // #ifndef DUNE_GRID_HOSTGRIDACCESS_HH
|