dune-geometry  2.2.1
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Types | Friends | List of all members
Dune::GenericGeometry::BasicGeometry< mydim, Traits > Class Template Reference

generic implementation of DUNE geometries More...

#include <dune/geometry/genericgeometry/geometry.hh>

Public Types

typedef CoordTraits::ctype ctype
 Type used for coordinate components. More...
 
typedef FieldVector< ctype,
mydimension
LocalCoordinate
 Type used for parameter coordinates. More...
 
typedef FieldVector< ctype,
coorddimension
GlobalCoordinate
 Type used for world coordinates. More...
 
typedef Mapping::JacobianTransposed JacobianTransposed
 Type used for Jacobian matrices. More...
 
typedef
Mapping::JacobianInverseTransposed 
Jacobian
 Type used for Jacobian matrices. More...
 
typedef Jacobian JacobianInverseTransposed
 

Public Member Functions

 BasicGeometry ()
 Default constructor. More...
 
template<class CoordVector >
 BasicGeometry (const unsigned int topologyId, const CoordVector &coords)
 constructor More...
 
template<class CoordVector >
 BasicGeometry (const unsigned int topologyId, const CoordVector &coords, const bool affine)
 constructor More...
 
template<class CoordVector >
 BasicGeometry (const GeometryType &type, const CoordVector &coords)
 Constructor using a GeometryType and a list of corner coordinates. More...
 
template<int fatherdim>
 BasicGeometry (const BasicGeometry< fatherdim, Traits > &father, int i)
 obtain a geometry for a subentity More...
 
 BasicGeometry (const BasicGeometry &other)
 Copy constructor. More...
 
 ~BasicGeometry ()
 Destructor. More...
 
const BasicGeometryoperator= (const BasicGeometry &other)
 Assignment from other BasicGeometry. More...
 
 operator bool () const
 bool cast More...
 
GeometryType type () const
 Return the topological type of this geometry. More...
 
int corners () const
 Return the number of corners. More...
 
GlobalCoordinate corner (const int i) const
 Return the world coordinates of the i-th corner. More...
 
GlobalCoordinate global (const LocalCoordinate &local) const
 Map local to global coordinates. More...
 
LocalCoordinate local (const GlobalCoordinate &global) const
 Map global to local coordinates. More...
 
GlobalCoordinate center () const
 return center of element More...
 
bool affine () const
 Return true if this is an affine geometry. More...
 
ctype integrationElement (const LocalCoordinate &local) const
 Return the factor $|det F|$ that appears in the integral transformation formula. More...
 
ctype volume () const
 Return the volume of the element. More...
 
const JacobianTransposedjacobianTransposed (const LocalCoordinate &local) const
 Compute the transpose of the Jacobian matrix of the transformation from the reference element into the world space. More...
 
const JacobianInverseTransposedjacobianInverseTransposed (const LocalCoordinate &local) const
 Compute the transpose of the inverse Jacobian matrix of the transformation from the reference element into the world space. More...
 

Static Public Attributes

static const int mydimension = mydim
 The dimension of the parameter space of this geometry. More...
 
static const int coorddimension = Traits :: dimWorld
 The dimension of the world space of this geometry. More...
 

Protected Types

typedef MappingProvider::Mapping Mapping
 

Friends

template<int , class >
class BasicGeometry
 Be friend with other instantiations of the same class. More...
 

Detailed Description

template<int mydim, class Traits>
class Dune::GenericGeometry::BasicGeometry< mydim, Traits >

generic implementation of DUNE geometries

This class is provides a generic implementation of a DUNE geometry.

