Dune Core Modules (2.3.1)

GenericGeometry

Classes

class  Dune::GenericGeometry::BasicGeometry< mydim, Traits >
 generic implementation of DUNE geometries More...
 
struct  Dune::GenericGeometry::MappingTraits< CT, dim, dimW >
 Default mapping traits using Dune::FieldVector and Dune::FieldMatrix. More...
 
struct  Dune::GenericGeometry::DefaultGeometryTraits< ctype, dimG, dimW, alwaysAffine >
 default settings for BasicGeometry More...
 
class  Dune::GenericGeometry::DuneGeometryType< Topology, linetype >
 statically convert a generic topology type into a GeometryType More...
 
class  Dune::GenericGeometry::CornerMapping< CoordTraits, Topo, dimW, CStorage, affine >
 implementation of GenericGeometry::Mapping for first order lagrange type reference mappings. More...
 
class  Dune::GenericGeometry::Geometry< mydim, cdim, Grid >
 generic implementation of a DUNE (global) geometry More...
 
class  Dune::GenericGeometry::LocalGeometry< mydim, cdim, Grid >
 generic implementation of a DUNE (local) geometry More...
 
struct  Dune::GenericGeometry::GlobalGeometryTraits< Grid >
 grid specific information required by GenericGeometry::Geometry More...
 
struct  Dune::GenericGeometry::LocalGeometryTraits< Grid >
 grid specific information required by GenericGeometry::LocalGeometry More...
 
class  Dune::GenericGeometry::HybridMapping< dim, GeometryTraits >
 abstract base class for generic mapping More...
 
class  Dune::GenericGeometry::NonHybridMapping< Topology, GeometryTraits >
 non-virtual geometric mapping More...
 
class  Dune::GenericGeometry::Mapping< CoordTraits, Topo, dimW, Impl >
 interface for a mapping More...
 

Detailed Description

General

Based on a recursive definition of the reference elements, a generic implementation of Dune::Geometry is provided. The class used for the implementation of the Dune::Geometry engine is GenericGeometry::BasicGeometry.

The BasicGeometry class takes a template argument Traits specifying details of the reference mapping implementation and some performance settings. A default implementation for this class is GenericGeometry::DefaultGeometryTraits. The traits class must contain the same types as this default implementation.

To conform with the Dune::Geometry engine, two further classes are provided: GenericGeometry::Geometry and GenericGeometry::LocalGeometry. To use these classes instead of GenericGeometry::BasicGeometry, the traits classes

template< class Grid> GenericGeometry::GlobalGeometryTraits<Grid>
template< class Grid> GenericGeometry::LocalGeometryTraits<Grid>

have to be specialized. These classes are simply passed as Traits argument to GenericGeometry::BasicGeometry.

The reference mapping for a given topology type is given by Mapping<Topology>::type in the traits class. Here, Topology is one of the generic topology classes GenericGeometry::Point, GenericGeometry::Prism, GenericGeometry::Pyramid. An interface for the mapping is provided by GenericGeometry::Mapping. The implementation of this interface must have constructors taking a single argument. The constructor of GenericGeometry::BasicGeometry looks as follows:

template< class CoordVector >
BasicGeometry ( const GeometryType &type, const CoordVector &coords );

Its first argument, type, specifies the type of the reference element (as a Dune::GeometryType). The second argument, coords is passed directly to the constructor of the mapping implementation. The most prominent implementation of GenericGeometry::Mapping is GenericGeometry::CornerMapping. It provides a polynomial interpolation of the entity's corners with minimal degree. In this case, coords represents the entity's corners.

Usage

