3 #ifndef DUNE_GEOMETRY_GENERICGEOMETRY_TOPOLOGYTYPES_HH
4 #define DUNE_GEOMETRY_GENERICGEOMETRY_TOPOLOGYTYPES_HH
9 #include <dune/common/static_assert.hh>
10 #include <dune/common/typetraits.hh>
11 #include <dune/common/unused.hh>
16 namespace GenericGeometry
31 static const unsigned int id = 0;
33 static std :: string
name ()
40 template<
class BaseTopology >
43 static const unsigned int dimension = BaseTopology :: dimension + 1;
48 static std :: string
name ()
56 template<
class BaseTopology >
59 static const unsigned int dimension = BaseTopology :: dimension + 1;
60 static const unsigned int numCorners = BaseTopology :: numCorners + 1;
64 static std :: string
name ()
73 template<
class Topology >
76 template<
class Base >
77 struct BaseTopology<
Prism< Base > >
82 template<
class Base >
90 template<
class Topology >
93 static const bool value = ((Topology::id >> 1) == 0);
96 template<
class Topology >
99 static const bool value = ((Topology::id | 1) == (1 << Topology::dimension) - 1);
102 template<
class Topology >
105 static const bool value
109 template<
class Topology >
115 template<
class BaseTopology >
118 static const bool value
151 inline bool isPyramid (
unsigned int topologyId,
int dim,
int codim = 0 )
154 assert( (0 <= codim) && (codim < dim) );
155 return (((topologyId & ~1) & (1u << (dim-codim-1))) == 0);
169 inline bool isPrism (
unsigned int topologyId,
int dim,
int codim = 0 )
172 assert( (0 <= codim) && (codim < dim) );
173 return (( (topologyId | 1) & (1u << (dim-codim-1))) != 0);
191 assert( (0 <= codim) && (codim <= dim) );
192 return (codim >= (dim-1)) || (((topologyId >> (dim-codim-1)) & 1) == (
unsigned int)construction);
202 inline unsigned int baseTopologyId (
unsigned int topologyId,
int dim,
int codim = 1 )
205 assert( (0 <= codim) && (codim <= dim) );
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);
214 template<
unsigned int dim >
206 return topologyId & ((1u << (dim-codim)) - 1);