/usr/include/dune/grid/utility/hostgridaccess.hh is in libdune-grid-dev 2.2.1-2.
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 | #ifndef DUNE_GRID_HOSTGRIDACCESS_HH
#define DUNE_GRID_HOSTGRIDACCESS_HH
#include <string>
namespace Dune
{
// External Forward Declarations
// -----------------------------
template< class HostGrid, class CoordFunction, class Allocator >
class GeometryGrid;
// HostGridAccess
// --------------
template< class Grid >
struct HostGridAccess;
/** \class HostGridAccess
* \brief provides access to host grid objects
*
* \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 GeometryGrid entity pointer
typedef typename Grid::template Codim< codim >::EntityPointer EntityPointer;
//! type of the host entity
typedef typename HostGrid::template Codim< codim >::Entity HostEntity;
//! type of the host entity pointer
typedef typename HostGrid::template Codim< codim >::EntityPointer HostEntityPointer;
};
//! 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();
}
static const HostLeafIntersection &
hostIntersection ( const LeafIntersection &intersection )
{
return Grid::getRealImplementation( intersection ).hostIntersection();
}
static const HostLevelIntersection &
hostIntersection ( const LevelIntersection &intersection )
{
return Grid::getRealImplementation( intersection ).hostIntersection();
}
};
}
#endif // #ifndef DUNE_GRID_HOSTGRIDACCESS_HH
|