triad Class Reference

Representation of a 3D Cartesian coordinate system as a Vector of row vectors. More...

Inheritance diagram for triad:
[legend]
Collaboration diagram for triad:
[legend]

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...
 
Vectoroperator= (const Vector &)=default
 Copy assignment. More...
 
const vectorx () const
 Access to the vector x component. More...
 
vectorx ()
 Access to the vector x component. More...
 
const vectory () const
 Access to the vector y component. More...
 
vectory ()
 Access to the vector y component. More...
 
const vectorz () const
 Access to the vector z component. More...
 
vectorz ()
 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

Istreamoperator>> (Istream &, triad &)
 
Ostreamoperator<< (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...
 

Detailed Description

Representation of a 3D Cartesian coordinate system as a Vector of row vectors.

See also
Foam::quaternion
Source files

Definition at line 64 of file triad.H.

Constructor & Destructor Documentation

◆ triad() [1/7]

triad ( )
inline

Default construct.

Definition at line 31 of file triadI.H.

◆ triad() [2/7]

triad ( const Vector< vector > &  vv)
inline

Construct from components.

Definition at line 37 of file triadI.H.

◆ triad() [3/7]

triad ( const vector x,
const vector y,
const vector z 
)
inline

Construct from coordinate axes (row vectors)

Definition at line 43 of file triadI.H.

◆ triad() [4/7]

triad ( const tensor t)
inline

Construct from a tensor.

Definition at line 49 of file triadI.H.

◆ triad() [5/7]

triad ( const vector pa)
inline

Construct from a primary axis with the other two unset.

Definition at line 55 of file triadI.H.

References triad::unset.

◆ triad() [6/7]

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().

Here is the call graph for this function:

◆ triad() [7/7]

triad ( Istream is)
inline

Construct from Istream.

Definition at line 62 of file triadI.H.

Member Function Documentation

◆ set() [1/2]

bool set ( const direction  d) const
inline

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+=().

Here is the caller graph for this function:

◆ set() [2/2]

bool set ( ) const
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().

Here is the caller graph for this function:

◆ primaryDirection()

Foam::direction primaryDirection ( const vector v)
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().

Here is the call graph for this function:

◆ orthogonal()

Foam::vector orthogonal ( const vector v1,
const vector v2 
)
inlinestatic

Return the vector orthogonal to the two provided.

Definition at line 99 of file triadI.H.

References Foam::mag(), and triad::unset.

Here is the call graph for this function:

◆ orthogonalise()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalise()

void normalise ( )
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().

Here is the caller graph for this function:

◆ align()

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().

Here is the call graph for this function:

◆ sortxyz()

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.

Here is the call graph for this function:

◆ operator quaternion()

operator quaternion ( ) const

Convert to a quaternion.

◆ T()

Foam::triad T ( ) const
inline

Return transpose.

Definition at line 146 of file triadI.H.

◆ cx()

Foam::vector cx ( ) const
inline

Extract vector for column 0.

Definition at line 128 of file triadI.H.

References x, and y.

◆ cy()

Foam::vector cy ( ) const
inline

Extract vector for column 1.

Definition at line 134 of file triadI.H.

References x, and y.

◆ cz()

Foam::vector cz ( ) const
inline

Extract vector for column 2.

Definition at line 140 of file triadI.H.

References x, and y.

◆ operator=() [1/2]

void operator= ( const Vector< vector > &  vv)
inline

Definition at line 154 of file triadI.H.

References Vector< Cmpt >::operator=().

Here is the call graph for this function:

◆ operator=() [2/2]

void operator= ( const tensor t)
inline

Definition at line 160 of file triadI.H.

References x, Tensor< Cmpt >::x(), y, Tensor< Cmpt >::y(), and Tensor< Cmpt >::z().

Here is the call graph for this function:

◆ operator+=()

void operator+= ( const triad t2)

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().

Here is the call graph for this function:

◆ orthogonalize()

void orthogonalize ( )
inline

Same as orthogonalise.

Definition at line 167 of file triad.H.

References triad::orthogonalise().

Here is the call graph for this function:

◆ normalize()

void normalize ( )
inline

Same as normalise.

Definition at line 170 of file triad.H.

References triad::normalise().

Referenced by triSurfaceTools::curvatures().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator>>

Istream & operator>> ( Istream ,
triad  
)
friend

◆ operator<<

Ostream & operator<< ( Ostream ,
const triad  
)
friend

Member Data Documentation

◆ I

const Foam::triad I
static

Definition at line 96 of file triad.H.

◆ unset


The documentation for this class was generated from the following files: