Representation of a 3D Cartesian coordinate system as a Vector of row vectors. More...
#include <triad.H>


Public Member Functions | |
| triad () | |
| Default construct as 'unset'. | |
| triad (const Vector< vector > &vv) | |
| Construct from components. | |
| triad (const vector &x, const vector &y, const vector &z) | |
| Construct from coordinate axes (row vectors). | |
| triad (const tensor &t) | |
| Construct from a tensor. | |
| triad (const vector &pa) | |
| Construct from a primary axis with the other two unset. | |
| triad (const quaternion &q) | |
| Construct from a quaternion. | |
| triad (Istream &) | |
| Construct from Istream. | |
| bool | set (const direction d) const |
| Is the vector in the direction d set. | |
| bool | set () const |
| Are all the vector set. | |
| void | orthogonalise () |
| Inplace orthogonalise so that it is ortho-normal. | |
| void | normalise () |
| Normalise each set axis vector to have a unit magnitude. | |
| void | align (const vector &v) |
| Align this triad with the given vector v. | |
| triad | sortxyz () const |
| Sort the axes such that they are closest to the x, y and z axes. | |
| operator quaternion () const | |
| Convert to a quaternion. | |
| triad | T () const |
| Return transpose. | |
| vector | cx () const |
| Extract vector for column 0. | |
| vector | cy () const |
| Extract vector for column 1. | |
| vector | cz () const |
| Extract vector for column 2. | |
| void | operator= (const Vector< vector > &vv) |
| void | operator= (const tensor &t) |
| void | operator+= (const triad &t2) |
| Add the triad t2 to this triad. | |
| void | orthogonalize () |
| Same as orthogonalise. | |
| void | normalize () |
| Same as normalise. | |
| Public Member Functions inherited from Vector< vector > | |
| Vector ()=default | |
| Default construct. | |
| Vector (const Vector &)=default | |
| Copy construct. | |
| Vector & | operator= (const Vector &)=default |
| Copy assignment. | |
| Vector (Foam::zero) | |
| Construct initialized to zero. | |
| Vector (const VectorSpace< Vector< Cmpt2 >, Cmpt2, 3 > &vs) | |
| Copy construct from VectorSpace of the same rank. | |
| Vector (const vector &vx, const vector &vy, const vector &vz) | |
| Construct from three components. | |
| Vector (Istream &is) | |
| Construct from Istream. | |
| const vector & | x () const noexcept |
| Access to the vector x component. | |
| const vector & | y () const noexcept |
| Access to the vector y component. | |
| const vector & | z () const noexcept |
| Access to the vector z component. | |
| vector & | x () noexcept |
| Access to the vector x component. | |
| vector & | y () noexcept |
| Access to the vector y component. | |
| vector & | z () noexcept |
| Access to the vector z component. | |
| const Vector< vector > & | centre (const Foam::UList< Vector< vector > > &) const noexcept |
Return this (for point which is a typedef to Vector<scalar>). | |
| scalar | mag () const |
| The length (L2-norm) of the vector. | |
| scalar | magSqr () const |
| The length (L2-norm) squared of the vector. | |
| scalar | dist (const Vector< vector > &v2) const |
| The L2-norm distance from another vector. The mag() of the difference. | |
| scalar | distSqr (const Vector< vector > &v2) const |
| The L2-norm distance squared from another vector. The magSqr() of the difference. | |
| Vector< vector > & | normalise (const scalar tol=ROOTVSMALL) |
| Inplace normalise the vector by its magnitude. | |
| Vector< vector > & | removeCollinear (const Vector< vector > &unitVec) |
| Inplace removal of components that are collinear to the given unit vector. | |
| vector | inner (const Vector< vector > &v2) const |
Scalar-product of this with another Vector. | |
| Vector< vector > | cross (const Vector< vector > &v2) const |
Cross-product of this with another Vector. | |
| std::enable_if_t< std::is_convertible_v< Cmpt2, vector >, void > | operator+= (const Vector< Cmpt2 > &b) |
| Add compatible vector to this. | |
| std::enable_if_t< std::is_convertible_v< Cmpt2, vector >, void > | operator-= (const Vector< Cmpt2 > &b) |
| Subtract compatible vector from this. | |
| Public Member Functions inherited from VectorSpace< Form, Cmpt, Ncmpts > | |
| VectorSpace ()=default | |
| Default construct. | |
| VectorSpace (Foam::zero) | |
| Construct initialized to zero. | |
| VectorSpace (const VectorSpace< Form, Cmpt, Ncmpts > &vs) | |
| Copy construct. | |
| template<class Form2, class Cmpt2> | |
| VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &) | |
| Copy construct of a VectorSpace with the same size. | |
| VectorSpace (Istream &is) | |
| Construct from Istream. | |
| const Cmpt & | component (const direction) const |
| Cmpt & | component (const direction) |
| void | component (Cmpt &, const direction) const |
| void | replace (const direction, const Cmpt &) |
| const Cmpt * | cdata () const noexcept |
| Return const pointer to the first data element. | |
| Cmpt * | data () noexcept |
| Return pointer to the first data element. | |
| void | fill (const Cmpt &s) |
| Assign all components to given value. | |
| template<class SubVector, direction BStart> | |
| const ConstBlock< SubVector, BStart > | block () const |
| const Cmpt & | operator[] (const direction) const |
| Cmpt & | operator[] (const direction) |
| void | operator= (const VectorSpace< Form, Cmpt, Ncmpts > &) |
| void | operator+= (const VectorSpace< Form, Cmpt, Ncmpts > &) |
| void | operator-= (const VectorSpace< Form, Cmpt, Ncmpts > &) |
| template<class Form2, class Cmpt2> | |
| void | operator= (const VectorSpace< Form2, Cmpt2, Ncmpts > &) |
| Copy assign from a VectorSpace with the same size. | |
| void | operator= (Foam::zero) |
| void | operator*= (const scalar) |
| void | operator/= (const scalar) |
| iterator | begin () noexcept |
| Return an iterator (pointer) to begin of VectorSpace. | |
| const_iterator | begin () const noexcept |
| Return const_iterator (const pointer) to begin of VectorSpace. | |
| const_iterator | cbegin () const noexcept |
| Return const_iterator (const pointer) to begin of VectorSpace. | |
| iterator | end () noexcept |
| Return an iterator (pointer) to end of VectorSpace. | |
| const_iterator | end () const noexcept |
| Return const_iterator (const pointer) to end of VectorSpace. | |
| const_iterator | cend () const noexcept |
| Return const_iterator (const pointer) to end of VectorSpace. | |
| template<class SubVector, Foam::direction BStart> | |
| const Foam::VectorSpace< Form, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > | block () const |
Static Public Member Functions | |
| static direction | primaryDirection (const vector &v) |
| Return the primary direction of the vector v. | |
| static vector | orthogonal (const vector &v1, const vector &v2) |
| Return the vector orthogonal to the two provided. | |
| Static Public Member Functions inherited from Vector< vector > | |
| static bool | less_xyz (const Vector< vector > &a, const Vector< vector > &b) |
| Lexicographically compare a and b with order (x:y:z). | |
| static bool | less_yzx (const Vector< vector > &a, const Vector< vector > &b) |
| Lexicographically compare a and b with order (y:z:x). | |
| static bool | less_zxy (const Vector< vector > &a, const Vector< vector > &b) |
| Lexicographically compare a and b with order (z:x:y). | |
| Static Public Member Functions inherited from VectorSpace< Form, Cmpt, Ncmpts > | |
| static constexpr direction | size () noexcept |
| The number of elements in the VectorSpace = Ncmpts. | |
| static Form | uniform (const Cmpt &s) |
| Return a VectorSpace with all elements = s. | |
Static Public Attributes | |
| static const triad | I |
| static const triad | unset |
| Static Public Attributes inherited from Vector< vector > | |
| static constexpr direction | rank |
| Rank of Vector is 1. | |
| Static Public Attributes inherited from VectorSpace< Form, Cmpt, Ncmpts > | |
| static constexpr direction | dim = 3 |
| Dimensionality of space. | |
| static constexpr direction | nComponents = Ncmpts |
| Number of components in this vector space. | |
| static constexpr direction | mRows = Ncmpts |
| static constexpr direction | nCols = 1 |
| static const char *const | typeName = "spatialVector" |
| static const char *const | componentNames [] |
| static const Form | zero |
| static const Form | one |
| static const Form | max |
| static const Form | min |
| static const Form | rootMax |
| static const Form | rootMin |
Friends | |
| Istream & | operator>> (Istream &, triad &) |
| Ostream & | operator<< (Ostream &, const triad &) |
Additional Inherited Members | |
| Public Types inherited from Vector< vector > | |
| typedef Vector< label > | labelType |
| Equivalent type of labels used for valid component indexing. | |
| enum | components |
| Component labeling enumeration. More... | |
| Public Types inherited from VectorSpace< Form, Cmpt, Ncmpts > | |
| typedef VectorSpace< Form, Cmpt, Ncmpts > | vsType |
| VectorSpace type. | |
| typedef Cmpt | cmptType |
| Component type. | |
| typedef Cmpt | magType |
| Magnitude type. | |
| typedef direction | size_type |
| The type to represent the size of a VectorSpace. | |
| typedef Cmpt * | iterator |
| Random access iterator for traversing VectorSpace. | |
| typedef const Cmpt * | const_iterator |
| Random access iterator for traversing VectorSpace. | |
| Public Attributes inherited from VectorSpace< Form, Cmpt, Ncmpts > | |
| Cmpt | v_ [Ncmpts] |
| The components of this vector space. | |
Representation of a 3D Cartesian coordinate system as a Vector of row vectors.
|
inline |
Default construct as 'unset'.
Definition at line 24 of file triadI.H.
References triad(), unset, and Vector< vector >::Vector().
Referenced by operator quaternion(), operator+=(), operator<<, operator>>, sortxyz(), T(), and triad().


