CG  Version 25
Public Types | Public Member Functions | List of all members
MatrixMotion Class Reference

This class knows how to rotate around a line in space or translate along a line. More...

#include <MatrixMotion.h>

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

Public Types

enum  MotionTypeEnum { rotateAroundALine, translateAlongALine }
 

Public Member Functions

 MatrixMotion ()
 Constructor: this class knows how to rotate around a line in space or translate along a line.
 
 MatrixMotion (const MatrixMotion &mm, const CopyType ct=DEEP)
 Copy constructor.
 
 ~MatrixMotion ()
 Destructor.
 
MatrixMotionoperator= (const MatrixMotion &mm)
 Equals operator. Set this object to be equal to another.
 
int getMotion (const real &t, RealArray &r)
 : Determine the motion matrix at time t
 
int getMotion (const real &t, RealArray &r, RealArray &rp, int derivative, bool computeComposed=true)
 Evaluate the motion matrix and an arbitrary time derivative.
 
int setLine (const real *x0, const real *v, const MotionTypeEnum motion=rotateAroundALine)
 Define the line of rotation or line of translation from a point on the line and the tangent.
 
int setMotionType (const MotionTypeEnum motion)
 Set the type of the motion.
 
int compose (MatrixMotion *motion)
 Compose this MatrixMotion with another which is applied first.
 
int update (GenericGraphicsInterface &gi)
 Interactively update MatrixMotion parameters:
 
int get (const GenericDataBase &dir, const aString &name)
 Get from a data base file.
 
int put (GenericDataBase &dir, const aString &name) const
 Put to a data base file.
 

Detailed Description

This class knows how to rotate around a line in space or translate along a line.

Member Enumeration Documentation

Enumerator
rotateAroundALine 
translateAlongALine 

Constructor & Destructor Documentation

MatrixMotion::MatrixMotion ( )

Constructor: this class knows how to rotate around a line in space or translate along a line.

Motions are of the form of a rotation and translation: x(t) = R(t) * x(0) + g(t) where R(t) is a 3x3 matrix and g(t) is a 3-vector.

References rotateAroundALine, and TimeFunction::setLinearFunction().

Referenced by get(), operator=(), and update().

MatrixMotion::MatrixMotion ( const MatrixMotion mm,
const CopyType  ct = DEEP 
)

Copy constructor.

MatrixMotion::~MatrixMotion ( )

Destructor.

Member Function Documentation

int MatrixMotion::compose ( MatrixMotion motion)

Compose this MatrixMotion with another which is applied first.

Parameters
motion(input) : apply this MatrixMotion before the current. (set to NULL for none)

Referenced by getMotion(), and main().

int MatrixMotion::get ( const GenericDataBase &  dir,
const aString &  name 
)

Get from a data base file.

References get(), TimeFunction::get(), and MatrixMotion().

Referenced by get(), and MovingGrids::get().

int MatrixMotion::getMotion ( const real &  t,
RealArray &  r 
)

: Determine the motion matrix at time t

x(t) = R(t) * x(0) + g(t)

Parameters
r(0:2,0:3): 3x4 matrix holding the rotation matrix and shift:

R = r(0:2,0;3) : 3x3 rotation matrix g = r(0:2,3) : 3 vector "shift"

Referenced by MovingGrids::getBoundaryAcceleration(), getGridMotion(), MovingGrids::getGridVelocity(), getMotion(), MovingGrids::gridAccelerationBC(), main(), and MovingGrids::moveGrids().

int MatrixMotion::getMotion ( const real &  t,
RealArray &  r,
RealArray &  rp,
int  derivative,
bool  computeComposed = true 
)

Evaluate the motion matrix and an arbitrary time derivative.

Parameters
t(input) : time to evaluate the motion
r(output) : matrix
rp(output) : holds the "derivative" time derivative of r
derivative(input) : if derivative>0 then evaluate this time derivative
computeComposed(input) : if true (default) then evaluate the composed motion, otherwise just evaluate the un-composed mapping.

References compose(), TimeFunction::eval(), TimeFunction::evalDerivative(), getMotion(), i, I3, j, k, OV_ABORT(), printF(), r, rotateAroundALine, theta, and translateAlongALine.

MatrixMotion & MatrixMotion::operator= ( const MatrixMotion mm)

Equals operator. Set this object to be equal to another.

References i, and MatrixMotion().

int MatrixMotion::put ( GenericDataBase &  dir,
const aString &  name 
) const

Put to a data base file.

References put(), and TimeFunction::put().

Referenced by put().

int MatrixMotion::setLine ( const real *  x0_,
const real *  v_,
const MotionTypeEnum  motion = rotateAroundALine 
)

Define the line of rotation or line of translation from a point on the line and the tangent.

Parameters
x0(input) : x0[0:2] is a point on the line
v(input) : v[0:2] is the tangent to the line
motion(input) : set the motion type, default=rotateAroundALine

References i, and printF().

int MatrixMotion::setMotionType ( const MotionTypeEnum  motion)

Set the type of the motion.

Parameters
moition(input) : set the motion type to this value.
int MatrixMotion::update ( GenericGraphicsInterface &  gi)

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