54 real xmin = x1x2x3[0], xmax = x1x2x3[0];
55 real ymin = y1y2y3[0], ymax = y1y2y3[0];
56 real zmin = z1z2z3[0], zmax = z1z2z3[0];
57 for(
int i = 0; i < nelements; i++) {
58 for(
int j = 0; j < 3; j++) {
59 data->
wall_tris[i*9 + j*3 + 0] = x1x2x3[3*i+j];
60 data->
wall_tris[i*9 + j*3 + 1] = y1y2y3[3*i+j];
61 data->
wall_tris[i*9 + j*3 + 2] = z1z2z3[3*i+j];
64 xmin = fmin( xmin, x1x2x3[3*i+j] );
65 xmax = fmax( xmax, x1x2x3[3*i+j] );
66 ymin = fmin( ymin, y1y2y3[3*i+j] );
67 ymax = fmax( ymax, y1y2y3[3*i+j] );
68 zmin = fmin( zmin, z1z2z3[3*i+j] );
69 zmax = fmax( zmax, z1z2z3[3*i+j] );
75 data->
xmin = xmin - 0.1;
76 data->
xmax = xmax + 0.1;
77 data->
ymin = ymin - 0.1;
78 data->
ymax = ymax + 0.1;
79 data->
zmin = zmin - 0.1;
80 data->
zmax = zmax + 0.1;
85 for(
int i = 0; i < data->
depth - 1; i++) {
99 "Number of wall elements %d\n"
100 "Spanning xmin = %2.3f m, xmax = %2.3f m\n"
101 " ymin = %2.3f m, ymax = %2.3f m\n"
102 " zmin = %2.3f m, zmax = %2.3f m\n",
317 real rpz1[3], rpz2[3];
329 int ix1 = (int) floor((q1[0] - wdata->
xmin)
331 int iy1 = (int) floor((q1[1] - wdata->
ymin)
333 int iz1 = (int) floor((q1[2] - wdata->
zmin)
336 int ix2 = (int) floor((q2[0] - wdata->
xmin)
338 int iy2 = (int) floor((q2[1] - wdata->
ymin)
340 int iz2 = (int) floor((q2[2] - wdata->
zmin)
344 real smallest_w = 1.1;
346 for(
int i = 0; i <= abs(ix2-ix1); i++) {
347 for(
int j = 0; j <= abs(iy2-iy1); j++) {
348 for(
int k = 0; k <= abs(iz2-iz1); k++) {
349 int ix = ix1 + i*((int) copysign(1, ix2-ix1));
350 int iy = iy1 + j*((int) copysign(1, iy2-iy1));
351 int iz = iz1 + k*((int) copysign(1, iz2-iz1));
353 if(ix >= 0 && ix < wdata->ngrid && iy >= 0 && iy < wdata->ngrid
354 && iz >= 0 && iz < wdata->ngrid) {
357 + iy*wdata->
ngrid + iz];
359 for(
int l = 0; l < wdata->
tree_array[ilist]; l++) {
366 if(w >= 0 && w < smallest_w) {
375 *w_coll = smallest_w;
443 if(bb1[0] <= t1[0] && t1[0] <= bb2[0]
444 && bb1[1] <= t1[1] && t1[1] <= bb2[1]
445 && bb1[2] <= t1[2] && t1[2] <= bb2[2])
447 if(bb1[0] < t2[0] && t2[0] <= bb2[0]
448 && bb1[1] <= t2[1] && t2[1] <= bb2[1]
449 && bb1[2] <= t2[2] && t2[2] <= bb2[2])
451 if(bb1[0] <= t3[0] && t3[0] <= bb2[0]
452 && bb1[1] <= t3[1] && t3[1] <= bb2[1]
453 && bb1[2] <= t3[2] && t3[2] <= bb2[2])
457 real c000[3]; c000[0] = bb1[0]; c000[1] = bb1[1]; c000[2] = bb1[2];
458 real c100[3]; c100[0] = bb2[0]; c100[1] = bb1[1]; c100[2] = bb1[2];
459 real c010[3]; c010[0] = bb1[0]; c010[1] = bb2[1]; c010[2] = bb1[2];
460 real c110[3]; c110[0] = bb2[0]; c110[1] = bb2[1]; c110[2] = bb1[2];
461 real c001[3]; c001[0] = bb1[0]; c001[1] = bb1[1]; c001[2] = bb2[2];
462 real c101[3]; c101[0] = bb2[0]; c101[1] = bb1[1]; c101[2] = bb2[2];
463 real c011[3]; c011[0] = bb1[0]; c011[1] = bb2[1]; c011[2] = bb2[2];
464 real c111[3]; c111[0] = bb2[0]; c111[1] = bb2[1]; c111[2] = bb2[2];