Construct from components.
Definition at line 30 of file triadI.H.
References Vector< vector >::Vector().

Construct from coordinate axes (row vectors).
Definition at line 36 of file triadI.H.
References Vector< vector >::Vector(), Vector< vector >::x(), Vector< vector >::y(), and Vector< vector >::z().

|
inline |
Construct from a tensor.
Definition at line 42 of file triadI.H.
References Vector< vector >::Vector(), Vector< vector >::x(), Vector< vector >::y(), and Vector< vector >::z().

|
inline |
Construct from a primary axis with the other two unset.
Definition at line 48 of file triadI.H.
References operator=(), VectorSpace< Form, Cmpt, Ncmpts >::operator[](), primaryDirection(), and unset.

| triad | ( | const quaternion & | q | ) |
Construct from a quaternion.
Definition at line 84 of file triad.C.
References quaternion::R(), Tensor< Cmpt >::T(), Tensor< Cmpt >::x(), Vector< vector >::x(), Tensor< Cmpt >::y(), Vector< vector >::y(), Tensor< Cmpt >::z(), and Vector< vector >::z().

|
inline |
Construct from Istream.
Definition at line 55 of file triadI.H.
References Vector< vector >::Vector().

|
inline |
Is the vector in the direction d set.
Definition at line 63 of file triadI.H.
References VectorSpace< Form, Cmpt, Ncmpts >::operator[]().
Referenced by align(), triSurfaceTools::curvatures(), Foam::diff(), normalise(), operator+=(), orthogonalise(), set(), and sortxyz().


