Loading...
Searching...
No Matches
axes Class Reference

A coordinateRotation specified using global axes. More...

#include <axesRotation.H>

Inheritance diagram for axes:
Collaboration diagram for axes:

Public Types

enum  axisOrder { E1_E2 , E2_E3 , E3_E1 , E3_E1_COMPAT }
 The order/combination of local axes for the axes-rotation definition. More...

Public Member Functions

 TypeNameNoDebug ("axes")
 Runtime type information.
 axes ()
 Default construct - an identity transform.
 axes (const axes &crot)
 Copy construct.
 axes (const vector &axis1, const vector &axis2, axisOrder order=E3_E1)
 Construct from two axes.
 axes (const vector &axis)
 Construct from a single axis (as e3) using a best-guess for the second axis.
 axes (const dictionary &dict)
 Construct from dictionary.
autoPtr< coordinateRotationclone () const
 Return clone.
virtual ~axes ()=default
 Destructor.
virtual void clear ()
 Reset specification.
virtual tensor R () const
 The rotation tensor calculated from the specified axes and order.
virtual void write (Ostream &os) const
 Write information.
virtual void writeEntry (const word &keyword, Ostream &os) const
 Write dictionary entry.
Public Member Functions inherited from coordinateRotation
 TypeNameNoDebug ("coordinateRotation")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, coordinateRotation, dictionary,(const dictionary &dict),(dict))
virtual ~coordinateRotation ()=default
 Destructor.

Static Public Member Functions

static tensor rotation (const vector &axis1, const vector &axis2, axisOrder order=E3_E1)
 The rotation tensor calculated from two axes and their order.
Static Public Member Functions inherited from coordinateRotation
template<class Derived>
static autoPtr< coordinateRotationClone (const Derived &crot)
 Clone a coordinate rotation.
static autoPtr< coordinateRotationNew (const word &modelType, const dictionary &dict)
 Select construct the specified coordinate rotation type.
static autoPtr< coordinateRotationNew (const dictionary &dict)
 Select construct from dictionary (requires the "type" entry).

Protected Member Functions

void read (const dictionary &dict)
 Read from dictionary.

Protected Attributes

vector axis1_
 The primary axis.
vector axis2_
 The secondary axis.
axisOrder order_
 The axis order.

Additional Inherited Members

Static Protected Member Functions inherited from coordinateRotation
static vector findOrthogonal (const vector &axis)
 Determine best-guess for an orthogonal axis.

Detailed Description

A coordinateRotation specified using global axes.

The rotation is defined by a combination of vectors (e1/e2), (e2/e3) or (e3/e1). Any nonorthogonality is absorbed into the second vector.

rotation
{
    type        axes;
    e1          (1 0 0);
    e2          (0 1 0);
}


Dictionary entries

Property Description Reqd Default
type Type name: axes yes
e1 local x-axis partly
e2 local y-axis partly
e3 local z-axis partly
Note
It is also possible to specify in terms of axis and direction. For cylindrical coordinates, the axis would correspond to the z-axis and the direction to the r-axis. Also accepts "axesRotation" (OpenFOAM-v1806) for the type.
Source files

Definition at line 101 of file axesRotation.H.

Member Enumeration Documentation

◆ axisOrder

enum axisOrder

The order/combination of local axes for the axes-rotation definition.

Note that these follow the right-hand rule.

Enumerator
E1_E2 

The axis1 (dominant) is local X, axis2 is local Y.

E2_E3 

The axis1 (dominant) is local Y, axis2 is local Z.

E3_E1 

The axis1 (dominant) is local Z, axis2 is local X.

E3_E1_COMPAT 

E3_E1 specified as axis/direction.

Definition at line 112 of file axesRotation.H.

Constructor & Destructor Documentation

◆ axes() [1/5]

axes ( )

Default construct - an identity transform.

Definition at line 198 of file axesRotation.C.

References axis1_, axis2_, E3_E1, and order_.

Referenced by axes(), axes(), axes(), cylindrical::cylindrical(), cylindrical::cylindrical(), and TypeNameNoDebug().

Here is the caller graph for this function:

◆ axes() [2/5]

axes ( const axes & crot)

Copy construct.

Definition at line 207 of file axesRotation.C.

References axes(), axis1_, axis2_, and order_.

Here is the call graph for this function:

◆ axes() [3/5]

