slm: OpenCL code base
0.1
|
Functions used to compute Runge-Kutta integration down and up streamlines. More...
Functions | |
static bool | runge_kutta_step_record (float *dt, float *dl, float *l_trajectory, float2 *dxy1_vec, float2 *dxy2_vec, float2 *vec, float2 *prev_vec, float2 *next_vec, uint *n_steps, uint *idx, uint *prev_idx, __global char2 *trajectory_vec) |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors. More... | |
static void | euler_step_record (float *dt, float *dl, float *l_trajectory, const float2 uv_vec, float2 *vec, const float2 prev_vec, uint *n_steps, __global char2 *trajectory_vec) |
Compute a single Euler integration step of of a streamline. More... | |
static bool | runge_kutta_step_write_sl_data (float *dt, float *dl, float *l_trajectory, float2 *dxy1_vec, float2 *dxy2_vec, float2 *vec, float2 *prev_vec, const float2 next_vec, uint *n_steps, uint *idx, uint *prev_idx, __global const bool *mask_array, __global uint *slt_array, __global uint *slc_array) |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors. More... | |
static void | euler_step_write_sl_data (float *dt, float *dl, float *l_trajectory, const float2 uv_vec, float2 *vec, const float2 prev_vec, uint *n_steps, uint *idx, uint *prev_idx, __global const bool *mask_array, __global uint *slt_array, __global uint *slc_array) |
Compute a single Euler integration step of of a streamline. More... | |
static bool | connect_runge_kutta_step_record (float *dt, float *dl, float *l_trajectory, float2 *dxy1_vec, float2 *dxy2_vec, float2 *vec, float2 *prev_vec, float2 *next_vec, uint *n_steps, uint *idx, uint *prev_idx, __private char2 *trajectory_vec) |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors. More... | |
static void | channelheads_runge_kutta_step (float *dt, float *dl, float2 *dxy1_vec, float2 *dxy2_vec, float2 *vec, float2 *next_vec, uint *n_steps, uint *idx) |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors. More... | |
static bool | countlink_runge_kutta_step (float *dt, float *dl, float2 *dxy1_vec, float2 *dxy2_vec, float2 *vec, float2 *next_vec, uint *idx, __global uint *mapping_array) |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors. More... | |
static bool | segment_runge_kutta_step (float *dt, float *dl, float2 *dxy1_vec, float2 *dxy2_vec, float2 *vec, float2 *next_vec, uint *n_steps, uint *idx) |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors. More... | |
static bool | lengths_runge_kutta_step (float *dt, float *dl, float *l_trajectory, float2 *dxy1_vec, float2 *dxy2_vec, float2 *vec, float2 *prev_vec, float2 *next_vec, uint *n_steps, uint *idx) |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors. More... | |
Functions used to compute Runge-Kutta integration down and up streamlines.
|
inlinestatic |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors.
Increment the step counter n_steps
and update the idx
of the new vec
.
Compiled if KERNEL_INTEGRATE_TRAJECTORY is defined.
[in,out] | dt | delta time step |
[in,out] | dl | step distance |
[in,out] | dxy1_vec | R-K first order delta step vector |
[in,out] | dxy2_vec | R-K second order delta step vector |
[in,out] | vec | current (x,y) coordinate vector at tip of streamline trajectory |
[in,out] | next_vec | next (x,y) coordinate vector on streamline trajectory |
[in,out] | n_steps | number of integration steps so far in streamline trajectory |
[in,out] | idx | array index of pixel at current (x,y) position |
bool | true if stuck (step length less than INTEGRATION_HALT_THRESHOLD ); false otherwise aka step computed well |
Definition at line 335 of file integrationfns.cl.
|
inlinestatic |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors.
If the step is deemed too small, return true
= stuck; otherwise return false
= ok. Record this step in the private trajectory_vec
(array of step vectors). Also update the total streamline length l_trajectory
and increment the step counter n_steps
. In addition, push the current vec
to the prev_vec
, push the current idx
to the prev_idx
, and update the idx
of the current vec
.
Compiled if KERNEL_CONNECT_CHANNELS is defined.
[in,out] | dt | delta time step |
[in,out] | dl | step distance |
[in,out] | l_trajectory | total streamline distance so far |
[in,out] | dxy1_vec | R-K first order delta step vector |
[in,out] | dxy2_vec | R-K second order delta step vector |
[in,out] | vec | current (x,y) coordinate vector at tip of streamline trajectory |
[in,out] | prev_vec | previous (x,y) coordinate vector on streamline trajectory |
[in,out] | next_vec | next (x,y) coordinate vector on streamline trajectory |
[in,out] | n_steps | number of integration steps so far in streamline trajectory |
[in,out] | idx | array index of pixel at current (x,y) position |
[in,out] | prev_idx | array index of pixel at previous (x,y) position |
[in,out] | trajectory_vec | streamline trajectory record (2d array of compressed (x,y) vectors) |
bool | true if stuck (step length less than INTEGRATION_HALT_THRESHOLD ); false otherwise aka step computed well |
Definition at line 280 of file integrationfns.cl.
|
inlinestatic |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors.
If the step is deemed too small, return true
= stuck; otherwise return false
= ok. In addition, flag the mapping_array
pixel as IS_STUCK
. Update the idx
of the current (new) vec
.
Compiled if KERNEL_COUNT_DOWNCHANNELS or KERNEL_LINK_HILLSLOPES is defined.
[in,out] | dt | delta time step |
[in,out] | dl | step distance |
[in,out] | dxy1_vec | R-K first order delta step vector |
[in,out] | dxy2_vec | R-K second order delta step vector |
[in,out] | vec | current (x,y) coordinate vector at tip of streamline trajectory |
[in,out] | next_vec | next (x,y) coordinate vector on streamline trajectory |
[in,out] | idx | array index of pixel at current (x,y) position |
[in,out] | mapping_array | flag grid recording status of each pixel (padded) |
bool | true if stuck (step length less than INTEGRATION_HALT_THRESHOLD ); false otherwise aka step computed well |
Definition at line 382 of file integrationfns.cl.
|
inlinestatic |
Compute a single Euler integration step of of a streamline.
Record this step in the global trajectory_vec
(array of step vectors). Also update the total streamline length l_trajectory
and increment the step counter n_steps
.
Compiled if KERNEL_INTEGRATE_TRAJECTORY is defined.
[in,out] | dt | delta time step |
[in,out] | dl | step distance |
[in,out] | l_trajectory | total streamline distance so far |
[in] | uv_vec | flow velocity vector interpolated to current position |
[in,out] | vec | current (x,y) coordinate vector at tip of streamline trajectory |
[in] | prev_vec | previous (x,y) coordinate vector on streamline trajectory |
[in,out] | n_steps | number of integration steps so far in streamline trajectory |
[in,out] | trajectory_vec | streamline trajectory record (2d array of compressed (x,y) vectors) |
bool | true if stuck (step length less than INTEGRATION_HALT_THRESHOLD ); false otherwise aka step computed well |
Definition at line 103 of file integrationfns.cl.
|
inlinestatic |
Compute a single Euler integration step of of a streamline.
Record this step in the global trajectory_vec
(array of step vectors). Also update the total streamline length l_trajectory
and increment the step counter n_steps
.
Compiled if KERNEL_INTEGRATE_TRAJECTORY is defined.
[in,out] | dt | delta time step |
[in,out] | dl | step distance |
[in,out] | l_trajectory | total streamline distance so far |
[in] | uv_vec | flow velocity vector interpolated to current position |
[in,out] | vec | current (x,y) coordinate vector at tip of streamline trajectory |
[in] | prev_vec | previous (x,y) coordinate vector on streamline trajectory |
[in,out] | n_steps | number of integration steps so far in streamline trajectory |
[in,out] | idx | array index of pixel at current (x,y) position |
[in,out] | prev_idx | array index of pixel at previous (x,y) position |
[in] | mask_array | grid pixel mask (padded), with true = masked, false = good |
[in,out] | slc_array | grid recording accumulated count of streamline integration steps across each pixel (padded) |
[in,out] | slt_array | grid recording accumulated count of streamline segment lengths crossing each pixel (padded) |
bool | true if stuck (step length less than INTEGRATION_HALT_THRESHOLD ); false otherwise aka step computed well |
Definition at line 219 of file integrationfns.cl.
|
inlinestatic |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors.
If the step is deemed too small, return true
= stuck; otherwise return false
= ok. Also update the total streamline length l_trajectory
and increment the step counter n_steps
. In addition, push the current vec
to the prev_vec
and update the idx
of the current vec
.
Compiled if KERNEL_HILLSLOPE_LENGTHS is defined.
[in,out] | dt | delta time step |
[in,out] | dl | step distance |
[in,out] | l_trajectory | total streamline distance so far |
[in,out] | dxy1_vec | R-K first order delta step vector |
[in,out] | dxy2_vec | R-K second order delta step vector |
[in,out] | vec | current (x,y) coordinate vector at tip of streamline trajectory |
[in,out] | prev_vec | previous (x,y) coordinate vector on streamline trajectory |
[in,out] | next_vec | next (x,y) coordinate vector on streamline trajectory |
[in,out] | n_steps | number of integration steps so far in streamline trajectory |
[in,out] | idx | array index of pixel at current (x,y) position |
bool | true if stuck (step length less than INTEGRATION_HALT_THRESHOLD ); false otherwise aka step computed well |
Definition at line 487 of file integrationfns.cl.
|
inlinestatic |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors.
If the step is deemed too small, return true
= stuck; otherwise return false
= ok. Record this step in the global trajectory_vec
(array of step vectors). Also update the total streamline length l_trajectory
and increment the step counter n_steps
. In addition, push the current vec
to the prev_vec
, push the current idx
to the prev_idx
, and update the idx
of the current vec
.
Compiled if KERNEL_INTEGRATE_TRAJECTORY is defined.
[in,out] | dt | delta time step |
[in,out] | dl | step distance |
[in,out] | l_trajectory | total streamline distance so far |
[in,out] | dxy1_vec | R-K first order delta step vector |
[in,out] | dxy2_vec | R-K second order delta step vector |
[in,out] | vec | current (x,y) coordinate vector at tip of streamline trajectory |
[in,out] | prev_vec | previous (x,y) coordinate vector on streamline trajectory |
[in,out] | next_vec | next (x,y) coordinate vector on streamline trajectory |
[in,out] | n_steps | number of integration steps so far in streamline trajectory |
[in,out] | idx | array index of pixel at current (x,y) position |
[in,out] | prev_idx | array index of pixel at previous (x,y) position |
[in,out] | trajectory_vec | streamline trajectory record (2d array of compressed (x,y) vectors) |
bool | true if stuck (step length less than INTEGRATION_HALT_THRESHOLD ); false otherwise aka step computed well |
Definition at line 49 of file integrationfns.cl.
|
inlinestatic |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors.
If the step is deemed too small, return true
= stuck; otherwise return false
= ok. Record this step in the global slt_array
and slc_array
(streamline length total and count total respectively) by updating both at the current pixel (using mask_array
to block where masked). Also update the total streamline length l_trajectory
and increment the step counter n_steps
. In addition, push the current vec
to the prev_vec
, push the current idx
to the prev_idx
, and update the idx
of the current vec
.
Compiled if KERNEL_INTEGRATE_TRAJECTORY is defined.
[in,out] | dt | delta time step |
[in,out] | dl | step distance |
[in,out] | l_trajectory | total streamline distance so far |
[in,out] | dxy1_vec | R-K first order delta step vector |
[in,out] | dxy2_vec | R-K second order delta step vector |
[in,out] | vec | current (x,y) coordinate vector at tip of streamline trajectory |
[in,out] | prev_vec | previous (x,y) coordinate vector on streamline trajectory |
[in] | next_vec | next (x,y) coordinate vector on streamline trajectory |
[in,out] | n_steps | number of integration steps so far in streamline trajectory |
[in,out] | idx | array index of pixel at current (x,y) position |
[in,out] | prev_idx | array index of pixel at previous (x,y) position |
[in] | mask_array | grid pixel mask (padded), with true = masked, false = good |
[in,out] | slc_array | grid recording accumulated count of streamline integration steps across each pixel (padded) |
[in,out] | slt_array | grid recording accumulated count of streamline segment lengths crossing each pixel (padded) |
bool | true if stuck (step length less than INTEGRATION_HALT_THRESHOLD ); false otherwise aka step computed well |
Definition at line 162 of file integrationfns.cl.
|
inlinestatic |
Compute a single step of 2nd-order Runge-Kutta numerical integration of a streamline given precomputed 1st and 2nd order step vectors.
If the step is deemed too small, return true
= stuck; otherwise return false
= ok. Increment the step counter n_steps
and update the idx
of the new (next) vec
.
Compiled if KERNEL_SEGMENT_HILLSLOPES or KERNEL_SUBSEGMENT_FLANKS is defined.
[in,out] | dt | delta time step |
[in,out] | dl | step distance |
[in,out] | dxy1_vec | R-K first order delta step vector |
[in,out] | dxy2_vec | R-K second order delta step vector |
[in,out] | vec | current (x,y) coordinate vector at tip of streamline trajectory |
[in,out] | next_vec | next (x,y) coordinate vector on streamline trajectory |
[in,out] | n_steps | number of integration steps so far in streamline trajectory |
[in,out] | idx | array index of pixel at current (x,y) position |
bool | true if stuck (step length less than INTEGRATION_HALT_THRESHOLD ); false otherwise aka step computed well |
Definition at line 432 of file integrationfns.cl.