Parameters shared by all codimensions are summarized in 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;
// topologyId [ for Codim 0, needed for (hybrid=false) ]
// static const unsigned int topologyId = SimplexTopology< dimGrid >::type::id;
// explained below
template< class Topology >
struct Mapping
{
typedef CornerMapping< CoordTraits, Topology, dimWorld > 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 central reference mapping specified by Traits::Mapping::type requires a constructor taking a single argument. The GenericGeometry::BasicGeometry has a constructor with one template argument which is passed on to the constructor of the 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:

Note
This class cannot be used directly as an implementation of Dune::Geometry. Its template parameter list differs from what is expected there from the engine. One of the following derived classes can be used instead:

Member Typedef Documentation

template<int mydim, class Traits>
typedef CoordTraits :: ctype Dune::GenericGeometry::BasicGeometry< mydim, Traits >::ctype

Type used for coordinate components.

template<int mydim, class Traits>
typedef FieldVector< ctype, coorddimension > Dune::GenericGeometry::BasicGeometry< mydim, Traits >::GlobalCoordinate

Type used for world coordinates.

template<int mydim, class Traits>
typedef Mapping::JacobianInverseTransposed Dune::GenericGeometry::BasicGeometry< mydim, Traits >::Jacobian

Type used for Jacobian matrices.

Note
This is not a FieldMatrix but a proxy type that can be assigned to a FieldMatrix.
template<int mydim, class Traits>
typedef Jacobian Dune::GenericGeometry::BasicGeometry< mydim, Traits >::JacobianInverseTransposed
template<int mydim, class Traits>
typedef Mapping::JacobianTransposed Dune::GenericGeometry::BasicGeometry< mydim, Traits >::JacobianTransposed

Type used for Jacobian matrices.

Note
This is not a FieldMatrix but a proxy type that can be assigned to a FieldMatrix.
template<int mydim, class Traits>
typedef FieldVector< ctype, mydimension > Dune::GenericGeometry::BasicGeometry< mydim, Traits >::LocalCoordinate

Type used for parameter coordinates.

template<int mydim, class Traits>
typedef MappingProvider::Mapping Dune::GenericGeometry::BasicGeometry< mydim, Traits >::Mapping
protected

Constructor & Destructor Documentation

template<int mydim, class Traits>
Dune::GenericGeometry::BasicGeometry< mydim, Traits >::BasicGeometry ( )
inline

Default constructor.

template<int mydim, class Traits>
template<class CoordVector >
Dune::GenericGeometry::BasicGeometry< mydim, Traits >::BasicGeometry ( const unsigned int  topologyId,
const CoordVector &  coords 
)
inline

constructor

Parameters
[in]topologyIdtopology id of the desired geometry
[in]coordscoordinates
Deprecated:
template<int mydim, class Traits>
template<class CoordVector >
Dune::GenericGeometry::BasicGeometry< mydim, Traits >::BasicGeometry ( const unsigned int  topologyId,
const CoordVector &  coords,
const bool  affine 
)
inline

constructor

Parameters
[in]topologyIdtopology id of the desired geometry
[in]coordscoordinates
[in]affineflag whether the mapping is affine
Note
It is assume that the flag affine is true if and only if the mapping is affine.
Deprecated:
template<int mydim, class Traits>
template<class CoordVector >
Dune::GenericGeometry::BasicGeometry< mydim, Traits >::BasicGeometry ( const GeometryType type,
const CoordVector &  coords 
)
inline

Constructor using a GeometryType and a list of corner coordinates.

template<int mydim, class Traits>
template<int fatherdim>
Dune::GenericGeometry::BasicGeometry< mydim, Traits >::BasicGeometry ( const BasicGeometry< fatherdim, Traits > &  father,
int  i 
)
inline

obtain a geometry for a subentity

Assume that we have a geometry for some entity d-dimensional E. This method can provide a geometry for the i-th subentity of E (of codimension d - mydimension).

Note
This method can be more efficient than just building up the geometry for the subentity. For example, the subgeometry automatically inherits affinity.
Parameters
[in]fathergeometry of entity E
[in]inumber of the subentity (in generic numbering)
template<int mydim, class Traits>
Dune::GenericGeometry::BasicGeometry< mydim, Traits >::BasicGeometry ( const BasicGeometry< mydim, Traits > &  other)
inline

Copy constructor.

template<int mydim, class Traits>
Dune::GenericGeometry::BasicGeometry< mydim, Traits >::~BasicGeometry ( )
inline

Destructor.

Member Function Documentation

template<int mydim, class Traits>
bool Dune::GenericGeometry::BasicGeometry< mydim, Traits >::affine ( ) const
inline

Return true if this is an affine geometry.

template<int mydim, class Traits>
GlobalCoordinate Dune::GenericGeometry::BasicGeometry< mydim, Traits >::center ( ) const
inline

return center of element

template<int mydim, class Traits>
GlobalCoordinate Dune::GenericGeometry::BasicGeometry< mydim, Traits >::corner ( const int  i) const
inline

Return the world coordinates of the i-th corner.

template<int mydim, class Traits>
int Dune::GenericGeometry::BasicGeometry< mydim, Traits >::corners ( ) const
inline

Return the number of corners.

template<int mydim, class Traits>
GlobalCoordinate Dune::GenericGeometry::BasicGeometry< mydim, Traits >::global ( const LocalCoordinate local) const
inline

Map local to global coordinates.

template<int mydim, class Traits>
ctype Dune::GenericGeometry::BasicGeometry< mydim, Traits >::integrationElement ( const LocalCoordinate local) const
inline

Return the factor $|det F|$ that appears in the integral transformation formula.

template<int mydim, class Traits>
const JacobianInverseTransposed& Dune::GenericGeometry::BasicGeometry< mydim, Traits >::jacobianInverseTransposed ( const LocalCoordinate local) const
inline

Compute the transpose of the inverse Jacobian matrix of the transformation from the reference element into the world space.

Referenced by Dune::MockGeometry< ctype, mydim, coorddim >::jacobianInverseTransposed().

template<int mydim, class Traits>
const JacobianTransposed& Dune::GenericGeometry::BasicGeometry< mydim, Traits >::jacobianTransposed ( const LocalCoordinate local) const
inline

Compute the transpose of the Jacobian matrix of the transformation from the reference element into the world space.

Referenced by Dune::MockGeometry< ctype, mydim, coorddim >::jacobianTransposed().

template<int mydim, class Traits>
LocalCoordinate Dune::GenericGeometry::BasicGeometry< mydim, Traits >::local ( const GlobalCoordinate global) const
inline

Map global to local coordinates.

template<int mydim, class Traits>
Dune::GenericGeometry::BasicGeometry< mydim, Traits >::operator bool ( ) const
inline

bool cast

Like a pointer, a BasicGeometry casts to true if and only if it is properly initialized. If a geometry casts to false, none of the interface methods may be called.

template<int mydim, class Traits>
const BasicGeometry& Dune::GenericGeometry::BasicGeometry< mydim, Traits >::operator= ( const BasicGeometry< mydim, Traits > &  other)
inline

Assignment from other BasicGeometry.

template<int mydim, class Traits>
GeometryType Dune::GenericGeometry::BasicGeometry< mydim, Traits >::type ( ) const
inline

Return the topological type of this geometry.

template<int mydim, class Traits>
ctype Dune::GenericGeometry::BasicGeometry< mydim, Traits >::volume ( ) const
inline

Return the volume of the element.

Friends And Related Function Documentation

template<int mydim, class Traits>
template<int , class >
friend class BasicGeometry
friend

Be friend with other instantiations of the same class.

Member Data Documentation

template<int mydim, class Traits>
const int Dune::GenericGeometry::BasicGeometry< mydim, Traits >::coorddimension = Traits :: dimWorld
static

The dimension of the world space of this geometry.

template<int mydim, class Traits>
const int Dune::GenericGeometry::BasicGeometry< mydim, Traits >::mydimension = mydim
static

The dimension of the parameter space of this geometry.


The documentation for this class was generated from the following file: