AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
Mirror.cl File Reference

Mirroring process for the symmetry boundary condition. More...

Include dependency graph for Mirror.cl:

Functions

__kernel void drop (__global int *imove, __global vec *r, usize N, vec symmetry_r, vec symmetry_n, vec domain_max)
 Remove the particles at the other side of the mirror.
__kernel void detect (const __global int *imove, const __global vec *r_in, __global unsigned int *imirror, usize N, vec symmetry_r, vec symmetry_n)
 Detect the particles to be mirrored.
vec_xyz reflection (vec_xyz u, vec_xyz n)
__kernel void feed (__global int *imove, __global int *iset, const __global unsigned int *imirror, const __global usize *imirror_invperm, __global usize *mirror_src, __global vec *normal, __global vec *tangent, __global vec *r_in, usize N, usize nbuffer, vec symmetry_r, vec symmetry_n)
 Mirror the particles marked with a flag imirror = 1.
__kernel void set (const __global usize *mirror_src, __global float *m, __global vec *u_in, __global vec *dudt_in, __global vec *dudt, __global float *rho_in, __global float *drhodt_in, __global float *drhodt, usize N, vec symmetry_r, vec symmetry_n)
 Set the fields of the mirrored particles.
__kernel void sort (const __global usize *mirror_src_in, __global usize *mirror_src, const __global usize *id_sorted, usize N)
 Sort the sources of the mirrored particles.

Detailed Description

Mirroring process for the symmetry boundary condition.

Function Documentation

◆ detect()

__kernel void detect ( const __global int * imove,
const __global vec * r_in,
__global unsigned int * imirror,
usize N,
vec symmetry_r,
vec symmetry_n )

Detect the particles to be mirrored.

The mirroring particles (the ones close enough to the symmetry plane) will be marked with imirror = 1.

Parameters
imoveMoving flags.
  • imove > 0 for regular fluid particles.
  • imove = 0 for sensors.
  • imove < 0 for boundary elements/particles.
r_inPosition \( \mathbf{r} \).
imirror0 if the particle has not been mirrored, 1 otherwise.
NNumber of particles.
symmetry_rPosition of the symmetry plane.
symmetry_nNormal of the symmetry plane. It is assumed as normalized.

◆ drop()

__kernel void drop ( __global int * imove,
__global vec * r,
usize N,
vec symmetry_r,
vec symmetry_n,
vec domain_max )

Remove the particles at the other side of the mirror.

Parameters
imoveMoving flags.
  • imove > 0 for regular fluid particles.
  • imove = 0 for sensors.
  • imove < 0 for boundary elements/particles.
rPosition \( \mathbf{r} \).
NNumber of particles.
symmetry_rPosition of the symmetry plane.
symmetry_nNormal of the symmetry plane. It is assumed as normalized.
domain_maxTop-right-back corner of the computational domain.

◆ feed()

__kernel void feed ( __global int * imove,
__global int * iset,
const __global unsigned int * imirror,
const __global usize * imirror_invperm,
__global usize * mirror_src,
__global vec * normal,
__global vec * tangent,
__global vec * r_in,
usize N,
usize nbuffer,
vec symmetry_r,
vec symmetry_n )

Mirror the particles marked with a flag imirror = 1.

The mirrored particles will keep track of the source particle with the array mirror_source

Parameters
imoveMoving flags.
  • imove > 0 for regular fluid/solid particles.
  • imove = 0 for sensors.
  • imove < 0 for boundary elements/particles.
isetIndex of the set of particles.
imirror0 if the particle should not be mirrored, 1 otherwise.
imirror_invpermPermutation to find the index of the particle in the list of particles to become split.
mirror_srcSource particle associated with each mirrored one.
normalNormal, \( \mathbf{n} \).
tangentTangent, \( \mathbf{t} \).
r_inPosition \( \mathbf{r} \).
NNumber of particles.
nbufferNumber of available buffer particles.
symmetry_rPosition of the symmetry plane.
symmetry_nNormal of the symmetry plane. It is assumed as normalized.
Here is the call graph for this function:

◆ reflection()

vec_xyz reflection ( vec_xyz u,
vec_xyz n )

Reflection vector.

The deflection vector is defined as follows:

\( \mathbf{v}(\mathbf{u}, \mathbf{n}) = -2 \left( \mathbf{u} \cdot \mathbf{n} \right) \mathbf{n} \)

where \(\mathbf{u}\) is the vector to become deflected, \(\mathbf{n}\) is the reflection plane normal, and \(\mathbf{v}\) is the deflection vector, which added to the original vector returns its reflected version.

Note
The input vector should be relative to the symmetry plane. That's important in case of position vectors, from which an arbitrary point of the plane should be substracted

◆ set()

__kernel void set ( const __global usize * mirror_src,
__global float * m,
__global vec * u_in,
__global vec * dudt_in,
__global vec * dudt,
__global float * rho_in,
__global float * drhodt_in,
__global float * drhodt,
usize N,
vec symmetry_r,
vec symmetry_n )

Set the fields of the mirrored particles.

Parameters
mirror_srcSource particle associated with each mirrored one.
mMass, \( m \).
u_inVelocity \( \mathbf{u} \).
dudt_inVelocity rate of change \( \frac{d \mathbf{u}}{d t} \).
dudtVelocity rate of change \( \frac{d \mathbf{u}}{d t} \).
rho_inDensity \( \rho \).
drhodt_inDensity rate of change \( \frac{d \rho}{d t} \).
drhodtDensity rate of change \( \frac{d \rho}{d t} \).
NNumber of particles.
symmetry_rPosition of the symmetry plane.
symmetry_nNormal of the symmetry plane. It is assumed as normalized.
Here is the call graph for this function:

◆ sort()

__kernel void sort ( const __global usize * mirror_src_in,
__global usize * mirror_src,
const __global usize * id_sorted,
usize N )

Sort the sources of the mirrored particles.

Parameters
mirror_src_inUnsorted sources
mirror_srcSorted sources
id_sortedPermutations list from the unsorted space to the sorted one.
NNumber of particles.