Difference between revisions of "Transform Command"

From OSUPDOCS
Jump to navigation Jump to search
Line 3: Line 3:
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.
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 ==
== Transforming Created Particles in Script Files ==


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:
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:
Line 17: Line 17:


* <math>\mathbf{R}</math> is 2D rotation matrix for rotation about the z axis by specified <tt>(angle)</tt> (in degrees)
* <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>\mathbf{I}</math> is the identity matrix
* <math>\vec O = ((Ox),(Oy))</math> is the origin for the rotation (in length units)
 
* <math>\vec T = ((Tx),(Ty))</math> is a translation (in)
* <math>\vec O = ((Ox),(Oy))</math> is the origin for the rotation (in [[ConsistentUnits Command#Legacy and Consistent Units|length units]])
 
* <math>\vec T = ((Tx),(Ty))</math> is a translation (in [[ConsistentUnits Command#Legacy and Consistent Units|length units]])


Any unspecified parameters will default to zero.
Any unspecified parameters will default to zero.

Revision as of 14:27, 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 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.