|
inline |
|
inlinestatic |
Return the primary direction of the vector v.
Definition at line 75 of file triadI.H.
References Foam::mag(), Vector< vector >::X, Vector< Cmpt >::x(), Vector< vector >::Y, Vector< Cmpt >::y(), Vector< vector >::Z, and Vector< Cmpt >::z().
Referenced by triad().


|
inlinestatic |
Return the vector orthogonal to the two provided.
Definition at line 96 of file triadI.H.
References Foam::mag(), and unset.
Referenced by orthogonalise().


| void orthogonalise | ( | ) |
Inplace orthogonalise so that it is ortho-normal.
Definition at line 95 of file triad.C.
References Foam::mag(), VectorSpace< Form, Cmpt, Ncmpts >::operator[](), orthogonal(), and set().
Referenced by orthogonalize().


|
inline |
Normalise each set axis vector to have a unit magnitude.
Uses vector::normalise with handling of small magnitudes.
Definition at line 117 of file triadI.H.
References set().
Referenced by normalize().


| void align | ( | const vector & | v | ) |
Align this triad with the given vector v.
by rotating the most aligned axis to be coincident with v
Definition at line 235 of file triad.C.
References Foam::mag(), VectorSpace< Form, Cmpt, Ncmpts >::operator[](), R, Foam::rotationTensor(), set(), Foam::transform(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

| Foam::triad sortxyz | ( | ) | const |
Sort the axes such that they are closest to the x, y and z axes.
Definition at line 280 of file triad.C.
References Foam::mag(), VectorSpace< Form, Cmpt, Ncmpts >::operator[](), set(), triad(), x, y, and Vector< vector >::z().

| operator quaternion | ( | ) | const |
Convert to a quaternion.
References triad(), and Vector< vector >::Vector().

|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 151 of file triadI.H.
References Vector< Cmpt >::operator=(), and Vector< vector >::Vector().
Referenced by triad().


Definition at line 157 of file triadI.H.
References Tensor< Cmpt >::x(), x, Tensor< Cmpt >::y(), y, Tensor< Cmpt >::z(), and Vector< vector >::z().

Add the triad t2 to this triad.
without normalising or orthogonalising
Definition at line 172 of file triad.C.
References k, Foam::mag(), VectorSpace< Form, Cmpt, Ncmpts >::operator[](), set(), Foam::sign(), and triad().

|
inline |
Same as orthogonalise.
Definition at line 210 of file triad.H.
References orthogonalise().

|
inline |
Same as normalise.
Definition at line 215 of file triad.H.
References normalise().
Referenced by triSurfaceTools::curvatures().


|
static |
|
static |
Definition at line 107 of file triad.H.
Referenced by orthogonal(), triad(), triad(), and triSurfaceTools::vertexTriads().