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 >
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_;
261 #endif // #ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH decltype(referenceElement(std::declval< T >()...)) ReferenceElement
Definition: referenceelements.hh:291
FieldVector< ctype, coorddimension > GlobalCoordinate
Type for coordinate vector in world space.
Definition: affinegeometry.hh:65
This class provides access to geometric and topological properties of a reference element...
Definition: affinegeometry.hh:31
AffineGeometry(Dune::GeometryType gt, const CoordVector &coordVector)
Create affine geometry from GeometryType and a vector of vertex coordinates.
Definition: affinegeometry.hh:126
FieldMatrix< ctype, coorddimension, mydimension > Jacobian
Type for the Jacobian matrix.
Definition: affinegeometry.hh:77
const JacobianTransposed & jacobianTransposed([[maybe_unused]] const LocalCoordinate &local) const
Obtain the transposed of the Jacobian.
Definition: affinegeometry.hh:208
A unique label for each type of element that can occur in a grid.
ct ctype
Type used for coordinates.
Definition: affinegeometry.hh:53
GlobalCoordinate corner(int i) const
Obtain coordinates of the i-th corner.
Definition: affinegeometry.hh:140
FieldVector< ctype, mydimension > LocalCoordinate
Type for local coordinate vector.
Definition: affinegeometry.hh:62
bool affine() const
Always true: this is an affine geometry.
Definition: affinegeometry.hh:131
friend ReferenceElement referenceElement(const AffineGeometry &geometry)
Definition: affinegeometry.hh:246
GlobalCoordinate center() const
Obtain the centroid of the mapping's image.
Definition: affinegeometry.hh:146
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:113
ctype integrationElement([[maybe_unused]] const LocalCoordinate &local) const
Obtain the integration element.
Definition: affinegeometry.hh:191
ctype Volume
Type used for volume.
Definition: affinegeometry.hh:68
Volume volume() const
Obtain the volume of the element.
Definition: affinegeometry.hh:197
Dune::GeometryType type() const
Obtain the type of the reference element.
Definition: affinegeometry.hh:134
AffineGeometry(const ReferenceElement &refElement, const CoordVector &coordVector)
Create affine geometry from reference element and a vector of vertex coordinates. ...
Definition: affinegeometry.hh:116
FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse
Type for the inverse Jacobian matrix.
Definition: affinegeometry.hh:80
GlobalCoordinate global(const LocalCoordinate &local) const
Evaluate the mapping.
Definition: affinegeometry.hh:154
AffineGeometry()=default
Constructs an empty geometry.
Class providing access to the singletons of the reference elements.
Definition: affinegeometry.hh:37
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
Type for the transposed Jacobian matrix.
Definition: affinegeometry.hh:71
CoordinateField volume() const
obtain the volume of the reference element
Definition: referenceelement.hh:228
Coordinate position(int i, int c) const
position of the barycenter of entity (i,c)
Definition: referenceelement.hh:190
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
int corners() const
Obtain number of corners of the corresponding reference element.
Definition: affinegeometry.hh:137
GeometryType type(int i, int c) const
obtain the type of subentity (i,c)
Definition: referenceelement.hh:167
LocalCoordinate local(const GlobalCoordinate &global) const
Evaluate the inverse mapping.
Definition: affinegeometry.hh:174
static const int mydimension
Dimension of the geometry.
Definition: affinegeometry.hh:56
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
Definition: affinegeometry.hh:21
FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
Type for the transposed inverse Jacobian matrix.
Definition: affinegeometry.hh:74
const JacobianInverseTransposed & jacobianInverseTransposed([[maybe_unused]] const LocalCoordinate &local) const
Obtain the transposed of the Jacobian's inverse.
Definition: affinegeometry.hh:219
Definition: affinegeometry.hh:34
Jacobian jacobian([[maybe_unused]] const LocalCoordinate &local) const
Obtain the Jacobian.
Definition: affinegeometry.hh:230
static const int coorddimension
Dimension of the world space.
Definition: affinegeometry.hh:59
JacobianInverse jacobianInverse([[maybe_unused]] const LocalCoordinate &local) const
Obtain the Jacobian's inverse.
Definition: affinegeometry.hh:241
int size(int c) const
number of subentities of codimension c
Definition: referenceelement.hh:94
Implementation of the Geometry interface for affine geometries.
Definition: affinegeometry.hh:48