commit 398ed05488346636c8502e7a827bfe3082286547
parent 3c77167f04b0b7322b89cd1f599e35d784975b5e
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 14 Nov 2017 15:33:27 +0100
Handle numerical imprecisions with medium having a null absorption
Diffstat:
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/sgf_device_c.h b/src/sgf_device_c.h
@@ -18,6 +18,12 @@
#include <rsys/ref_count.h>
+/* Fix GCC warnings */
+#ifdef COMPILER_GCC
+ #undef FUNC_NAME
+ #define FUNC_NAME (__extension__ __FUNCTION__)
+#endif
+
struct logger;
struct mem_allocator;
struct s2d_device;
diff --git a/src/sgf_realisation.h b/src/sgf_realisation.h
@@ -269,7 +269,7 @@ GEBHART_RADIATIVE_PATH
sXd_scene_trace_ray(sXd_scn, pos, dir, range, &prim_from, &hit);
/* Handle medium absorption */
- if(absorption_coef > 0) {
+ if(absorption_coef >= 0) {
if(SXD_HIT_NONE(&hit)) { /* The ray shoulnd't be outside the volume */
log_error(dev,
"The radiative random walk goes to the infinity while the submitted geometry \n"
@@ -295,9 +295,7 @@ GEBHART_RADIATIVE_PATH
transmissivity *= medium_transmissivity;
medium_radiative_flux += weight;
}
- }
-
- if(SXD_HIT_NONE(&hit)) { /* The ray is outside the volume */
+ } else if(SXD_HIT_NONE(&hit)) { /* The ray is outside the volume */
infinite_radiative_flux = transmissivity;
break;
}