21 uint i_block, uint i_cell, uint j_block, uint j_cell,
35 for (uint
k=0;
k<
WID* (blocks_per_dim + 2); ++
k){
54 for (
unsigned int k_block = 0; k_block<blocks_per_dim;k_block++){
55 for (uint k_cell=0; k_cell<
WID; ++k_cell){
61 const int target_gk_l = (int)((v_l - intersection_min)/
intersection_dk);
62 const int target_gk_r = (int)((v_r - intersection_min)/
intersection_dk);
64 for(
int gk = target_gk_l; gk <= target_gk_r; gk++){
70 const Real v_int_norm_l = (v_int_l - v_l)/
dv;
72 const Real v_int_norm_r = (v_int_r - v_l)/
dv;
76 Real target_density_l =
77 v_int_norm_l * a[k_block *
WID + k_cell][0] +
78 v_int_norm_l * v_int_norm_l * a[k_block *
WID + k_cell][1];
79 Real target_density_r =
80 v_int_norm_r * a[k_block *
WID + k_cell][0] +
81 v_int_norm_r * v_int_norm_r * a[k_block *
WID + k_cell][1];
84 Real target_density_l =
85 v_int_norm_l * a[k_block *
WID + k_cell][0] +
86 v_int_norm_l * v_int_norm_l * a[k_block *
WID + k_cell][1] +
87 v_int_norm_l * v_int_norm_l * v_int_norm_l * a[k_block *
WID + k_cell][2];
88 Real target_density_r =
89 v_int_norm_r * a[k_block *
WID + k_cell][0] +
90 v_int_norm_r * v_int_norm_r * a[k_block *
WID + k_cell][1] +
91 v_int_norm_r * v_int_norm_r * v_int_norm_r * a[k_block *
WID + k_cell][2];
94 target[gk +
WID] += target_density_r - target_density_l;
99 for (
unsigned int k_block = 0; k_block<blocks_per_dim;k_block++){
100 for (uint
k=0;
k<
WID; ++
k){
101 values[k_block *
WID +
k +
WID] = target[k_block *
WID +
k +
WID];
107 const int dv = 20000;
109 const int blocks_per_dim = 100;
110 const int i_block = 0;
111 const int j_block = 0;
112 const int i_cell = 0;
113 const int j_cell = 0;
116 Real values[(blocks_per_dim+2)*
WID];
125 const int iterations=1000;
128 for (uint
k=0;
k<
WID* (blocks_per_dim + 2); ++
k){
133 for(
int i=0;
i < blocks_per_dim *
WID;
i++){
135 if (v >
v_min + 0.8 * (blocks_per_dim *
WID *
dv) &&
136 v <
v_min + 0.9 * (blocks_per_dim *
WID *
dv))
137 values[
i +
WID] = 1.0;
142 for(
int step = 0; step < iterations; step++){
146 i_block, i_cell, j_block, j_cell,
void propagate(Real values[], uint blocks_per_dim, Real v_min, Real dv, uint i_block, uint i_cell, uint j_block, uint j_cell, Real intersection, Real intersection_di, Real intersection_dj, Real intersection_dk)