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
247 template<
int mydim,
class Traits >
250 typedef typename Traits :: CoordTraits CoordTraits;
252 static const int dimGrid = Traits :: dimGrid;
276 "Invalid geometry dimension." );
278 static const int codimension = dimGrid -
mydimension;
293 typedef typename SelectType< Traits::hybrid, Hybrid< true >, NonHybrid< false > >::Type::Mapping
295 typedef GenericGeometry::MappingProvider< ElementMapping, codimension > MappingProvider;
298 typedef typename MappingProvider::Mapping
Mapping;
312 typedef typename Mapping::JacobianInverseTransposed
Jacobian;
320 : mapping_( nullptr )
328 template<
class CoordVector >
331 mapping_ = MappingProvider::construct( topologyId, coords, mappingStorage_ );
343 template<
class CoordVector >
346 mapping_ = MappingProvider::construct( topologyId, coords, affine, mappingStorage_ );
350 template<
class CoordVector >
353 mapping_ = MappingProvider::construct( type.
id(), coords, mappingStorage_ );
369 template<
int fatherdim >
372 const unsigned int codim = fatherdim - mydim;
373 mapping_ = father.mapping_->template trace< codim >( i, mappingStorage_ );
378 : mapping_( other.mapping_ ? other.mapping_->clone( mappingStorage_ ) : nullptr )
385 mapping_->~Mapping();
392 mapping_->~Mapping();
393 mapping_ = (other.mapping_) ? other.mapping_->clone( mappingStorage_ ) :
nullptr;
404 operator bool ()
const
406 return bool( mapping_ );
412 return mapping_->type();
418 return mapping_->numCorners();
424 return mapping_->corner( i );
430 return mapping_->global( local );
436 return mapping_->local( global );
442 return mapping_->center();
448 return mapping_->affine();
454 return mapping_->integrationElement( local );
460 return mapping_->volume();
469 return mapping_->jacobianTransposed( local );
476 return mapping_->jacobianInverseTransposed( local );
489 char mappingStorage_[ MappingProvider::maxMappingSize ];
509 template<
int mydim,
int cdim,
class Gr
id >
511 :
public BasicGeometry< mydim, GlobalGeometryTraits< Grid > >
523 template<
class CoordVector >
525 :
Base( topologyId, coords )
528 template<
class CoordVector >
530 :
Base( topologyId, coords, affine )
534 template<
class Geo >
540 template<
class CoordVector >
542 :
Base( type, coords )
546 template<
int fatherdim >
569 template<
int mydim,
int cdim,
class Gr
id >
579 template<
class CoordVector >
581 :
Base( topologyId, coords )
584 template<
class CoordVector >
586 :
Base( topologyId, coords, affine )
590 template<
class Geo >
596 template<
class CoordVector >
598 :
Base( type, coords )
602 template<
int fatherdim >
612 #endif // #ifndef DUNE_GENERICGEOMETRY_GEOMETRY_HH