To add first order Lagrange type geometries to a grid implementation the following steps suffice:

  • Overload the traits classes
    template<>
    struct GenericGeometry::GlobalGeometryTraits< MyGrid >
    : public GenericGeometry::DefaultGeometryTraits
    <MyGrid::ctype,MyGrid::dimension,MyGrid::dimworld>
    {};
    template<>
    struct GenericGeometry::LocalGeometryTraits< MyGrid >
    : public GenericGeometry::DefaultGeometryTraits
    <MyGrid::ctype,MyGrid::dimension,MyGrid::dimworld>
    {};
    Note that these classes are default implementations which should cover all cases but are in a specific situation far from the optimal choice. For example, an increase in efficiency can be achieved for grids with a fixed element type (set hybrid to false and set the topologyId variable) or for grids with only affine transformations - which in the case of the local geometries is often true - the last template argument (default false) can be used to switch to mappings which are assumed to always be affine (no checking done).
  • Add to the GridFamily::Traits::Codim<codim> structure:
    typedef Dune :: Geometry
    < dimension-codim, dimensionworld, const MyGrid,
    Dune :: GenericGeometry :: Geometry > Geometry;
    typedef Dune :: Geometry
    < dimension-codim, dimension, const MyGrid,
    Dune :: GenericGeometry :: LocalGeometry > LocalGeometry;
  • Both geometries can be build by calling the constructor taking a DUNE grid type and an instance of an arbitrary class with a method
    const FieldVector< ctype, dimensionworld >& operator[](unsigned int i);
    The references returned must remain valid during the whole life span of the geometry.
  • In MyGrid::Entity<0> the following methods can then be easily implemented:
    • geometry(): this requires the knowledge of the dune geometry type of the entity and the coordinates of the corner points.
    • geometryInFather(): The corner points for each child in the reference element of the father can be used to construct the local geometry - note that this geometry is mostly affine and these geometries can be precomputed and stored.
  • For the Dune::Intersection class the geometries the following implementations for the geometries can be used:
    • intersectionGlobal(): can be implemented in the same way as the geometry of the entity using the coordinates of the corners of the intersection. Alternatively, in the case of a conform intersection, the class GenericGeometry::Geometry provides a possibility to construct traces of a given geometry, e.g., a reference mapping restricted to a codimension one subentities of the reference element. This is achieved by calling the constructor on the GenericGeometry::Geometry class (with the codim template equal to one) passing a codimension zero geometry implementation and the number of the codimension one subentity.
      GenericGeometry::Geometry<myGridDim-1,myWorldDim,MyGrid>
      (inside->geometry(),numberInSelf());
    • intersectionInSelf()/intersectionInNeighbor(): A similar strategy as described above for the intersectionGlobal can also be used for the geometry mapping to the codimension zero reference element. Either the corners of the intersection in local coordinates can be used in the construction of the local geometries, or (for conform intersections) the traces can be used, passing an identity mapping as codimension zero geometry. The GenericGeometry::GenericReferenceElement provides these mappings directly via the template method GenericGeometry::GenericReferenceElement::mapping. The return value of this method can be directly used to construct a GenericGeometry::Geometry instance:
      typedef GenericReferenceElementContainer<ctype,myGridDim> RefElementContType;
      RefElementContType refElemCont;
      const RefElementContType::value_type& refElem=refElemCont(insideGeometryType);
      GenericGeometry::Geometry<myGridDim-1,myGridDim,MyGrid>(refElem.mapping(numberInSelf()));
    • integrationOuterNormal(): the generic geometry implementation provides a method to compute the integration outer normals, so that the following code fragment can be used:
      typedef typename Grid :: template Codim< 0 > :: Geometry Geometry;
      const Geometry &geo = inside()->geometry();
      FieldVector< ctype, dimension > x( intersectionSelfLocal().global( local ) );
      return Grid :: getRealImplementation( geo ).normal( numberInSelf(), x );
  • To add geometries for subentitiies of codim>0 given a entity en of codimension zero and the subentity number subNr :
    • geometry: the geometry can be constructed by the following line of code
      GenericGeometry::Geometry<myGridDim-codim,myWorldDim,MyGrid>
      (en.geometry(),subNr);
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Mar 27, 23:31, 2024)