23 :
public IndexSet< PolyhedralGrid< dim, dimworld, coord_t >, PolyhedralGridIndexSet< dim, dimworld, coord_t >, int >
29 typedef IndexSet< GridType, This, int > Base;
31 typedef typename std::remove_const< GridType >::type::Traits Traits;
34 static const int dimension = Traits::dimension;
36 typedef typename Base::IndexType IndexType;
43 template<
class Entity >
44 IndexType index (
const Entity &entity )
const
46 return index< Entity::codimension >( entity );
50 IndexType index (
const typename Traits::template Codim< cd >::Entity &entity )
const
52 return entity.impl().index();
56 IndexType subIndex (
const typename Traits::template Codim< cd >::Entity &entity,
int i,
unsigned int codim )
const
58 return subIndex( entity, i, codim );
61 template<
class Entity >
62 IndexType subIndex (
const Entity &entity,
int i,
unsigned int codim )
const
65 return index( entity );
66 else if ( codim == 1 )
67 return index( entity.impl().template subEntity< 1 > ( i ) );
68 else if ( codim == dimension )
70 return index( entity.impl().template subEntity< dimension > ( i ) );
74 DUNE_THROW(NotImplemented,
"codimension not available");
75 return IndexType( -1 );
79 IndexType size ( GeometryType type )
const
81 return grid().
size( type );
84 int size (
int codim )
const
86 return grid().
size( codim );
89 template<
class Entity >
90 bool contains (
const Entity &entity )
const
92 return index(entity) >= 0 && index(entity) < size(Entity::codimension);
95 const std::vector< GeometryType > &geomTypes (
int codim )
const
97 return grid().geomTypes(codim);
100 const std::vector< GeometryType >& types(
int codim)
const
102 return grid().geomTypes(codim);
105 const GridType& grid()
const { assert( grid_ );
return *grid_; }