# RigidMotion: compute/define rigid motions

## Version: 2.5 (20/09/2017)

## Author: Onera

### Preamble

RigidMotion enables to define or compute rigid motions for
arrays (as defined in Converter documentation) or for
CGSN/Python trees (pyTrees).

This module is part of Cassiopee, a free open-source
pre- and post-processor for CFD simulations.

To use it with the Converter array interface, you must import the
RigidMotion module:
import RigidMotion as R

Then, in the following, a is an array, and A a list of arrays.

To use it with the pyTree interface, you must import the module:
import RigidMotion.PyTree as R

Then, in the following, a is a zone node and A is a list of zone nodes
or a complete pyTree.

### Prescribed motion of type 1

**R.setPrescribedMotion1**:
set a precribed motion defined by a translation of the origin (tx,ty,tz),
the center of a rotation (cx,cy,cz), the second point of the rotation
axis (ex,ey,ez) and the rotation angle in degrees.
They can depend on time {t}:
a = R.setPrescribedMotion1(a, motionName, tx="0", ty="0", tz="0",
cx="0", cy="0", cz="0", ex="0", ey="0", ez="0", angle="0")

*Example of use: * set a prescribed motion (pyTree).

**R.setPrescribedMotion2**:
set a precribed motion defined by a elsA rotor motion:
a = R.setPrescribedMotion2(a, motionName, transl_speed,
psi0, psi0_b,
alp_pnt, alp_vct, alp0,
rot_pnt, rot_vct, rot_omg,
del_pnt, del_vct, del0, delc, dels,
bet_pnt, bet_vct, bet0, betc, bets,
tet_pnt, tet_vct, tet0, tetc, tets,
span_vct,
pre_lag_pnt, pre_lag_vct, pre_lag_ang,
pre_con_pnt, pre_con_vct, pre_con_ang)

*Example of use: * set a prescribed motion (pyTree).

**R.setPrescribedMotion3**:
set a precribed motion defined by a constant speed
rotation and translation. omega is in rad/time unit:
a = R.setPrescribedMotion3(a, motionName, transl_speed,
axis_pnt, axis_vct, omega)

*Example of use: * set a prescribed motion (pyTree).

### General functions

**R.evalPosition**:
evaluate the position at time t according to a motion.

If the motion is defined in a:
a = R.evalPosition(a, time)

Eval position at given time, when motion is described by a function.
F(t) is a function describing motion.
F(t) = (centerAbs(t), centerRel(t), rot(t)), where
centerAbs(t) are the coordinates of the rotation center in the absolute
frame, centerRel(t) are the coordinates of the rotation center in the
relative (that is array's) frame and rot(t), the rotation matrix:
b = R.evalPosition(a, time, F) *.or.* B = R.evalPosition(A, time, F)

*Example of use: * evaluate zone position (pyTree).

*Example of use: * evaluate array position from function (array),
evaluate zone position from function (pyTree).

Return to main userguide