/usr/include/dune/grid/geometrygrid/indexsets.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 | #ifndef DUNE_GEOGRID_INDEXSETS_HH
#define DUNE_GEOGRID_INDEXSETS_HH
#include <vector>
#include <dune/common/typetraits.hh>
#include <dune/grid/common/gridenums.hh>
#include <dune/grid/common/indexidset.hh>
#include <dune/grid/geometrygrid/declaration.hh>
namespace Dune
{
namespace GeoGrid
{
// IndexSet
// --------
template< class Grid, class HostIndexSet >
class IndexSet
: public Dune::IndexSet< Grid, IndexSet< Grid, HostIndexSet >, typename HostIndexSet::IndexType >
{
typedef IndexSet< Grid, HostIndexSet > This;
typedef Dune::IndexSet< Grid, This, typename HostIndexSet::IndexType > Base;
typedef typename remove_const< Grid >::type::Traits Traits;
typedef typename Traits::HostGrid HostGrid;
public:
static const int dimension = Traits::dimension;
typedef typename Base::IndexType IndexType;
IndexSet ()
: hostIndexSet_( 0 )
{}
explicit IndexSet ( const HostIndexSet &hostIndexSet )
: hostIndexSet_( &hostIndexSet )
{}
IndexSet ( const This &other )
: hostIndexSet_( other.hostIndexSet_ )
{}
const This &operator= ( const This &other )
{
hostIndexSet_ = other.hostIndexSet_;
return *this;
}
using Base::index;
using Base::subIndex;
template< int cc >
IndexType index ( const typename Traits::template Codim< cc >::Entity &entity ) const
{
return Grid::getRealImplementation( entity ).index( hostIndexSet() );
}
template< int cc >
IndexType subIndex ( const typename Traits::template Codim< cc >::Entity &entity, int i, unsigned int codim ) const
{
return Grid::getRealImplementation( entity ).subIndex( hostIndexSet(), i, codim );
}
IndexType size ( GeometryType type ) const
{
return hostIndexSet().size( type );
}
int size ( int codim ) const
{
return hostIndexSet().size( codim );
}
template< class Entity >
bool contains ( const Entity &entity ) const
{
return Grid::getRealImplementation( entity ).isContained( hostIndexSet() );
}
const std::vector< GeometryType > &geomTypes ( int codim ) const
{
return hostIndexSet().geomTypes( codim );
}
operator bool () const { return bool( hostIndexSet_ ); }
private:
const HostIndexSet &hostIndexSet () const
{
assert( *this );
return *hostIndexSet_;
}
const HostIndexSet *hostIndexSet_;
};
} // namespace GeoGrid
} // namespace Dune
#endif // #ifndef DUNE_GEOGRID_INDEXSETS_HH
|