Difference between revisions of "Transform Command"
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
A standard [[MPM Region and Hole Commands|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. | A standard [[MPM Region and Hole Commands|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 [[MPM Methods and Simulation Timing#Input Commands|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 == | |||
To transform all particles within the current [[MPM Region and Hole Commands|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>\vec X_p^{(new)} = \vec X_p^{(init)} + (\mathbf{R}-\mathbf{i})(\vec X_p^{(init)} - \vec O) + \vec T</math> | |||
where <math>\mathbf{R}</math> is 2D rotation matrix for rotation about the z axis by specified <tt>(angle)</tt> (in degrees), <math>\mathbf{I}</math> is the identity matrix, <math>\vec O = ((Ox),(Oy))</math> is the origin for the rotation (in length units) and <math>\vec T = ((Tx),(Ty))</math> is a translation (in) |
Revision as of 14:22, 4 October 2018
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
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) and [math]\displaystyle{ \vec T = ((Tx),(Ty)) }[/math] is a translation (in)