35#ifndef __LPT_WALL_COLLISION_KERNEL_H__
36#define __LPT_WALL_COLLISION_KERNEL_H__
48 return (
i - 1) + lx * ((
j - 1) + ly * ((
k - 1) + lz * (
e - 1)));
54 return (facet - 1) +
n_facets * (el - 1);
63 return sqrt(
x *
x + y * y + z * z);
135 coef_get_normal_device(nx, ny, nz, 1,
jc,
kc, el, facet, lx,
normal_x,
140 coef_get_normal_device(nx, ny, nz,
ic, 1,
kc, el, facet, lx,
normal_x,
145 coef_get_normal_device(nx, ny, nz,
ic,
jc, 1, el, facet, lx,
normal_x,
166 const T eps = (
T) 1.0e-12;
199 const T tol = (
T) 1.0e-8;
247 const T eps = (
T) 1.0e-12;
276 const T eps = (
T) 1.0e-12;
341 for (
int p = idx; p < n; p +=
str) {
352 const T radius = 0.5 * d[p];
__global__ void ale_add_kinematics_kernel(const int n, T *__restrict__ wx, T *__restrict__ wy, T *__restrict__ wz, const T *__restrict__ x_ref, const T *__restrict__ y_ref, const T *__restrict__ z_ref, const T *__restrict__ phi, const T *__restrict__ x, const T *__restrict__ y, const T *__restrict__ z, const kinematics_params_t kin_params)
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ w
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ u
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ v
__global__ void const T *__restrict__ x
__device__ void coef_get_normal_device(const T *__restrict__ nx, const T *__restrict__ ny, const T *__restrict__ nz, const int i, const int j, const int k, const int e, const int facet, const int lx, T &normal_x, T &normal_y, T &normal_z)
__device__ int lpt_wall_dof_idx(const int i, const int j, const int k, const int e, const int lx, const int ly, const int lz)
__device__ T lpt_signed_plane_distance(const T x, const T y, const T z, const T wall_x, const T wall_y, const T wall_z, const T normal_x, const T normal_y, const T normal_z)
__device__ int lpt_wall_imax(const int a, const int b)
__device__ void lpt_wall_facet_normal(const T *__restrict__ nx, const T *__restrict__ ny, const T *__restrict__ nz, const int lx, const int ly, const int lz, const int el, const int facet, T &normal_x, T &normal_y, T &normal_z)
__device__ void lpt_reflect_position(T &x, T &y, T &z, const T wall_x, const T wall_y, const T wall_z, const T normal_x, const T normal_y, const T normal_z, const T radius)
__device__ int lpt_wall_mask_idx(const int facet, const int el, const int n_facets)
__device__ void lpt_wall_facet_center(const T *__restrict__ dm_x, const T *__restrict__ dm_y, const T *__restrict__ dm_z, const int lx, const int ly, const int lz, const int el, const int facet, T &wall_x, T &wall_y, T &wall_z)
__device__ T lpt_norm3(const T x, const T y, const T z)
__device__ bool lpt_wall_facet_is_hit(const int *__restrict__ wall_facet_mask, const T *__restrict__ dm_x, const T *__restrict__ dm_y, const T *__restrict__ dm_z, const T *__restrict__ nx, const T *__restrict__ ny, const T *__restrict__ nz, const int lx, const int ly, const int lz, const int el, const int facet, const int gdim, const T x_old, const T y_old, const T z_old, const T x, const T y, const T z, const T radius)
__device__ void lpt_reflect_vector_components(T &x, T &y, T &z, const T normal_x, const T normal_y, const T normal_z)
__global__ void lpt_handle_elastic_wall_collisions_kernel(const int *__restrict__ wall_facet_mask, const int *__restrict__ el_list, const T *__restrict__ x_old, const T *__restrict__ y_old, const T *__restrict__ z_old, T *__restrict__ x, T *__restrict__ y, T *__restrict__ z, const T *__restrict__ d, T *__restrict__ u, T *__restrict__ v, T *__restrict__ w, T *__restrict__ u_lag, T *__restrict__ v_lag, T *__restrict__ w_lag, T *__restrict__ u_laglag, T *__restrict__ v_laglag, T *__restrict__ w_laglag, T *__restrict__ acc_xlag, T *__restrict__ acc_ylag, T *__restrict__ acc_zlag, T *__restrict__ acc_xlaglag, T *__restrict__ acc_ylaglag, T *__restrict__ acc_zlaglag, T *__restrict__ u_old, T *__restrict__ v_old, T *__restrict__ w_old, T *__restrict__ acc_x, T *__restrict__ acc_y, T *__restrict__ acc_z, const T *__restrict__ dm_x, const T *__restrict__ dm_y, const T *__restrict__ dm_z, const T *__restrict__ nx, const T *__restrict__ ny, const T *__restrict__ nz, const int n, const int gdim, const int nelv, const int lx, const int ly, const int lz, const int lag_len)