3 #ifndef DUNE_GEOGRID_GEOMETRY_HH
4 #define DUNE_GEOGRID_GEOMETRY_HH
6 #include <dune/common/nullptr.hh>
7 #include <dune/common/typetraits.hh>
9 #include <dune/geometry/referenceelements.hh>
10 #include <dune/geometry/multilineargeometry.hh>
24 template<
class hasSingleGeometryType,
int dim,
int mydim >
29 static const unsigned int idMask = (1u << mydim) - 1u;
32 static const bool v = hasSingleGeometryType::v && ((mydim == dim) || ((
id | 1u) == 1u) || ((
id | 1u) == idMask));
33 static const unsigned int topologyId = (
v ?
id & idMask : ~0u);
36 template<
class hasSingleGeometryType,
int dim >
39 static const bool v =
true;
40 static const unsigned int topologyId = GenericGeometry::CubeTopology< 1 >::type::id;
43 template<
class hasSingleGeometryType,
int dim >
46 static const bool v =
true;
47 static const unsigned int topologyId = GenericGeometry::CubeTopology< 0 >::type::id;
55 template<
class Gr
id >
58 typedef typename remove_const< Grid >::type::Traits
Traits;
60 typedef typename Traits::ctype
ctype;
62 typedef GenericGeometry::MatrixHelper< GenericGeometry::DuneCoordTraits< ctype > >
MatrixHelper;
64 static ctype tolerance () {
return 16 * std::numeric_limits< ctype >::epsilon(); }
66 template<
int mydim,
int cdim >
83 template<
int mydim,
int cdim,
class Gr
id >
88 typedef typename remove_const< Grid >::type::Traits Traits;
90 template<
int,
int,
class >
friend class Geometry;
93 typedef typename Traits::ctype
ctype;
101 typedef CachedMultiLinearGeometry< ctype, mydimension, coorddimension, GeometryTraits< Grid > >
BasicMapping;
106 template<
class CoordVector >
116 unsigned int refCount_;
131 template<
class CoordVector >
136 void *mappingStorage = grid.allocateStorage(
sizeof(
Mapping ) );
137 mapping_ =
new( mappingStorage )
Mapping( type, coords );
142 : grid_( other.grid_ ),
143 mapping_( other.mapping_ )
162 mapping_ = other.mapping_;
166 operator bool ()
const {
return bool( mapping_ ); }
168 bool affine ()
const {
return mapping_->affine(); }
171 int corners ()
const {
return mapping_->corners(); }
187 void destroyMapping ()
189 mapping_->~Mapping();
190 grid().deallocateStorage( mapping_,
sizeof( Mapping ) );
204 namespace FacadeOptions
207 template<
int mydim,
int cdim,
class Gr
id >
210 static const bool v =
false;
217 #endif // #ifndef DUNE_GEOGRID_GEOMETRY_HH