Representation of a 3D Cartesian coordinate system as a Vector of row vectors. More...
Public Member Functions | |
triad () | |
Default construct. 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 |
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 (const scalar tol=ROOTVSMALL) |
Inplace normalise the vector by its magnitude. More... | |
Vector< vector > & | removeCollinear (const Vector< vector > &unitVec) |
const Vector< vector > & | centre (const Foam::UList< Vector< vector > > &) const |
Return *this (used for point which is a typedef to Vector<scalar>. More... | |
Public Member Functions inherited from VectorSpace< Form, Cmpt, Ncmpts > | |
VectorSpace ()=default | |
Default construct. More... | |
VectorSpace (const Foam::zero) | |
Construct initialized to zero. More... | |
VectorSpace (const VectorSpace< Form, Cmpt, Ncmpts > &vs) | |
Copy construct. More... | |
template<class Form2 , class Cmpt2 > | |
VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &) | |
Copy construct of a VectorSpace with the same size. More... | |
VectorSpace (Istream &is) | |
Construct from Istream. More... | |
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. More... | |
Cmpt * | data () noexcept |
Return pointer to the first data element. More... | |
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 > &) |
void | operator= (const Foam::zero) |
void | operator*= (const scalar) |
void | operator/= (const scalar) |
iterator | begin () noexcept |
Return an iterator to begin of VectorSpace. More... | |
iterator | end () noexcept |
Return an 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... | |
const_iterator | begin () const noexcept |
Return const_iterator to begin of VectorSpace. More... | |
const_iterator | end () const noexcept |
Return const_iterator to end of VectorSpace. More... | |
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. 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 VectorSpace< Form, Cmpt, Ncmpts > | |
static constexpr direction | size () noexcept |
The number of elements in the VectorSpace = Ncmpts. More... | |
static Form | uniform (const Cmpt &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< Form, Cmpt, Ncmpts > | |
static constexpr direction | dim = 3 |
Dimensionality of space. More... | |
static constexpr direction | nComponents = Ncmpts |
Number of components in this vector space. More... | |
static constexpr direction | mRows = Ncmpts |
static constexpr direction | nCols = 1 |
static const char *const | typeName = "diagTensor" |
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 > | |
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< Form, Cmpt, Ncmpts > | |
typedef VectorSpace< Form, Cmpt, Ncmpts > | vsType |
VectorSpace type. More... | |
typedef Cmpt | cmptType |
Component type. More... | |
typedef Cmpt | magType |
Magnitude type. More... | |
typedef Cmpt * | iterator |
Random access iterator for traversing VectorSpace. More... | |
typedef const Cmpt * | const_iterator |
Random access iterator for traversing VectorSpace. More... | |
Public Attributes inherited from VectorSpace< Form, Cmpt, Ncmpts > | |
Cmpt | 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 >::x(), Vector< vector >::x(), Tensor< Cmpt >::y(), Vector< vector >::y(), Tensor< 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.
Referenced by argList::parse(), addstopAtWriteNowSignalToOpt::readData(), addwriteNowSignalToOpt::readData(), sigFpe::ignore::restore(), PtrListDictionary< phaseModel >::set(), PtrListDictionary< T >::set(), cellZoneSet::updateSet(), faceZoneSet::updateSet(), and pointZoneSet::updateSet().
|
inlinestatic |
Return the primary direction of the vector v.
Definition at line 82 of file triadI.H.
References Foam::mag(), RowVector< Cmpt >::X, Vector< Cmpt >::x(), RowVector< Cmpt >::Y, Vector< Cmpt >::y(), RowVector< Cmpt >::Z, and Vector< Cmpt >::z().
|
inlinestatic |
Return the vector orthogonal to the two provided.
Definition at line 99 of file triadI.H.
References Foam::mag(), and triad::unset.
void orthogonalise | ( | ) |
Inplace orthogonalise so that it is ortho-normal.
Definition at line 102 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 120 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 240 of file triad.C.
References Foam::mag(), R, Foam::rotationTensor(), 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(), 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 normalising or orthogonalising
Definition at line 177 of file triad.C.
References k, Foam::mag(), triad::set(), and Foam::sign().
|
inline |
Same as orthogonalise.
Definition at line 167 of file triad.H.
References triad::orthogonalise().
|
inline |
Same as normalise.
Definition at line 170 of file triad.H.
References triad::normalise().
Referenced by triSurfaceTools::curvatures().
|
static |
|
static |
Definition at line 97 of file triad.H.
Referenced by sigFpe::ignore::ignore(), triad::orthogonal(), triad::triad(), topoBitSet::unset(), topoBoolSet::unset(), and triSurfaceTools::vertexTriads().