3 #ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH
4 #define DUNE_GEOMETRY_AFFINEGEOMETRY_HH
11 #include <dune/common/fmatrix.hh>
12 #include <dune/common/fvector.hh>
24 template<
class ctype,
int dim >
27 template<
class ctype,
int dim >
37 template<
class ct,
int mydim,
int cdim>
79 : refElement_(&refElement), origin_(origin), jacobianTransposed_(jt)
81 integrationElement_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ );
87 : refElement_( &
ReferenceElements::general( gt ) ), origin_(origin), jacobianTransposed_( jt )
89 integrationElement_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ );
93 template<
class CoordVector >
95 : refElement_(&refElement), origin_(coordVector[0])
98 jacobianTransposed_[ i ] = coordVector[ i+1 ] - origin_;
99 integrationElement_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ );
103 template<
class CoordVector >
108 jacobianTransposed_[ i ] = coordVector[ i+1 ] - origin_;
109 integrationElement_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ );
139 jacobianTransposed_.umtv( local, global );
157 jacobianInverseTransposed_.mtv( global - origin_, local );
173 DUNE_UNUSED_PARAMETER(local);
174 return integrationElement_;
180 return integrationElement_ * refElement_->
volume();
191 DUNE_UNUSED_PARAMETER(local);
192 return jacobianTransposed_;
203 DUNE_UNUSED_PARAMETER(local);
204 return jacobianInverseTransposed_;
212 ctype integrationElement_;
218 #endif // #ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH
ctype integrationElement(const LocalCoordinate &local) const
Obtain the integration element.
Definition: affinegeometry.hh:171
bool affine() const
Always true: this is an affine geometry.
Definition: affinegeometry.hh:113
Definition: matrixhelper.hh:33
LocalCoordinate local(const GlobalCoordinate &global) const
Evaluate the inverse mapping.
Definition: affinegeometry.hh:154
int size(int c) const
number of subentities of codimension c
Definition: referenceelements.hh:86
AffineGeometry(Dune::GeometryType gt, const GlobalCoordinate &origin, const JacobianTransposed &jt)
Create affine geometry from GeometryType, one vertex, and the Jacobian matrix.
Definition: affinegeometry.hh:85
A unique label for each type of element that can occur in a grid.
ctype volume() const
obtain the volume of the reference element
Definition: referenceelements.hh:280
ctype volume() const
Obtain the volume of the element.
Definition: affinegeometry.hh:178
const JacobianInverseTransposed & jacobianInverseTransposed(const LocalCoordinate &local) const
Obtain the transposed of the Jacobian's inverse.
Definition: affinegeometry.hh:201
AffineGeometry(const ReferenceElement &refElement, const CoordVector &coordVector)
Create affine geometry from reference element and a vector of vertex coordinates. ...
Definition: affinegeometry.hh:94
const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) const
Obtain the transposed of the Jacobian.
Definition: affinegeometry.hh:189
ct ctype
Type used for coordinates.
Definition: affinegeometry.hh:43
This class provides access to geometric and topological properties of a reference element...
Definition: affinegeometry.hh:25
const FieldVector< ctype, dim > & position(int i, int c) const
position of the barycenter of entity (i,c)
Definition: referenceelements.hh:154
Implementation of the Geometry interface for affine geometries.
Definition: affinegeometry.hh:38
int corners() const
Obtain number of corners of the corresponding reference element.
Definition: affinegeometry.hh:119
AffineGeometry(Dune::GeometryType gt, const CoordVector &coordVector)
Create affine geometry from GeometryType and a vector of vertex coordinates.
Definition: affinegeometry.hh:104
Dune::GeometryType type() const
Obtain the type of the reference element.
Definition: affinegeometry.hh:116
static const int mydimension
Dimension of the geometry.
Definition: affinegeometry.hh:46
JacobianInverseTransposed Jacobian
Definition: affinegeometry.hh:64
Class providing access to the singletons of the reference elements. Special methods are available for...
Definition: affinegeometry.hh:28
FieldVector< ctype, coorddimension > GlobalCoordinate
Type for coordinate vector in world space.
Definition: affinegeometry.hh:55
static const int coorddimension
Dimension of the world space.
Definition: affinegeometry.hh:49
FieldVector< ctype, mydimension > LocalCoordinate
Type for local coordinate vector.
Definition: affinegeometry.hh:52
GlobalCoordinate global(const LocalCoordinate &local) const
Evaluate the mapping.
Definition: affinegeometry.hh:136
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:24
GlobalCoordinate center() const
Obtain the centroid of the mapping's image.
Definition: affinegeometry.hh:128
const GeometryType & type(int i, int c) const
obtain the type of subentity (i,c)
Definition: referenceelements.hh:136
GlobalCoordinate corner(int i) const
Obtain coordinates of the i-th corner.
Definition: affinegeometry.hh:122
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
Type for the transposed Jacobian matrix.
Definition: affinegeometry.hh:58
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:77
FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
Type for the transposed inverse Jacobian matrix.
Definition: affinegeometry.hh:61