AQUAgpusph 4.1.2
Loading...
Searching...
No Matches
Functions
UnTransform.cl File Reference

Euler-XYZ based untransformation script. More...

#include "resources/Scripts/types/types.h"
Include dependency graph for UnTransform.cl:

Functions

__kernel void entry (const __global uint *iset, const __global int *imove, __global vec *r, __global vec *normal, __global vec *tangent, unsigned int N, unsigned int motion_iset, vec motion_r_in, vec4 motion_a_in)
 Untransform the previously applied EulerXYZ motion.
 

Detailed Description

Euler-XYZ based untransformation script.

Function Documentation

◆ entry()

__kernel void entry ( const __global uint *  iset,
const __global int *  imove,
__global vec r,
__global vec normal,
__global vec tangent,
unsigned int  N,
unsigned int  motion_iset,
vec  motion_r_in,
vec4  motion_a_in 
)

Untransform the previously applied EulerXYZ motion.

Just the position and the normal of the particle are modified, but not the velocity which is changed by MotionVelocity.cl.

In EulerXYZ the following transformation is applied to a particle \( a \):

\[ R_z \cdot R_y \cdot R_x \cdot \mathbf{x_a} + \mathbf{cor}, \]

where \( \mathbf{cor} \) is the position of the center of rotation (global translations), and \( R_x, R_y, R_z \) are the rotation matrices:

\[ R_x = \left[ \begin{matrix} 1 & 0 & 0 \\ 0 & \mathrm{cos}(\phi) & -\mathrm{sin}(\phi) \\ 0 & \mathrm{sin}(\phi) & \mathrm{cos}(\phi) \\ \end{matrix} \right], \]

\[ R_y = \left[ \begin{matrix} \mathrm{cos}(\theta) & 0 & \mathrm{sin}(\theta) \\ 0 & 1 & 0 \\ -\mathrm{sin}(\theta) & 0 & \mathrm{cos}(\theta) \\ \end{matrix} \right], \]

\[ R_z = \left[ \begin{matrix} \mathrm{cos}(\psi) & -\mathrm{sin}(\psi) & 0 \\ \mathrm{sin}(\psi) & \mathrm{cos}(\psi) & 0 \\ 0 & 0 & 1 \\ \end{matrix} \right]. \]

Therefore to invert the transformation the following expression can be applied:

\[ R_x^{-1} \cdot R_y^{-1} \cdot R_z^{-1} \cdot \left(\mathbf{x_a} - \mathbf{cor}\right), \]

where the inverse rotation matrices are obtained just using \( -\phi, -\theta, -\psi \) angles.

Parameters
isetSet of particles index.
imoveMoving flags.
  • imove > 0 for regular fluid particles.
  • imove = 0 for sensors.
  • imove < 0 for boundary elements/particles.
rPosition \( \mathbf{r} \).
normalNormal \( \mathbf{n} \).
NNumber of particles.
motion_isetSet of particles affected.
motion_r_inCenter of rotation.
motion_a_inRotation angles \( \phi, \theta, \psi \).
See also
MotionTransform.cl