dune-grid
2.1.1
|
#include <dune/grid/sgrid.hh>
Public Types | |
typedef GridImp::ctype | ctype |
define type used for coordinates in grid module | |
Public Member Functions | |
GeometryType | type () const |
return the element type identifier | |
bool | affine () const |
here we have always an affine geometry | |
int | corners () const |
return the number of corners of this element. Corners are numbered 0...n-1 | |
FieldVector< ctype, cdim > | corner (const int i) const |
return i'th corner of the geometry | |
FieldVector< ctype, cdim > | center () const |
return center of the geometry | |
FieldVector< ctype, cdim > | global (const FieldVector< ctype, mydim > &local) const |
maps a local coordinate within reference element to global coordinate in element | |
FieldVector< ctype, mydim > | local (const FieldVector< ctype, cdim > &global) const |
maps a global coordinate within the element to a local coordinate in its reference element | |
ctype | integrationElement (const FieldVector< ctype, mydim > &local) const |
ctype | volume () const |
return volume of geometry | |
const FieldMatrix< ctype, mydim, cdim > & | jacobianTransposed (const FieldVector< ctype, mydim > &local) const |
const FieldMatrix< ctype, cdim, mydim > & | jacobianInverseTransposed (const FieldVector< ctype, mydim > &local) const |
void | print (std::ostream &ss, int indent) const |
print internal data | |
void | make (FieldMatrix< ctype, mydim+1, cdim > &__As) |
SGeometry () | |
constructor |
SGeometry realizes the concept of the geometric part of a mesh entity.
The geometric part of a mesh entity is a -dimensional object in
where
corresponds the template parameter dim and
corresponds to the template parameter dimworld.
The -dimensional object is a polyhedron given by a certain number of corners, which are vectors in
.
The member function global provides a map from a topologically equivalent polyhedron ("reference element") in to the given polyhedron. This map can be inverted by the member function local, where an appropriate projection is applied first, when
.
In the case of a structured mesh discretizing a generalized cube this map is linear and can be described as
where is a given position vector, the
are given direction vectors and
is a local coordinate within the reference polyhedron. The direction vectors are assumed to be orthogonal with respect to the standard Eucliden inner product.
The -dimensional reference polyhedron is given by the points
.
In order to invert the map for a point , we have to find a local coordinate
such that
. Of course this is only possible if
. In the general case
we determine
such that
The resulting system is diagonal since the direction vectors are required to be orthogonal.
typedef GridImp::ctype Dune::SGeometry< mydim, cdim, GridImp >::ctype |
define type used for coordinates in grid module
Reimplemented from Dune::GeometryDefaultImplementation< mydim, cdim, GridImp, SGeometry >.
Dune::SGeometry< mydim, cdim, GridImp >::SGeometry | ( | ) | [inline] |
constructor
bool Dune::SGeometry< mydim, cdim, GridImp >::affine | ( | ) | const [inline] |
here we have always an affine geometry
FieldVector<ctype, cdim > Dune::SGeometry< mydim, cdim, GridImp >::center | ( | ) | const [inline] |
return center of the geometry
Reimplemented from Dune::GeometryDefaultImplementation< mydim, cdim, GridImp, SGeometry >.
FieldVector< ctype, cdim > Dune::SGeometry< mydim, cdim, GridImp >::corner | ( | const int | i | ) | const [inline] |
return i'th corner of the geometry
Referenced by Dune::SGeometry< 0, cdim, GridImp >::global().
int Dune::SGeometry< mydim, cdim, GridImp >::corners | ( | ) | const [inline] |
return the number of corners of this element. Corners are numbered 0...n-1
FieldVector<ctype, cdim> Dune::SGeometry< mydim, cdim, GridImp >::global | ( | const FieldVector< ctype, mydim > & | local | ) | const |
maps a local coordinate within reference element to global coordinate in element
ctype Dune::SGeometry< mydim, cdim, GridImp >::integrationElement | ( | const FieldVector< ctype, mydim > & | local | ) | const [inline] |
Integration over a general element is done by integrating over the reference element and using the transformation from the reference element to the global element as follows:
where is the local to global mapping and
is the integration element.
For a general map involves partial derivatives of the map (surface element of the first kind if
, determinant of the Jacobian of the transformation for
,
for
).
For linear elements, the derivatives of the map with respect to local coordinates do not depend on the local coordinates and are the same over the whole element.
For a structured mesh where all edges are parallel to the coordinate axes, the computation is the length, area or volume of the element is very simple to compute.
Each grid module implements the integration element with optimal efficieny. This will directly translate in substantial savings in the computation of finite element stiffness matrices.
References Dune::SGeometry< mydim, cdim, GridImp >::volume().
const FieldMatrix<ctype,cdim,mydim>& Dune::SGeometry< mydim, cdim, GridImp >::jacobianInverseTransposed | ( | const FieldVector< ctype, mydim > & | local | ) | const |
const FieldMatrix<ctype, mydim, cdim >& Dune::SGeometry< mydim, cdim, GridImp >::jacobianTransposed | ( | const FieldVector< ctype, mydim > & | local | ) | const |
FieldVector<ctype, mydim> Dune::SGeometry< mydim, cdim, GridImp >::local | ( | const FieldVector< ctype, cdim > & | global | ) | const |
maps a global coordinate within the element to a local coordinate in its reference element
void Dune::SGeometry< mydim, cdim, GridImp >::make | ( | FieldMatrix< ctype, mydim+1, cdim > & | __As | ) |
The first dim columns of As contain the dim direction vectors. Column dim is the position vector. This format allows a consistent treatement of all dimensions, including 0 (the vertex).
void Dune::SGeometry< mydim, cdim, GridImp >::print | ( | std::ostream & | ss, |
int | indent | ||
) | const |
print internal data
GeometryType Dune::SGeometry< mydim, cdim, GridImp >::type | ( | ) | const [inline] |
return the element type identifier
ctype Dune::SGeometry< mydim, cdim, GridImp >::volume | ( | ) | const |
return volume of geometry
Reimplemented from Dune::GeometryDefaultImplementation< mydim, cdim, GridImp, SGeometry >.
Referenced by Dune::SGeometry< mydim, cdim, GridImp >::integrationElement(), and Dune::SGeometry< 0, cdim, GridImp >::integrationElement().