Transform Command

From OSUPDOCS
Jump to navigation Jump to search

Introduction

A standard Region command will allocate particles within shapes defined for that region and those particles will by aligned with the grid. Depending on the current number of particle per cell, the command will assign particles to specific locations within cells. The transform options on this page add new options for moving particle away from the standard locations.

Transforming Created Particles in Script Files

To transform all particles within the current Region command when running 2D simulations and using script input, use the command:

Transform (angle),(Tx),(Ty),(Ox),(Oy)

Each particle will be an initial (or "init") location by standard methods as if it was not being transformed and then the location of that particle will change a "new" position defined by

      [math]\displaystyle{ \vec X_p^{(new)} = \vec X_p^{(init)} + (\mathbf{R}-\mathbf{I})(\vec X_p^{(init)} - \vec O) + \vec T }[/math]

where

  • [math]\displaystyle{ \mathbf{R} }[/math] is 2D rotation matrix for rotation about the z axis by specified (angle) (in degrees)
  • [math]\displaystyle{ \mathbf{I} }[/math] is the identity matrix
  • [math]\displaystyle{ \vec O = ((Ox),(Oy)) }[/math] is the origin for the rotation (in length units)
  • [math]\displaystyle{ \vec T = ((Tx),(Ty)) }[/math] is a translation (in length units)

Any unspecified parameters will default to zero.

In script files for 3D simulations, this command allows four additional parameters

Transform (angle),(Tx),(Ty),(Ox),(Oy),(angle2),(angle3),(Tz),(Oz)

The transformation equation is the same ad defined above in 2D, but not the rotation matrix, [math]\displaystyle{ \mathbf{R} }[/math] is for rotation using 3D Euler angles corresponding to rotation about z axis by (angle), rotation about y axis by (angle2), and last rotation about z axis by (angle3) (all in degrees). The (Tz) and Oz add z components to the translation and rotation origin vectors.