#include <geometry.hh>
This class is provides a generic implementation of a DUNE geometry.
Parameters shared by all codimensions are summarized into one class parameter called Traits. The following default implementation can be used (via subclassing) to provide the necessary information. It contains exactly the required fields:
template< class ctype, int dimG, int dimW > struct DefaultGeometryTraits { typedef DuneCoordTraits< ctype > CoordTraits; static const int dimGrid = dimG; static const int dimWorld = dimW; // hybrid [ true if Codim 0 is hybrid ] static const bool hybrid = true; // dunetype [ for Codim 0, needed for (hybrid=false) ] // static const GeometryType :: BasicType dunetype = GeometryType :: simplex; // what basic geometry type shall the line be considered? static const GeometryType :: BasicType linetype = GeometryType :: simplex; // explained below template< class Topology > struct Mapping { typedef MappingTraits< CoordTraits, Topology :: dimension, dimWorld > Traits; typedef CoordPointerStorage< Topology, typename Traits :: GlobalCoordType > CornerStorage; typedef CornerMapping< Topology, Traits, CornerStorage > type; }; // explained below struct Caching { static const EvaluationType evaluateJacobianTransposed = ComputeOnDemand; static const EvaluationType evaluateJacobianInverseTransposed = ComputeOnDemand; static const EvaluationType evaluateIntegrationElement = ComputeOnDemand; static const EvaluationType evaluateNormal = ComputeOnDemand; }; };
The structure specifying the reference mapping is Traits::Mapping::type. An example implementation is the GenericGeometry::CornerMapping which defines the simple mapping taking corners of the reference elements to corner of the entity in space. The class given by Traits::Mapping::CornerStorage (an example is given by GenericGeometry::CoordPointerStorage). is a container for the coordinates of the corners returned by the Dune::Geometry (also required for non-linear reference mappings). The third type in Traits::Mapping is a traits class for the reference mapping, following the structure of GenericGeometry::MappingTraits.
The central reference mapping specified by Traits::Mapping::type requires a constructure taking a single argument. The GenericGeometry::BasicGeometry has a constructure with one template argument which is passed on to the constructure of the used provided reference mapping. The interface for the this class is GenericGeometry::Mapping.
To increase the efficiency of the geometry implementation, different strategies for the caching of parts of the geometry data is provided. The specifics are given by the structure Traits::Caching. Possible values are:
Public Types | |
typedef CoordTraits::ctype | ctype |
Type used for coordinate components. | |
typedef FieldVector< ctype, mydimension > | LocalCoordinate |
Type used for parameter coordinates. | |
typedef FieldVector< ctype, coorddimension > | GlobalCoordinate |
Type used for world coordinates. | |
typedef FieldMatrix< ctype, coorddimension, mydimension > | Jacobian |
Type used for Jacobian matrices. | |
Public Member Functions | |
BasicGeometry () | |
Default constructor. | |
template<class CoordVector> | |
BasicGeometry (const GeometryType &type, const CoordVector &coords) | |
Constructor using a GeometryType and a list of corner coordinates. | |
template<int fatherdim> | |
BasicGeometry (const BasicGeometry< fatherdim, Traits > &father, int i) | |
I don't understand what this is supposed to do. | |
BasicGeometry (const BasicGeometry &other) | |
Copy constructor. | |
~BasicGeometry () | |
Destructor. | |
BasicGeometry & | operator= (const BasicGeometry &other) |
Assignment from other BasicGeometry. | |
bool | operator! () const |
Test whether this BasicGeometry is properly set up. | |
GeometryType | type () const |
Return the topological type of this geometry. | |
int | corners () const |
Return the number of corners. | |
const GlobalCoordinate & | operator[] (int i) const |
Return the world coordinates of the i-th corner. | |
GlobalCoordinate | global (const LocalCoordinate &local) const |
Map local to global coordinates. | |
LocalCoordinate | local (const GlobalCoordinate &global) const |
Map global to local coordinates. | |
bool | checkInside (const LocalCoordinate &local) const |
Return true if a given point is within the parameter domain. | |
bool | affine () const |
Return true if this is an affine geometry. | |
ctype | integrationElement (const LocalCoordinate &local) const |
Return the factor $|det F|$ that appears in the integral transformation formula. | |
ctype | volume () const |
Return the volume of the element. | |
const Jacobian & | jacobianInverseTransposed (const LocalCoordinate &local) const |
Compute the transpose of the inverse Jacobian matrix of the transformation from the reference element into the world space. | |
GlobalCoordinate | normal (int face, const LocalCoordinate &local) const |
Compute a normal. | |
Static Public Attributes | |
static const int | mydimension = mydim |
The dimension of the parameter space of this geometry. | |
static const int | coorddimension = Traits :: dimWorld |
The dimension of the world space of this geometry. |
Dune::GenericGeometry::BasicGeometry< mydim, Traits >::BasicGeometry | ( | const BasicGeometry< fatherdim, Traits > & | father, | |
int | i | |||
) | [inline] |
bool Dune::GenericGeometry::BasicGeometry< mydim, Traits >::operator! | ( | ) | const [inline] |
GlobalCoordinate Dune::GenericGeometry::BasicGeometry< mydim, Traits >::normal | ( | int | face, | |
const LocalCoordinate & | local | |||
) | const [inline] |