/usr/include/dune/grid/geometrygrid/entityseed.hh is in libdune-grid-dev 2.4.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 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_GEOGRID_ENTITYSEED_HH
#define DUNE_GEOGRID_ENTITYSEED_HH
#include <dune/common/typetraits.hh>
#include <dune/grid/common/entityseed.hh>
#include <dune/grid/geometrygrid/capabilities.hh>
namespace Dune
{
namespace GeoGrid
{
// Internal Forward Declarations
// -----------------------------
template< int codim, class Grid, bool fake = !(Capabilities::hasHostEntity< Grid, codim >::v) >
class EntitySeed;
// EntitySeed (real)
// -----------------
template< int codim, class Grd >
class EntitySeed< codim, Grd, false >
{
typedef typename remove_const< Grd >::type::Traits Traits;
public:
static const int codimension = codim;
static const int dimension = Traits::dimension;
static const int mydimension = dimension - codimension;
static const int dimensionworld = Traits::dimensionworld;
static const bool fake = false;
typedef typename Traits::Grid Grid;
typedef typename Traits::template Codim< codim >::Entity Entity;
typedef typename Traits::HostGrid HostGrid;
typedef typename HostGrid::template Codim< codim >::EntitySeed HostEntitySeed;
//! default construct an invalid entity seed
EntitySeed ( )
{}
explicit EntitySeed ( const HostEntitySeed &hostEntitySeed )
: hostEntitySeed_( hostEntitySeed )
{}
//! check whether the EntitySeed refers to a valid Entity
bool isValid() const
{
return hostEntitySeed_.isValid();
}
const HostEntitySeed &hostEntitySeed () const { return hostEntitySeed_; }
private:
HostEntitySeed hostEntitySeed_;
};
// EntitySeed (fake)
// -----------------
template< int codim, class Grd >
class EntitySeed< codim, Grd, true >
{
typedef typename remove_const< Grd >::type::Traits Traits;
public:
static const int codimension = codim;
static const int dimension = Traits::dimension;
static const int mydimension = dimension - codimension;
static const int dimensionworld = Traits::dimensionworld;
static const bool fake = true;
typedef typename Traits::Grid Grid;
typedef typename Traits::template Codim< codim >::Entity Entity;
typedef typename Traits::HostGrid HostGrid;
typedef typename HostGrid::template Codim< 0 >::EntitySeed HostElementSeed;
//! default construct an invalid entity seed
EntitySeed ( )
{}
explicit EntitySeed ( const HostElementSeed &hostElementSeed, unsigned int subEntity )
: hostElementSeed_( hostElementSeed ),
subEntity_( subEntity )
{}
//! check whether the EntitySeed refers to a valid Entity
bool isValid() const
{
return hostElementSeed_.isValid();
}
const HostElementSeed &hostElementSeed () const { return hostElementSeed_; }
unsigned int subEntity () const { return subEntity_; }
private:
HostElementSeed hostElementSeed_;
unsigned int subEntity_;
};
} // namespace GeoGrid
} // namespace Dune
#endif // #ifndef DUNE_GEOGRID_ENTITYSEED_HH
|