Representation of a 3D Cartesian coordinate system as a Vector of row vectors. More...
Public Member Functions | |
triad () | |
Construct null. 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 | orthogonalize () |
Orthogonalize this triad so that it is ortho-normal. More... | |
void | normalize () |
Normalize 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... | |
![]() | |
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 |
Access to the vector x component. More... | |
vector & | x () |
Access to the vector x component. More... | |
const vector & | y () const |
Access to the vector y component. More... | |
vector & | y () |
Access to the vector y component. More... | |
const vector & | z () const |
Access to the vector z component. More... | |
vector & | z () |
Access to the vector z component. More... | |
Vector< vector > & | normalise () |
Normalise the vector by its magnitude. More... | |
const Vector< vector > & | centre (const Foam::List< Vector< vector >> &) const |
Return *this (used for point which is a typedef to Vector<scalar>. More... | |
![]() | |
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 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 constexpr direction | rank |
Rank of Vector is 1. More... | |
![]() | |
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 | |
![]() | |
enum | components |
Component labeling enumeration. More... | |
typedef Vector< label > | labelType |
Equivalent type of labels used for valid component indexing. More... | |
![]() | |
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... | |
![]() | |
const typedef vector * | const_iterator |
Random access iterator for traversing VectorSpace. More... | |
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 55 of file triadI.H.
References triad::unset.
triad | ( | const quaternion & | q | ) |
Construct from a quaternion.
Definition at line 91 of file triad.C.
References quaternion::R(), Tensor< Cmpt >::T(), Vector< Cmpt >::x(), Vector< vector >::x(), Vector< vector >::y(), Vector< Cmpt >::y(), Vector< Cmpt >::z(), and Vector< vector >::z().
Is the vector in the direction d set.
Definition at line 70 of file triadI.H.
Referenced by triSurfaceTools::curvatures(), Foam::diff(), and triad::operator+=().
|
inline |
Are all the vector set.
Definition at line 76 of file triadI.H.
References Foam::BitOps::set().
|
inlinestatic |
Return the primary direction of the vector v.
Definition at line 82 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().
|
inlinestatic |
Return the vector orthogonal to the two provided.
Definition at line 100 of file triadI.H.
References Foam::mag(), and triad::unset.
void orthogonalize | ( | ) |
Orthogonalize this triad so that it is ortho-normal.
Definition at line 102 of file triad.C.
References Foam::mag(), and Foam::BitOps::set().
|
inline |
Normalize each set axis vector to have a unit magnitude.
Definition at line 120 of file triadI.H.
References Foam::mag(), and Foam::BitOps::set().
Referenced by triSurfaceTools::curvatures().
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 240 of file triad.C.
References Foam::mag(), R, Foam::rotationTensor(), Foam::BitOps::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 285 of file triad.C.
References Foam::mag(), Foam::BitOps::set(), x, and y.
operator quaternion | ( | ) | const |
Convert to a quaternion.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 154 of file triadI.H.
References Vector< Cmpt >::operator=().
Definition at line 160 of file triadI.H.
References x, Tensor< Cmpt >::x(), y, Tensor< Cmpt >::y(), and Tensor< Cmpt >::z().
Add the triad t2 to this triad.
without normalizing or orthogonalizing
Definition at line 177 of file triad.C.
References k, Foam::mag(), triad::set(), Foam::BitOps::set(), and Foam::sign().
|
static |
|
static |
Definition at line 97 of file triad.H.
Referenced by triad::orthogonal(), triad::triad(), and triSurfaceTools::vertexTriads().