ASCOT5
Loading...
Searching...
No Matches
wall_3d.h
Go to the documentation of this file.
1
5#ifndef WALL_3D_H
6#define WALL_3D_H
7#include "../ascot5.h"
8#include "../offload_acc_omp.h"
9
11#define WALL_EPSILON 1e-9
12
34
65
67 real** offload_array, int** int_offload_array);
69 real** offload_array, int** int_offload_array);
70void wall_3d_init_octree(wall_3d_offload_data* w, real* offload_array,
71 int** int_offload_array);
72
74 real* offload_array, int* int_offload_array);
75GPU_DECLARE_TARGET_SIMD_UNIFORM(w)
76int wall_3d_hit_wall(real r1, real phi1, real z1, real r2, real phi2,
77 real z2, wall_3d_data* w, real* w_coll);
78DECLARE_TARGET_END
79GPU_DECLARE_TARGET_SIMD_UNIFORM(w)
80int wall_3d_hit_wall_full(real r1, real phi1, real z1, real r2, real phi2,
81 real z2, wall_3d_data* w, real* w_coll);
82DECLARE_TARGET_END
83GPU_DECLARE_TARGET_SIMD
84double wall_3d_tri_collision(real q1[3], real q2[3], real t1[3], real t2[3],
85 real t3[3]);
86DECLARE_TARGET_END
87
88DECLARE_TARGET
89void wall_3d_init_tree(wall_3d_data* w, real* offload_array);
90DECLARE_TARGET_END
91DECLARE_TARGET
92int wall_3d_tri_in_cube(real t1[3], real t2[3], real t3[3], real bb1[3],
93 real bb2[3]);
94DECLARE_TARGET_END
95DECLARE_TARGET
96int wall_3d_quad_collision(real q1[3], real q2[3], real t1[3], real t2[3],
97 real t3[3], real t4[3]);
98DECLARE_TARGET_END
99
100#endif
Main header file for ASCOT5.
double real
Definition ascot5.h:85
3D wall data parameters
Definition wall_3d.h:38
real zgrid
Definition wall_3d.h:48
int * tree_array
Array storing information what triangles given octree cell stores.
Definition wall_3d.h:63
real zmax
Definition wall_3d.h:47
real xmax
Definition wall_3d.h:41
real zmin
Definition wall_3d.h:46
real ymin
Definition wall_3d.h:43
int tree_array_size
Definition wall_3d.h:53
real xmin
Definition wall_3d.h:40
real * wall_tris
Definition wall_3d.h:52
real xgrid
Definition wall_3d.h:42
real ygrid
Definition wall_3d.h:45
real ymax
Definition wall_3d.h:44
3D wall offload data
Definition wall_3d.h:16
int int_offload_array_length
Definition wall_3d.h:32
DECLARE_TARGET_END DECLARE_TARGET void wall_3d_init_tree(wall_3d_data *w, real *offload_array)
Construct wall octree iteratively.
Definition wall_3d.c:162
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...
Definition wall_3d.c:339
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.
Definition wall_3d.c:131
void wall_3d_init_octree(wall_3d_offload_data *w, real *offload_array, int **int_offload_array)
Construct wall octree recursively.
Definition wall_3d.c:242
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.
Definition wall_3d.c:544
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.
Definition wall_3d.c:44
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.
Definition wall_3d.c:464
void wall_3d_free_offload(wall_3d_offload_data *offload_data, real **offload_array, int **int_offload_array)
Free offload array and reset parameters.
Definition wall_3d.c:110
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.
Definition wall_3d.c:419
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)
Definition wall_3d.c:619