axes ( const vector & axis1,
const vector & axis2,
axisOrder order = E3_E1 )

Construct from two axes.

Definition at line 216 of file axesRotation.C.

References axis1_, axis2_, and order_.

◆ axes() [4/5]

axes ( const vector & axis)
explicit

Construct from a single axis (as e3) using a best-guess for the second axis.

The largest component and its sign are used when guessing an appropriate orientation (direction).

Definition at line 230 of file axesRotation.C.

References axes(), E3_E1_COMPAT, and Foam::Zero.

Here is the call graph for this function:

◆ axes() [5/5]

axes ( const dictionary & dict)
explicit

Construct from dictionary.

Definition at line 236 of file axesRotation.C.

References axes(), dict, and read().

Here is the call graph for this function:

◆ ~axes()

virtual ~axes ( )
virtualdefault

Destructor.

References E3_E1, and os().

Here is the call graph for this function:

Member Function Documentation

◆ read()

void read ( const dictionary & dict)
protected

Read from dictionary.

Definition at line 153 of file axesRotation.C.

References axis1_, axis2_, dict, E1_E2, E2_E3, E3_E1, E3_E1_COMPAT, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, and order_.

Referenced by axes().

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

◆ TypeNameNoDebug()

TypeNameNoDebug ( "axes" )

Runtime type information.

References axes(), dict, and E3_E1.

Here is the call graph for this function:

◆ clone()

autoPtr< coordinateRotation > clone ( ) const
inlinevirtual

Return clone.

Implements coordinateRotation.

Reimplemented in cylindrical.

Definition at line 191 of file axesRotation.H.

References coordinateRotation::Clone().

Here is the call graph for this function:

◆ rotation()

Foam::tensor rotation ( const vector & axis1,
const vector & axis2,
axisOrder order = E3_E1 )
static

The rotation tensor calculated from two axes and their order.

The input axes will be normalised. If axis2 is zero, an axis orthogonal to axis1 will be guessed. The largest component and its sign are used when guessing an appropriate orientation (direction).

Definition at line 61 of file axesRotation.C.

References Foam::abort(), Tensor< Cmpt >::col(), E1_E2, E2_E3, E3_E1, E3_E1_COMPAT, Foam::endl(), Foam::FatalError, FatalErrorInFunction, coordinateRotation::findOrthogonal(), Foam::mag(), Foam::nl, Vector< Cmpt >::removeCollinear(), and WarningInFunction.

Referenced by R(), and cylindrical::rotation().

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

◆ clear()

void clear ( )
virtual

Reset specification.

Implements coordinateRotation.

Definition at line 246 of file axesRotation.C.

References axis1_, axis2_, E3_E1, and order_.

◆ R()

Foam::tensor R ( ) const
virtual

The rotation tensor calculated from the specified axes and order.

Implements coordinateRotation.

Definition at line 254 of file axesRotation.C.

References axis1_, axis2_, order_, and rotation().

Here is the call graph for this function:

◆ write()

void write ( Ostream & os) const
virtual

Write information.

Implements coordinateRotation.

Reimplemented in cylindrical.

Definition at line 262 of file axesRotation.C.

References axis1_, axis2_, E1_E2, E2_E3, E3_E1, E3_E1_COMPAT, order_, and os().

Here is the call graph for this function:

◆ writeEntry()

void writeEntry ( const word & keyword,
Ostream & os ) const
virtual

Write dictionary entry.

Implements coordinateRotation.

Reimplemented in cylindrical.

Definition at line 282 of file axesRotation.C.

References axis1_, axis2_, E1_E2, E2_E3, E3_E1, E3_E1_COMPAT, order_, os(), and Foam::type().

Here is the call graph for this function:

Member Data Documentation

◆ axis1_

vector axis1_
protected

The primary axis.

Definition at line 128 of file axesRotation.H.

Referenced by axes(), axes(), axes(), clear(), R(), read(), write(), cylindrical::write(), writeEntry(), and cylindrical::writeEntry().

◆ axis2_

vector axis2_
protected

The secondary axis.

Definition at line 133 of file axesRotation.H.

Referenced by axes(), axes(), axes(), clear(), R(), read(), write(), and writeEntry().

◆ order_

axisOrder order_
protected

The axis order.

Definition at line 138 of file axesRotation.H.

Referenced by axes(), axes(), axes(), clear(), R(), read(), write(), and writeEntry().


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