11#define WALL_EPSILON 1e-9
48GPU_DECLARE_TARGET_SIMD_UNIFORM(w)
52GPU_DECLARE_TARGET_SIMD_UNIFORM(w)
56GPU_DECLARE_TARGET_SIMD
Main header file for ASCOT5.
int * tree_array
Array storing information what triangles given octree cell stores.
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_free(wall_3d_data *data)
Free allocated resources.
void wall_3d_offload(wall_3d_data *data)
Offload data to the accelerator.
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.
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.
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)
int wall_3d_init(wall_3d_data *data, int nelements, real *x1x2x3, real *y1y2y3, real *z1z2z3)
Initialize 3D wall data and check inputs.