OpenLB 1.7
|
Definition of a analytical 2D plane embedded in 3D space. More...
#include <hyperplane3D.h>
Public Member Functions | |
Hyperplane3D ()=default | |
Hyperplane3D & | originAt (const Vector< T, 3 > &origin) |
Center the hyperplane at the given origin vector. | |
Hyperplane3D & | centeredIn (const Cuboid3D< T > &cuboid) |
Center the hyperplane relative to the given cuboid. | |
Hyperplane3D & | spannedBy (const Vector< T, 3 > &u, const Vector< T, 3 > &v) |
Span the hyperplane using two span vectors. | |
Hyperplane3D & | normalTo (const Vector< T, 3 > &normal) |
Calculate the spanning vectors of the hyperplane to be orthogonal to the given normal. | |
Hyperplane3D & | applyMatrixToSpan (const Vector< T, 3 > &row0, const Vector< T, 3 > &row1, const Vector< T, 3 > &row2) |
Apply a matrix given by its row vectors to both span vectors. | |
Hyperplane3D & | rotateSpanAroundX (T r) |
Rotate the spanning vectors around the X axis. | |
Hyperplane3D & | rotateSpanAroundY (T r) |
Rotate the spanning vectors around the Y axis. | |
Hyperplane3D & | rotateSpanAroundZ (T r) |
Rotate the spanning vectors around the Z axis. | |
bool | isXYPlane () const |
bool | isXZPlane () const |
bool | isYZPlane () const |
Vector< T, 3 > | project (const Vector< T, 2 > &x) const |
Public Attributes | |
Vector< T, 3 > | origin |
Vector< T, 3 > | u |
Vector< T, 3 > | v |
Vector< T, 3 > | normal |
Definition of a analytical 2D plane embedded in 3D space.
Hyperplane3D defines a hyperplane using its origin and two span vectors.
In practice it might be preferable to define a hyperplane using a normal vector or to automatically center the origin in a given cuboid. For this purpose a fluent construction interface is offered:
The primary reason for this development was the increasing constructor clutter in BlockReduction3D2D: Instead of using the correct Vector<T,3> types for passing span and origin vectors they were passed as a mix between raw values and array types to prevent the constructor from becoming ambiguous. e.g. on the type level passing two span vectors is indistinguishable from passing normal and origin vectors.
Definition at line 53 of file hyperplane3D.h.
|
explicitdefault |
Hyperplane3D< T > & olb::Hyperplane3D< T >::applyMatrixToSpan | ( | const Vector< T, 3 > & | row0, |
const Vector< T, 3 > & | row1, | ||
const Vector< T, 3 > & | row2 ) |
Apply a matrix given by its row vectors to both span vectors.
Definition at line 107 of file hyperplane3D.hh.
Hyperplane3D< T > & olb::Hyperplane3D< T >::centeredIn | ( | const Cuboid3D< T > & | cuboid | ) |
Center the hyperplane relative to the given cuboid.
Definition at line 90 of file hyperplane3D.hh.
References olb::util::fabs(), olb::Cuboid3D< T >::getDeltaR(), olb::Cuboid3D< T >::getExtent(), and olb::Cuboid3D< T >::getOrigin().
bool olb::Hyperplane3D< T >::isXYPlane | ( | ) | const |
Definition at line 158 of file hyperplane3D.hh.
References olb::util::dotProduct3D(), and olb::util::nearZero().
bool olb::Hyperplane3D< T >::isXZPlane | ( | ) | const |
Definition at line 165 of file hyperplane3D.hh.
References olb::util::dotProduct3D(), and olb::util::nearZero().
bool olb::Hyperplane3D< T >::isYZPlane | ( | ) | const |
Definition at line 172 of file hyperplane3D.hh.
References olb::util::dotProduct3D(), and olb::util::nearZero().
Hyperplane3D< T > & olb::Hyperplane3D< T >::normalTo | ( | const Vector< T, 3 > & | normal | ) |
Calculate the spanning vectors of the hyperplane to be orthogonal to the given normal.
Definition at line 49 of file hyperplane3D.hh.
References olb::crossProduct3D(), olb::util::dotProduct3D(), olb::util::nearZero(), olb::normalize(), and OLB_POSTCONDITION.
Hyperplane3D< T > & olb::Hyperplane3D< T >::originAt | ( | const Vector< T, 3 > & | origin | ) |
Center the hyperplane at the given origin vector.
Definition at line 80 of file hyperplane3D.hh.
References olb::util::fabs().
Vector< T, 3 > olb::Hyperplane3D< T >::project | ( | const Vector< T, 2 > & | x | ) | const |
Definition at line 179 of file hyperplane3D.hh.
Hyperplane3D< T > & olb::Hyperplane3D< T >::rotateSpanAroundX | ( | T | r | ) |
Rotate the spanning vectors around the X axis.
Definition at line 127 of file hyperplane3D.hh.
References olb::util::cos(), and olb::util::sin().
Hyperplane3D< T > & olb::Hyperplane3D< T >::rotateSpanAroundY | ( | T | r | ) |
Rotate the spanning vectors around the Y axis.
Definition at line 138 of file hyperplane3D.hh.
References olb::util::cos(), and olb::util::sin().
Hyperplane3D< T > & olb::Hyperplane3D< T >::rotateSpanAroundZ | ( | T | r | ) |
Rotate the spanning vectors around the Z axis.
Definition at line 148 of file hyperplane3D.hh.
References olb::util::cos(), and olb::util::sin().
Hyperplane3D< T > & olb::Hyperplane3D< T >::spannedBy | ( | const Vector< T, 3 > & | u, |
const Vector< T, 3 > & | v ) |
Span the hyperplane using two span vectors.
Definition at line 35 of file hyperplane3D.hh.
References olb::crossProduct3D(), olb::util::dotProduct3D(), olb::util::nearZero(), olb::normalize(), and OLB_POSTCONDITION.
Vector<T,3> olb::Hyperplane3D< T >::normal |
Definition at line 57 of file hyperplane3D.h.
Vector<T,3> olb::Hyperplane3D< T >::origin |
Definition at line 54 of file hyperplane3D.h.
Vector<T,3> olb::Hyperplane3D< T >::u |
Definition at line 55 of file hyperplane3D.h.
Vector<T,3> olb::Hyperplane3D< T >::v |
Definition at line 56 of file hyperplane3D.h.