8#include "../offload_acc_omp.h"
11#define WALL_EPSILON 1e-9
67 real** offload_array,
int** int_offload_array);
69 real** offload_array,
int** int_offload_array);
71 int** int_offload_array);
74 real* offload_array,
int* int_offload_array);
75GPU_DECLARE_TARGET_SIMD_UNIFORM(w)
79GPU_DECLARE_TARGET_SIMD_UNIFORM(w)
83GPU_DECLARE_TARGET_SIMD
Main header file for ASCOT5.
int * tree_array
Array storing information what triangles given octree cell stores.
int int_offload_array_length
DECLARE_TARGET_END DECLARE_TARGET void wall_3d_init_tree(wall_3d_data *w, real *offload_array)
Construct wall octree iteratively.
int wall_3d_hit_wall(real r1, real phi1, real z1, real r2, real phi2, real z2, wall_3d_data *w, real *w_coll)
Check if trajectory from (r1, phi1, z1) to (r2, phi2, z2) intersects the wall using the octree struct...
void wall_3d_init(wall_3d_data *w, wall_3d_offload_data *offload_data, real *offload_array, int *int_offload_array)
Initialize wall data struct on target.
void wall_3d_init_octree(wall_3d_offload_data *w, real *offload_array, int **int_offload_array)
Construct wall octree recursively.
DECLARE_TARGET_END GPU_DECLARE_TARGET_SIMD double wall_3d_tri_collision(real q1[3], real q2[3], real t1[3], real t2[3], real t3[3])
Check if a line segment intersects a triangle.
int wall_3d_init_offload(wall_3d_offload_data *offload_data, real **offload_array, int **int_offload_array)
Initialize 3D wall data and check inputs.
DECLARE_TARGET_END DECLARE_TARGET int wall_3d_tri_in_cube(real t1[3], real t2[3], real t3[3], real bb1[3], real bb2[3])
Check if any part of a triangle is inside a box.
void wall_3d_free_offload(wall_3d_offload_data *offload_data, real **offload_array, int **int_offload_array)
Free offload array and reset parameters.
DECLARE_TARGET_END int wall_3d_hit_wall_full(real r1, real phi1, real z1, real r2, real phi2, real z2, wall_3d_data *w, real *w_coll)
Check if trajectory from (r1, phi1, z1) to (r2, phi2, z2) intersects the wall against all triangles.
DECLARE_TARGET_END DECLARE_TARGET int wall_3d_quad_collision(real q1[3], real q2[3], real t1[3], real t2[3], real t3[3], real t4[3])
Check if a line segment intersects a quad (assumed planar)