Dune::Geometry< mydim, cdim, GridImp, GeometryImp > Class Template Reference
[Geometry]

#include <geometry.hh>

List of all members.


Detailed Description

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
class Dune::Geometry< mydim, cdim, GridImp, GeometryImp >

Wrapper class for geometries.

Template parameters are:

Maps

A Geometry defines a map

\[ g : D \to W\]

where $D\subseteq\mathbf{R}^\textrm{mydim}$ and $W\subseteq\mathbf{R}^\textrm{cdim}$. The domain $D$ is one of a set of predefined convex polytopes, the so-called reference elements (see also Dune::ReferenceElement). The dimensionality of $D$ is mydim. In general $\textrm{mydim}\leq\textrm{cdim}$, i.e. the convex polytope may be mapped to a manifold. Moreover, we require that $ g\in \left( C^1(D) \right)^\textrm{cdim}$ and one-to-one.

Engine Concept

The Geometry class template wraps an object of type GeometryImp and forwards all member function calls to corresponding members of this class. In that sense Geometry defines the interface and GeometryImp supplies the implementation.


Public Types

enum  { dimension = GridImp::dimension }
 export grid dimension More...
enum  { mydimension = mydim }
 export geometry dimension More...
enum  { coorddimension = cdim }
 export coordinate dimension More...
enum  { dimensionworld = GridImp::dimensionworld }
 export dimension of world More...
typedef ct ctype
 define type used for coordinates in grid module

Public Member Functions

GeometryType type () const
 Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
int corners () const
 Return the number of corners of the reference element. Since this is a convex polytope the number of corners is a well-defined concept. The method is redundant because this information is also available via the reference element. It is here for efficiency and ease of use.
const FieldVector< ct, cdim > & operator[] (int i) const
 Access to corners of the geometry.
FieldVector< ct, cdim > global (const FieldVector< ct, mydim > &local) const
 Evaluate the map $ g$.
FieldVector< ct, mydim > local (const FieldVector< ct, cdim > &global) const
 Evaluate the inverse map $ g^{-1}$.
bool checkInside (const FieldVector< ct, mydim > &local) const
 Return true if the point is in the reference element $D$ of the map.
ct integrationElement (const FieldVector< ct, mydim > &local) const
 Return the factor appearing in the integral transformation formula.
ct volume () const
 return volume of geometry
const FieldMatrix< ct, mydim,
mydim > & 
jacobianInverseTransposed (const FieldVector< ct, mydim > &local) const
 Return inverse of transposed of Jacobian.
 Geometry (const GeometryImp< mydim, cdim, GridImp > &e)
 copy constructor from GeometryImp

Protected Member Functions

GeometryImp< mydim, cdim,
GridImp > & 
getRealImp ()
 return reference to the real implementation
const GeometryImp< mydim,
cdim, GridImp > & 
getRealImp () const
 return reference to the real implementation
 Geometry (const Geometry &rhs)
Geometryoperator= (const Geometry &rhs)

Member Enumeration Documentation

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
anonymous enum

export grid dimension

Enumerator:
dimension  grid dimension

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
anonymous enum

export geometry dimension

Enumerator:
mydimension  geometry dimension

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
anonymous enum

export coordinate dimension

Enumerator:
coorddimension  dimension of embedding coordsystem

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
anonymous enum

export dimension of world

Enumerator:
dimensionworld  dimension of world


Constructor & Destructor Documentation

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
Dune::Geometry< mydim, cdim, GridImp, GeometryImp >::Geometry ( const Geometry< mydim, cdim, GridImp, GeometryImp > &  rhs  )  [inline, protected]

hide copy constructor


Member Function Documentation

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
const FieldVector<ct, cdim>& Dune::Geometry< mydim, cdim, GridImp, GeometryImp >::operator[] ( int  i  )  const [inline]

Access to corners of the geometry.

Parameters:
[in] i The number of the corner
Returns:
const reference to a vector containing the position $g(c_i)$ where $c_i$ is the position of the i'th corner of the reference element.

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
FieldVector<ct, cdim> Dune::Geometry< mydim, cdim, GridImp, GeometryImp >::global ( const FieldVector< ct, mydim > &  local  )  const [inline]

Evaluate the map $ g$.

Parameters:
[in] local Position in the reference element $D$
Returns:
Position in $W$

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
FieldVector<ct, mydim> Dune::Geometry< mydim, cdim, GridImp, GeometryImp >::local ( const FieldVector< ct, cdim > &  global  )  const [inline]

Evaluate the inverse map $ g^{-1}$.

Parameters:
[in] global Position in $W$
Returns:
Position in $D$ that maps to global

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
ct Dune::Geometry< mydim, cdim, GridImp, GeometryImp >::integrationElement ( const FieldVector< ct, mydim > &  local  )  const [inline]

Return the factor appearing in the integral transformation formula.

Let $ g : D \to W$ denote the transformation described by the Geometry. Then the jacobian of the transformation is defined as the $\textrm{cdim}\times\textrm{mydim}$ matrix

\[ J_g(x) = \left( \begin{array}{ccc} \frac{\partial g_0}{\partial x_0} & \cdots & \frac{\partial g_0}{\partial x_{n-1}} \\ \vdots & \ddots & \vdots \\ \frac{\partial g_{m-1}}{\partial x_0} & \cdots & \frac{\partial g_{m-1}}{\partial x_{n-1}} \end{array} \right).\]

Here we abbreviated $m=\textrm{cdim}$ and $n=\textrm{mydim}$ for ease of readability.

The integration element $\mu(x)$ for any $x\in D$ is then defined as

\[ \mu(x) = \sqrt{|\det J_g^T(x)J_g(x)|}.\]

Parameters:
[in] local Position $x\in D$
Returns:
integration element $\mu(x)$
Note:
Each implementation computes the integration element with optimal efficieny. For example in an equidistant structured mesh it may be as simple as $h^\textrm{mydim}$.

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
const FieldMatrix<ct,mydim,mydim>& Dune::Geometry< mydim, cdim, GridImp, GeometryImp >::jacobianInverseTransposed ( const FieldVector< ct, mydim > &  local  )  const [inline]

Return inverse of transposed of Jacobian.

The jacobian is defined in the documentation of Dune::Geometry::integrationElement().

Parameters:
[in] local Position $x\in D$
Returns:
$J_g^{-T}(x)$
The use of this function is to compute the gradient of some function $ f : W \to \textbf{R} $ at some position $y=g(x)$ with $x\in D$ and $g$ the transformation of the Geometry. When we set $\hat{f}(x) = f(g(x))$ and apply the chain rule we get

\[\nabla f (g(x)) = J_g^{-T}(x) \nabla \hat{f}(x). \]

Note:
This function may only be called in the case $\textrm{cdim}=\textrm{mydim}$ because otherwise the inverse is not defined.

template<int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp>
Geometry& Dune::Geometry< mydim, cdim, GridImp, GeometryImp >::operator= ( const Geometry< mydim, cdim, GridImp, GeometryImp > &  rhs  )  [inline, protected]

hide assignment operator


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

Generated on 9 Apr 2008 with Doxygen (ver 1.5.2) [logfile].