Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
triad Class Reference

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

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

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. 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 (const tensor &t)
 Construct from a tensor. 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...
 
void operator= (const Vector< vector > &)
 
void operator= (const tensor &t)
 
void operator+= (const triad &t2)
 Add the triad t2 to this triad. More...
 
- Public Member Functions inherited from Vector< vector >
 Vector ()
 Construct null. More...
 
 Vector (const VectorSpace< Vector< Cmpt2 >, Cmpt2, 3 > &)
 Construct given VectorSpace of the same rank. More...
 
 Vector (const vector &vx, const vector &vy, const vector &vz)
 Construct given three components. More...
 
 Vector (Istream &)
 Construct from Istream. More...
 
const vectorx () const
 
vectorx ()
 
const vectory () const
 
vectory ()
 
const vectorz () const
 
vectorz ()
 
const Vector< vector > & centre (const Foam::List< Vector< vector > > &) const
 Return *this (used for point which is a typedef to Vector<scalar>. More...
 
- Public Member Functions inherited from VectorSpace< Vector< vector >, vector, 3 >
 VectorSpace ()
 Construct null. More...
 
 VectorSpace (Istream &)
 Construct from Istream. More...
 
 VectorSpace (const VectorSpace< Vector< vector >, vector, nCmpt > &)
 Construct as copy. More...
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, nCmpt > &)
 Construct as copy of another VectorSpace type of the same rank. More...
 
label size () const
 Return the number of elements in the VectorSpace = nCmpt. More...
 
const vectorcomponent (const direction) const
 
vectorcomponent (const direction)
 
void component (vector &, const direction) const
 
void replace (const direction, const vector &)
 
const vectoroperator[] (const direction) const
 
vectoroperator[] (const direction)
 
void operator= (const VectorSpace< Vector< vector >, vector, nCmpt > &)
 
void operator+= (const VectorSpace< Vector< vector >, vector, nCmpt > &)
 
void operator-= (const VectorSpace< Vector< vector >, vector, nCmpt > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 

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 Attributes

static const triad zero
 
static const triad one
 
static const triad max
 
static const triad min
 
static const triad rootMax
 
static const triad rootMin
 
static const triad I
 
static const triad unset
 
- Static Public Attributes inherited from Vector< vector >
static const char *const typeName
 
static const char * componentNames []
 
static const Vector zero
 
static const Vector one
 
static const Vector max
 
static const Vector min
 
static const Vector rootMax
 
static const Vector rootMin
 

Friends

Istreamoperator>> (Istream &, triad &)
 
Ostreamoperator<< (Ostream &, const triad &)
 

Additional Inherited Members

- Public Types inherited from Vector< vector >
enum  
 
enum  components
 Component labeling enumeration. More...
 
typedef Vector< labellabelType
 Equivalent type of labels used for valid component indexing. More...
 
- Public Types inherited from VectorSpace< Vector< vector >, vector, 3 >
enum  
 
typedef vector cmptType
 Component type. More...
 
- Public Attributes inherited from VectorSpace< Vector< vector >, vector, 3 >
vector v_ [nCmpt]
 The components of this vector space. More...
 

Detailed Description

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

See also
Foam::quaternion
Source files

Definition at line 65 of file triad.H.

Constructor & Destructor Documentation

triad ( )
inline

Construct null.

Definition at line 28 of file triadI.H.

triad ( const Vector< vector > &  vv)
inline

Construct from components.

Definition at line 34 of file triadI.H.

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

Construct from coordinate axes.

Definition at line 40 of file triadI.H.

triad ( const vector pa)
inline

Construct from a primary axis with the other two unset.

Definition at line 46 of file triadI.H.

References triad::operator=(), VectorSpace< Vector< vector >, vector, 3 >::operator[](), triad::primaryDirection(), and triad::unset.

Here is the call graph for this function:

triad ( const quaternion q)

Construct from a quaternion.

Definition at line 102 of file triad.C.

References quaternion::R(), Tensor< Cmpt >::T(), x, and y.

Here is the call graph for this function:

triad ( const tensor t)

Construct from a tensor.

Definition at line 111 of file triad.C.

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

Here is the call graph for this function:

triad ( Istream is)
inline

Construct from Istream.

Definition at line 53 of file triadI.H.

Member Function Documentation

bool set ( const direction  d) const
inline

Is the vector in the direction d set.

Definition at line 61 of file triadI.H.

References VectorSpace< Vector< vector >, vector, 3 >::operator[]().

Referenced by Foam::diff(), and triad::operator+=().

Here is the call graph for this function:

Here is the caller graph for this function:

bool set ( ) const
inline

Are all the vector set.

Definition at line 67 of file triadI.H.

Foam::direction primaryDirection ( const vector v)
inlinestatic

Return the primary direction of the vector v.

Definition at line 73 of file triadI.H.

References Foam::mag(), triad::orthogonal(), Vector< vector >::X, Vector< Cmpt >::x(), Vector< vector >::Y, Vector< Cmpt >::y(), Vector< vector >::Z, and Vector< Cmpt >::z().

Referenced by triad::triad().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Return the vector orthogonal to the two provided.

Definition at line 91 of file triadI.H.

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

Referenced by triad::primaryDirection().

Here is the call graph for this function:

Here is the caller graph for this function:

void orthogonalize ( )

Orthogonalize this triad so that it is ortho-normal.

Definition at line 121 of file triad.C.

References Foam::mag().

Here is the call graph for this function:

void normalize ( )
inline

Normalize each set axis vector to have a unit magnitude.

Definition at line 111 of file triadI.H.

References Foam::mag(), and VectorSpace< Vector< vector >, vector, 3 >::operator[]().

Here is the call graph for this function:

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 259 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:

Foam::triad sortxyz ( ) const

Sort the axes such that they are closest to the x, y and z axes.

Definition at line 304 of file triad.C.

References Foam::mag(), VectorSpace< Vector< vector >, vector, 3 >::operator, R, x, Tensor< Cmpt >::xx(), Tensor< Cmpt >::xy(), Tensor< Cmpt >::xz(), y, Tensor< Cmpt >::yx(), Tensor< Cmpt >::yy(), Tensor< Cmpt >::yz(), Tensor< Cmpt >::zx(), Tensor< Cmpt >::zy(), and Tensor< Cmpt >::zz().

Referenced by Foam::diff().

Here is the call graph for this function:

Here is the caller graph for this function:

operator quaternion ( ) const

Convert to a quaternion.

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

Definition at line 121 of file triadI.H.

References VectorSpace< Vector< Cmpt >, Cmpt, 3 >::operator=().

Referenced by triad::triad().

Here is the call graph for this function:

Here is the caller graph for this function:

void operator= ( const tensor t)

Definition at line 397 of file triad.C.

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

Here is the call graph for this function:

void operator+= ( const triad t2)

Add the triad t2 to this triad.

without normalizing or orthogonalizing

Definition at line 196 of file triad.C.

References k, Foam::mag(), triad::set(), and Foam::sign().

Here is the call graph for this function:

Friends And Related Function Documentation

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

Member Data Documentation

const triad zero
static

Definition at line 98 of file triad.H.

const triad one
static

Definition at line 99 of file triad.H.

const triad max
static

Definition at line 100 of file triad.H.

const triad min
static

Definition at line 101 of file triad.H.

const triad rootMax
static

Definition at line 102 of file triad.H.

const triad rootMin
static

Definition at line 103 of file triad.H.

const triad I
static

Definition at line 104 of file triad.H.

const triad unset
static

Definition at line 105 of file triad.H.

Referenced by triad::orthogonal(), and triad::triad().


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