dune-geometry 2.10
|
A geometry implementation for axis-aligned hypercubes. More...
#include <dune/geometry/axisalignedcubegeometry.hh>
Public Types | |
typedef CoordType | ctype |
Type used for single coordinate coefficients. | |
typedef FieldVector< ctype, dim > | LocalCoordinate |
Type used for a vector of element coordinates. | |
typedef FieldVector< ctype, coorddim > | GlobalCoordinate |
Type used for a vector of world coordinates. | |
typedef ctype | Volume |
Type used for volume. | |
typedef std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, dim, coorddim > >::type | JacobianTransposed |
Return type of jacobianTransposed. | |
typedef std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, coorddim, dim > >::type | JacobianInverseTransposed |
Return type of jacobianInverseTransposed. | |
using | Jacobian = std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, coorddim, dim > > |
Return type of jacobian. | |
using | JacobianInverse = std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, dim, coorddim > > |
Return type of jacobianInverse. | |
Public Member Functions | |
AxisAlignedCubeGeometry ()=default | |
Constructs an empty geometry. | |
AxisAlignedCubeGeometry (const Dune::FieldVector< ctype, coorddim > lower, const Dune::FieldVector< ctype, coorddim > upper) | |
Constructor from a lower left and an upper right corner. | |
AxisAlignedCubeGeometry (const Dune::FieldVector< ctype, coorddim > lower, const Dune::FieldVector< ctype, coorddim > upper, const std::bitset< coorddim > &axes) | |
Constructor from a lower left and an upper right corner. | |
AxisAlignedCubeGeometry (const Dune::FieldVector< ctype, coorddim > lower) | |
Constructor from a single point only. | |
GeometryType | type () const |
Type of the cube. Here: a hypercube of the correct dimension. | |
GlobalCoordinate | global (const LocalCoordinate &local) const |
Map a point in local (element) coordinates to world coordinates. | |
LocalCoordinate | local (const GlobalCoordinate &global) const |
Map a point in global (world) coordinates to element coordinates. | |
JacobianTransposed | jacobianTransposed (const LocalCoordinate &local) const |
Jacobian transposed of the transformation from local to global coordinates. | |
JacobianInverseTransposed | jacobianInverseTransposed (const LocalCoordinate &local) const |
Inverse Jacobian transposed of the transformation from local to global coordinates. | |
Jacobian | jacobian (const LocalCoordinate &local) const |
Jacobian of the transformation from local to global coordinates. | |
JacobianInverse | jacobianInverse (const LocalCoordinate &local) const |
Inverse Jacobian of the transformation from local to global coordinates. | |
Volume | integrationElement (const LocalCoordinate &local) const |
Return the integration element, i.e., the determinant term in the integral transformation formula. | |
GlobalCoordinate | center () const |
Return center of mass of the element. | |
int | corners () const |
Return the number of corners of the element. | |
GlobalCoordinate | corner (int k) const |
Return world coordinates of the k-th corner of the element. | |
Volume | volume () const |
Return the element volume. | |
bool | affine () const |
Return if the element is affine. Here: yes. | |
Static Public Attributes | |
static constexpr int | mydimension = dim |
Dimension of the cube element. | |
static constexpr int | coorddimension = coorddim |
Dimension of the world space that the cube element is embedded in. | |
A geometry implementation for axis-aligned hypercubes.
This code is much faster than a generic implementation for hexahedral elements. All methods use the fact that a geometry for axis-aligned cubes is basically just a(n affine) scaling in the coordinate directions.
If dim < coorddim then local coordinates need to be suitably mapped to global ones. AxisAlignedCubeGeometry uses a special std::bitset 'axes' for this. 'axes' has coorddim entries, of which precisely 'dim' need to be set. Each set entry marks a local coordinate, i.e., a coordinate in which the cube has extension. The cube is flat in all other directions. Its coordinates in these directions is taking from the array called 'lower', which specifies the lower left corner of the hypercube.
In the case of dim==coorddim, the code goes into overdrive. Then special code path's are taken (statically) which omit the conditionals needed to sort out the embedding of local into global coordinates. Aggressive compiler/scheduler optimization becomes possible. Additionally, the types returned by the methods jacobianTransposed and jacobianInverseTransposed are dedicated types for diagonal matrices (DiagonalMatrix).
CoordType | Type used for single coordinate coefficients |
dim | Dimension of the cube |
coorddim | Dimension of the space that the cube lives in |
typedef CoordType Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >::ctype |
Type used for single coordinate coefficients.
typedef FieldVector<ctype,coorddim> Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >::GlobalCoordinate |
Type used for a vector of world coordinates.
using Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >::Jacobian = std::conditional_t<dim==coorddim, DiagonalMatrix<ctype,dim>, FieldMatrix<ctype,coorddim,dim> > |
Return type of jacobian.
This is a fast DiagonalMatrix if dim==coorddim, and a FieldMatrix otherwise. The FieldMatrix will never contain more than one entry per row, hence it could be replaced by something more efficient.
using Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >::JacobianInverse = std::conditional_t<dim==coorddim, DiagonalMatrix<ctype,dim>, FieldMatrix<ctype,dim,coorddim> > |
Return type of jacobianInverse.
This is a fast DiagonalMatrix if dim==coorddim, and a FieldMatrix otherwise. The FieldMatrix will never contain more than one entry per row, hence it could be replaced by something more efficient.
typedef std::conditional<dim==coorddim,DiagonalMatrix<ctype,dim>,FieldMatrix<ctype,coorddim,dim>>::type Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >::JacobianInverseTransposed |
Return type of jacobianInverseTransposed.
This is a fast DiagonalMatrix if dim==coorddim, and a FieldMatrix otherwise. The FieldMatrix will never contain more than one entry per column, hence it could be replaced by something more efficient.
typedef std::conditional<dim==coorddim,DiagonalMatrix<ctype,dim>,FieldMatrix<ctype,dim,coorddim>>::type Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >::JacobianTransposed |
Return type of jacobianTransposed.
This is a fast DiagonalMatrix if dim==coorddim, and a FieldMatrix otherwise. The FieldMatrix will never contain more than one entry per row, hence it could be replaced by something more efficient.
typedef FieldVector<ctype,dim> Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >::LocalCoordinate |
Type used for a vector of element coordinates.
typedef ctype Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >::Volume |
Type used for volume.
|
default |
Constructs an empty geometry.
This constructor creates an empty (invalid) axis-aligned cube geometry. It may not be used in any way except for assigning other axis-aligned cube geometries to it. After assigning a valid geometry, it may be used without restrictions.
|
inline |
Constructor from a lower left and an upper right corner.
|
inline |
Constructor from a lower left and an upper right corner.
lower | Coordinates for the lower left corner. |
upper | Coordinates for the upper right corner. |
axes | Each bit set to 'true' here corresponds to a local coordinate axis. In other words, precisely 'dim' bits must be set here. |
|
inline |
Constructor from a single point only.
|
inline |
Return if the element is affine. Here: yes.
|
inline |
Return center of mass of the element.
|
inline |
Return world coordinates of the k-th corner of the element.
|
inline |
Return the number of corners of the element.
|
inline |
Map a point in local (element) coordinates to world coordinates.
|
inline |
Return the integration element, i.e., the determinant term in the integral transformation formula.
|
inline |
Jacobian of the transformation from local to global coordinates.
|
inline |
Inverse Jacobian of the transformation from local to global coordinates.
|
inline |
Inverse Jacobian transposed of the transformation from local to global coordinates.
|
inline |
Jacobian transposed of the transformation from local to global coordinates.
|
inline |
Map a point in global (world) coordinates to element coordinates.
|
inline |
Type of the cube. Here: a hypercube of the correct dimension.
|
inline |
Return the element volume.
|
staticconstexpr |
Dimension of the world space that the cube element is embedded in.
|
staticconstexpr |
Dimension of the cube element.