5#ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH
6#define DUNE_GEOMETRY_AFFINEGEOMETRY_HH
15#include <dune/common/fmatrix.hh>
16#include <dune/common/fvector.hh>
30 template<
typename Implementation >
33 template<
class ctype,
int dim >
36 template<
class ctype,
int dim >
47 template<
class ct,
int mydim,
int cdim>
77 typedef FieldMatrix< ctype, coorddimension, mydimension >
Jacobian;
89 typedef Impl::FieldMatrixHelper< ct > MatrixHelper;
103 : refElement_(refElement), origin_(origin), jacobianTransposed_(jt)
105 integrationElement_ = MatrixHelper::rightInvA( jacobianTransposed_, jacobianInverseTransposed_ );
115 template<
class CoordVector >
116 AffineGeometry (
const ReferenceElement &refElement,
const CoordVector &coordVector )
117 : refElement_(refElement), origin_(coordVector[0])
120 jacobianTransposed_[ i ] = coordVector[ i+1 ] - origin_;
121 integrationElement_ = MatrixHelper::rightInvA( jacobianTransposed_, jacobianInverseTransposed_ );
125 template<
class CoordVector >
177 jacobianInverseTransposed_.mtv(
global - origin_,
local );
193 return integrationElement_;
199 return integrationElement_ * refElement_.volume();
210 return jacobianTransposed_;
221 return jacobianInverseTransposed_;
232 return jacobianTransposed_.transposed();
243 return jacobianInverseTransposed_.transposed();
248 return geometry.refElement_;
256 ctype integrationElement_;
A unique label for each type of element that can occur in a grid.
Definition affinegeometry.hh:22
decltype(referenceElement(std::declval< T >()...)) ReferenceElement
Definition referenceelements.hh:291
Definition affinegeometry.hh:28
This class provides access to geometric and topological properties of a reference element.
Definition referenceelement.hh:52
Definition affinegeometry.hh:34
Class providing access to the singletons of the reference elements.
Definition referenceelements.hh:128
AffineGeometry(const ReferenceElement &refElement, const CoordVector &coordVector)
Create affine geometry from reference element and a vector of vertex coordinates.
Definition affinegeometry.hh:116
AffineGeometry()=default
Constructs an empty geometry.
AffineGeometry(Dune::GeometryType gt, const GlobalCoordinate &origin, const JacobianTransposed &jt)
Create affine geometry from GeometryType, one vertex, and the Jacobian matrix.
Definition affinegeometry.hh:109
FieldVector< ctype, mydimension > LocalCoordinate
Type for local coordinate vector.
Definition affinegeometry.hh:62
Dune::GeometryType type() const
Obtain the type of the reference element.
Definition affinegeometry.hh:134
static const int mydimension
Dimension of the geometry.
Definition affinegeometry.hh:56
AffineGeometry(const ReferenceElement &refElement, const GlobalCoordinate &origin, const JacobianTransposed &jt)
Create affine geometry from reference element, one vertex, and the Jacobian matrix.
Definition affinegeometry.hh:101
ctype Volume
Type used for volume.
Definition affinegeometry.hh:68
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Obtain the Jacobian's inverse.
Definition affinegeometry.hh:241
friend ReferenceElement referenceElement(const AffineGeometry &geometry)
Definition affinegeometry.hh:246
AffineGeometry(Dune::GeometryType gt, const CoordVector &coordVector)
Create affine geometry from GeometryType and a vector of vertex coordinates.
Definition affinegeometry.hh:126
ctype integrationElement(const LocalCoordinate &local) const
Obtain the integration element.
Definition affinegeometry.hh:191
FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse
Type for the inverse Jacobian matrix.
Definition affinegeometry.hh:80
FieldMatrix< ctype, coorddimension, mydimension > Jacobian
Type for the Jacobian matrix.
Definition affinegeometry.hh:77
const JacobianInverseTransposed & jacobianInverseTransposed(const LocalCoordinate &local) const
Obtain the transposed of the Jacobian's inverse.
Definition affinegeometry.hh:219
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
Type for the transposed Jacobian matrix.
Definition affinegeometry.hh:71
GlobalCoordinate corner(int i) const
Obtain coordinates of the i-th corner.
Definition affinegeometry.hh:140
int corners() const
Obtain number of corners of the corresponding reference element.
Definition affinegeometry.hh:137
LocalCoordinate local(const GlobalCoordinate &global) const
Evaluate the inverse mapping.
Definition affinegeometry.hh:174
FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
Type for the transposed inverse Jacobian matrix.
Definition affinegeometry.hh:74
static const int coorddimension
Dimension of the world space.
Definition affinegeometry.hh:59
GlobalCoordinate global(const LocalCoordinate &local) const
Evaluate the mapping.
Definition affinegeometry.hh:154
GlobalCoordinate center() const
Obtain the centroid of the mapping's image.
Definition affinegeometry.hh:146
Jacobian jacobian(const LocalCoordinate &local) const
Obtain the Jacobian.
Definition affinegeometry.hh:230
ct ctype
Type used for coordinates.
Definition affinegeometry.hh:53
FieldVector< ctype, coorddimension > GlobalCoordinate
Type for coordinate vector in world space.
Definition affinegeometry.hh:65
bool affine() const
Always true: this is an affine geometry.
Definition affinegeometry.hh:131
const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) const
Obtain the transposed of the Jacobian.
Definition affinegeometry.hh:208
Volume volume() const
Obtain the volume of the element.
Definition affinegeometry.hh:197
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:114