4 #ifndef DUNE_GENERICGEOMETRY_GEOMETRY_HH
5 #define DUNE_GENERICGEOMETRY_GEOMETRY_HH
7 #include <dune/common/typetraits.hh>
8 #include <dune/common/nullptr.hh>
17 namespace GenericGeometry
245 template<
int mydim,
class Traits >
248 typedef typename Traits :: CoordTraits CoordTraits;
250 static const int dimGrid = Traits :: dimGrid;
274 "Invalid geometry dimension." );
276 static const int codimension = dimGrid -
mydimension;
291 typedef typename SelectType< Traits::hybrid, Hybrid< true >, NonHybrid< false > >::Type::Mapping
293 typedef GenericGeometry::MappingProvider< ElementMapping, 0 > MappingProvider;
296 typedef typename MappingProvider::Mapping
Mapping;
310 typedef typename Mapping::JacobianInverseTransposed
Jacobian;
318 : mapping_( nullptr )
326 template<
class CoordVector >
329 mapping_ = MappingProvider::construct( topologyId, coords, mappingStorage_ );
341 template<
class CoordVector >
344 mapping_ = MappingProvider::construct( topologyId, coords, affine, mappingStorage_ );
348 template<
class CoordVector >
351 mapping_ = MappingProvider::construct( type.
id(), coords, mappingStorage_ );
367 template<
int fatherdim >
370 const unsigned int codim = fatherdim - mydim;
371 mapping_ = father.mapping_->template trace< codim >( i, mappingStorage_ );
376 : mapping_( other.mapping_ ? other.mapping_->clone( mappingStorage_ ) : nullptr )
383 mapping_->~Mapping();
390 mapping_->~Mapping();
391 mapping_ = (other.mapping_) ? other.mapping_->clone( mappingStorage_ ) :
nullptr;
402 operator bool ()
const
404 return bool( mapping_ );
410 return mapping_->type();
416 return mapping_->numCorners();
422 return mapping_->corner( i );
428 return mapping_->global( local );
434 return mapping_->local( global );
440 return mapping_->center();
446 return mapping_->affine();
452 return mapping_->integrationElement( local );
458 return mapping_->volume();
467 return mapping_->jacobianTransposed( local );
474 return mapping_->jacobianInverseTransposed( local );
487 char mappingStorage_[ MappingProvider::maxMappingSize ];
507 template<
int mydim,
int cdim,
class Gr
id >
509 :
public BasicGeometry< mydim, GlobalGeometryTraits< Grid > >
521 template<
class CoordVector >
523 :
Base( topologyId, coords )
526 template<
class CoordVector >
528 :
Base( topologyId, coords, affine )
532 template<
class Geo >
538 template<
class CoordVector >
540 :
Base( type, coords )
544 template<
int fatherdim >
567 template<
int mydim,
int cdim,
class Gr
id >
577 template<
class CoordVector >
579 :
Base( topologyId, coords )
582 template<
class CoordVector >
584 :
Base( topologyId, coords, affine )
588 template<
class Geo >
594 template<
class CoordVector >
596 :
Base( type, coords )
600 template<
int fatherdim >
610 #endif // #ifndef DUNE_GENERICGEOMETRY_GEOMETRY_HH