4 #ifndef DUNE_GENERICGEOMETRY_GEOMETRY_HH
5 #define DUNE_GENERICGEOMETRY_GEOMETRY_HH
7 #warning This header and the code it contains is deprecated. If you need functionality \
8 similar to BasicGeometry, please use the MultiLinearGeometry class.
10 #include <dune/common/typetraits.hh>
11 #include <dune/common/nullptr.hh>
19 namespace GenericGeometry
251 template<
int mydim,
class Traits >
254 typedef typename Traits :: CoordTraits CoordTraits;
277 dune_static_assert( (0 <=
mydimension),
"Geometry dimension must be nonnegative." );
288 static const int topologyId = Traits::template hasSingleGeometryType< mydimension >::topologyId;
293 static const bool hybrid = !Traits::template hasSingleGeometryType< mydimension >::v;
296 typedef typename conditional< hybrid, Hybrid< true >, NonHybrid< false > >::type::MappingFactory
MappingFactory;
297 typedef typename MappingFactory::Mapping
Mapping;
311 typedef typename Mapping::JacobianInverseTransposed
Jacobian;
319 : mapping_( nullptr )
323 template<
class CoordVector >
326 assert(type.
dim() == mydim);
327 mapping_ = MappingFactory::construct( type.
id(), coords, mappingStorage_ );
333 template<
class CoordVector >
338 mapping_ = MappingFactory::construct( type.
id(), coords, mappingStorage_ );
354 template<
int fatherdim >
357 const unsigned int codim = fatherdim - mydim;
358 mapping_ = father.mapping_->template trace< codim >( i, mappingStorage_ );
363 : mapping_( other.mapping_ ? other.mapping_->clone( mappingStorage_ ) : nullptr )
370 mapping_->~Mapping();
377 mapping_->~Mapping();
378 mapping_ = (other.mapping_) ? other.mapping_->clone( mappingStorage_ ) :
nullptr;
389 operator bool ()
const
391 return bool( mapping_ );
397 return mapping_->type();
403 return mapping_->numCorners();
409 return mapping_->corner( i );
415 return mapping_->global( local );
421 return mapping_->local( global );
427 return mapping_->center();
433 return mapping_->affine();
439 return mapping_->integrationElement( local );
445 return mapping_->volume();
454 return mapping_->jacobianTransposed( local );
461 return mapping_->jacobianInverseTransposed( local );
474 char mappingStorage_[ MappingFactory::maxMappingSize ];
494 template<
int mydim,
int cdim,
class Gr
id >
496 :
public BasicGeometry< mydim, GlobalGeometryTraits< Grid > >
509 template<
class Geo >
515 template<
class CoordVector >
517 :
Base( type, coords )
521 template<
int fatherdim >
544 template<
int mydim,
int cdim,
class Gr
id >
555 template<
class Geo >
561 template<
class CoordVector >
563 :
Base( type, coords )
567 template<
int fatherdim >
577 #endif // #ifndef DUNE_GENERICGEOMETRY_GEOMETRY_HH
BasicGeometry(const CoordVector &coords)
Constructor using a vector of corner coordinates and the dimension.
Definition: geometry.hh:334
FieldVector< ctype, coorddimension > GlobalCoordinate
Type used for world coordinates.
Definition: geometry.hh:274
generic implementation of a DUNE (global) geometry
Definition: geometry.hh:495
BasicGeometry(const BasicGeometry &other)
Copy constructor.
Definition: geometry.hh:362
Geometry()
Definition: geometry.hh:505
~BasicGeometry()
Destructor.
Definition: geometry.hh:367
Mapping::JacobianInverseTransposed Jacobian
Type used for Jacobian matrices.
Definition: geometry.hh:311
ctype volume() const
Return the volume of the element.
Definition: geometry.hh:443
conditional< hybrid, Hybrid< true >, NonHybrid< false > >::type::MappingFactory MappingFactory
Definition: geometry.hh:296
conditional< isPrism, Prism< true >, Pyramid< false > >::type::type type
Definition: topologytypes.hh:295
Base::Mapping Mapping
Definition: geometry.hh:501
const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) const
Compute the transpose of the Jacobian matrix of the transformation from the reference element into th...
Definition: geometry.hh:452
GeometryType type() const
Return the topological type of this geometry.
Definition: geometry.hh:395
Mapping::JacobianTransposed JacobianTransposed
Type used for Jacobian matrices.
Definition: geometry.hh:305
FieldVector< ctype, mydimension > LocalCoordinate
Type used for parameter coordinates.
Definition: geometry.hh:271
LocalGeometry(const Geo &geo)
Copy constructor from another geometry.
Definition: geometry.hh:556
MappingFactory::Mapping Mapping
Definition: geometry.hh:297
BasicGeometry()
Default constructor.
Definition: geometry.hh:318
generic implementation of a DUNE (local) geometry
Definition: geometry.hh:545
GlobalCoordinate center() const
return center of element
Definition: geometry.hh:425
Base::Mapping Mapping
Definition: geometry.hh:551
void makeFromVertices(unsigned int dim, unsigned int vertices)
Construct the correct geometry type given the dimension and the number of vertices.
Definition: type.hh:218
Geometry(const GeometryType &type, const CoordVector &coords)
Constructor with a GeometryType and a set of coordinates.
Definition: geometry.hh:516
unsigned int id() const
Return the topology id the type.
Definition: type.hh:327
GlobalCoordinate corner(const int i) const
Return the world coordinates of the i-th corner.
Definition: geometry.hh:407
Geometry(const Geo &geo)
Copy constructor from another geometry.
Definition: geometry.hh:510
LocalGeometry(const Geometry< fatherdim, cdim, Grid > &father, int i)
Definition: geometry.hh:568
Definition: mappingprovider.hh:23
const BasicGeometry & operator=(const BasicGeometry &other)
Assignment from other BasicGeometry.
Definition: geometry.hh:374
BasicGeometry(const BasicGeometry< fatherdim, Traits > &father, int i)
obtain a geometry for a subentity
Definition: geometry.hh:355
unsigned int dim() const
Return dimension of the type.
Definition: type.hh:322
ctype integrationElement(const LocalCoordinate &local) const
Return the factor $|det F|$ that appears in the integral transformation formula.
Definition: geometry.hh:437
interface for a mapping
Definition: mapping.hh:30
Jacobian JacobianInverseTransposed
Definition: geometry.hh:313
BasicGeometry(const GeometryType &type, const CoordVector &coords)
Constructor using a GeometryType and a list of corner coordinates.
Definition: geometry.hh:324
LocalGeometry(const GeometryType &type, const CoordVector &coords)
Constructor with a GeometryType and a set of coordinates.
Definition: geometry.hh:562
ct ctype
Definition: geometrytraits.hh:21
generic implementation of DUNE geometries
Definition: geometry.hh:252
static const int coorddimension
The dimension of the world space of this geometry.
Definition: geometry.hh:265
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:24
GlobalCoordinate global(const LocalCoordinate &local) const
Map local to global coordinates.
Definition: geometry.hh:413
const JacobianInverseTransposed & jacobianInverseTransposed(const LocalCoordinate &local) const
Compute the transpose of the inverse Jacobian matrix of the transformation from the reference element...
Definition: geometry.hh:459
int corners() const
Return the number of corners.
Definition: geometry.hh:401
LocalCoordinate local(const GlobalCoordinate &global) const
Map global to local coordinates.
Definition: geometry.hh:419
Definition: mappingprovider.hh:53
CoordTraits::ctype ctype
Type used for coordinate components.
Definition: geometry.hh:268
static const int mydimension
The dimension of the parameter space of this geometry.
Definition: geometry.hh:262
bool affine() const
Return true if this is an affine geometry.
Definition: geometry.hh:431
Geometry(const Geometry< fatherdim, cdim, Grid > &father, int i)
Definition: geometry.hh:522
Definition: topologytypes.hh:271