4 #ifndef DISABLE_GEOMETRYTYPE_DEPRECATION_WARNING
5 #warning #include <dune/common/geometrytype.hh> is deprecated. Use
6 #warning #include <dune/geometry/type.hh> instead. You may need the new
7 #warning Dune-Geometry core module.
8 #endif // DISABLE_GEOMETRYTYPE_DEPRECATION_WARNING
10 #ifndef DUNE_COMMON_GEOMETRYTYPE_HH
11 #define DUNE_COMMON_GEOMETRYTYPE_HH
62 unsigned int topologyId_;
65 unsigned char dim_ : 7;
73 : topologyId_(0), dim_(0), none_(true)
78 : topologyId_(0), dim_(dim), none_(false)
103 "Invalid basic geometry type: " << basicType <<
" for dimension " << dim <<
"." );
109 : topologyId_(topologyId), dim_(dim), none_(false)
122 template<
class TopologyType>
124 : topologyId_(TopologyType::
id), dim_(TopologyType::dimension), none_(false)
129 : topologyId_(0), dim_(dim), none_(false)
139 : topologyId_(0), dim_(dim), none_(false)
206 topologyId_ = ((dim>1) ? ((1 << dim) - 1) : 0);
233 return ! none_ && dim_==2 && (topologyId_ | 1) ==
b0001;
238 return ! none_ && dim_==2 && (topologyId_ | 1) ==
b0011;
243 return ! none_ && dim_==3 && (topologyId_ | 1) ==
b0001;
248 return ! none_ && dim_==3 && (topologyId_ | 1) ==
b0011;
253 return ! none_ && dim_==3 && (topologyId_ | 1) ==
b0101;
258 return ! none_ && dim_==3 && (topologyId_ | 1) ==
b0111;
263 return ! none_ && (topologyId_ | 1) == 1;
268 return ! none_ && ((topologyId_ ^ ((1 << dim_)-1)) >> 1 == 0);
277 unsigned int dim()
const {
297 unsigned int id()
const {
307 return ( ( none_ == other.none_ )
308 && ( ( none_ ==
true )
309 || ( ( dim_ == other.dim_ )
310 && ( (topologyId_ >> 1) == (other.topologyId_ >> 1) )
318 return ! ((*this)==other);
323 return ( ( none_ < other.none_ )
324 || ( !( other.none_ < none_ )
325 && ( ( dim_ < other.dim_ )
326 || ( (other.dim_ == dim_)
327 && ((topologyId_ >> 1) < (other.topologyId_ >> 1) )
340 s <<
"(simplex, " << a.
dim() <<
")";
345 s <<
"(cube, " << a.
dim() <<
")";
360 s <<
"(none, " << a.
dim() <<
")";
363 s <<
"(other [" << a.
id() <<
"], " << a.
dim() <<
")";
395 #endif // DUNE_COMMON_GEOMETRYTYPE_HH