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