Dune Core Modules (2.3.1)

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.
 
typedef FieldVector< ctype, mydimensionLocalCoordinate
 Type used for parameter coordinates.
 
typedef FieldVector< ctype, coorddimensionGlobalCoordinate
 Type used for world coordinates.
 
typedef Mapping::JacobianTransposed JacobianTransposed
 Type used for Jacobian matrices. More...
 
typedef Mapping::JacobianInverseTransposed Jacobian
 Type used for Jacobian matrices. More...
 

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<class CoordVector >
 BasicGeometry (const CoordVector &coords)
 Constructor using a vector of corner coordinates and the dimension. 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.
 
 ~BasicGeometry ()
 Destructor.
 
const BasicGeometryoperator= (const BasicGeometry &other)
 Assignment from other BasicGeometry.
 
 operator bool () const
 bool cast More...
 
GeometryType type () const
 Return the topological type of this geometry.
 
int corners () const
 Return the number of corners.
 
GlobalCoordinate corner (const int i) const
 Return the world coordinates of the i-th corner.
 
GlobalCoordinate global (const LocalCoordinate &local) const
 Map local to global coordinates.
 
 LocalCoordinate (const GlobalCoordinate &global) const
 Map global to local coordinates.
 
GlobalCoordinate center () const
 return center of element
 
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 JacobianTransposedjacobianTransposed (const LocalCoordinate &local) const
 Compute the transpose of the Jacobian matrix of the transformation from the reference element into the world space.
 
const JacobianInverseTransposed & jacobianInverseTransposed (const LocalCoordinate &local) const
 Compute the transpose of the inverse Jacobian matrix of the transformation from the reference element into the world space.
 

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.
 

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. As a default traits class, the class DefaultGeometryTraits can be used. Alternatively, the user can provide hand-written traits classes (which may, if that helps, derive from DefaultGeometryTraits). Such classes have to provide the following fields:

template< My_Template_Parameters >
struct MyGeometryTraits
{
// ctype is the type used for coordinate coefficients
typedef DuneCoordTraits< ctype > CoordTraits;
// Dimension of the space the geometry maps into
static const int dimWorld = ...;
// hybrid [ true if reference element type is a run-time parameter ]
static const bool hybrid = ...;
// topologyId [ reference element type, only needed if it is not a run-time parameter ]
// In this example: a dim-dimensional simplex
// static const unsigned int topologyId = SimplexTopology< dim >::type::id;
// explained below
template< class Topology >
struct Mapping
{
};
// Caching behavior
struct Caching
{
static const EvaluationType evaluateJacobianTransposed = ComputeOnDemand;
static const EvaluationType evaluateJacobianInverseTransposed = ComputeOnDemand;
static const EvaluationType evaluateIntegrationElement = ComputeOnDemand;
};
};
GeometryType type() const
Return the topological type of this geometry.
Definition: geometry.hh:395
implementation of GenericGeometry::Mapping for first order lagrange type reference mappings.
Definition: cornermapping.hh:528

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:

  • ComputeOnDemand: use caching if method called using barycenter
  • PreCompute: use caching in constructor using barycenter
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

◆ Jacobian

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.

◆ JacobianTransposed

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.

Constructor & Destructor Documentation

◆ BasicGeometry() [1/2]

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

Constructor using a vector of corner coordinates and the dimension.

Note
the geometry type is guessed from the number of vertices, thus this will only work up to dim 3

References Dune::GeometryType::id(), Dune::GeometryType::makeFromVertices(), and Dune::GenericGeometry::BasicGeometry< mydim, Traits >::type().

◆ BasicGeometry() [2/2]

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)

Member Function Documentation

◆ operator bool()

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.


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)