commit 0fbe169bb54615f84902055dea946b9c193c2783
parent 4bb54646bbb1c6865fd08b82bf902c8fa3cea0d6
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 26 Apr 2019 10:55:33 +0200
Small adjustment of the solid random walk
Snap the position to the boundary if it is too close of it wrt
delta_solid.
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/sdis_heat_path_conductive_Xd.h b/src/sdis_heat_path_conductive_Xd.h
@@ -128,12 +128,15 @@ XD(sample_next_step)
/* Hit nothing along all tested directions. Set delta to delta_solid. */
delta = delta_solid;
} else if
- ( delta != hit0->distance
- && eq_eps(hit0->distance, delta, delta_solid*(RAY_RANGE_MAX_SCALE-1))) {
+ ( !SXD_HIT_NONE(hit0)
+ && delta != hit0->distance
+ && ( eq_eps(hit0->distance, delta, delta_solid*(RAY_RANGE_MAX_SCALE-1))
+ || hit0->distance < delta_solid * 0.01)) {
/* Set delta to the main hit distance if it is roughly equal to it in order
* to avoid numerical issues on moving along the main direction. Use the
* RAY_RANGE_MAX_SCALE factor to define the `epsilon' used by this
- * comparison */
+ * comparison. In addition force delta to the main hit distance if this
+ * distance is quite small regarding the original delta. */
delta = hit0->distance;
*hit1 = *hit0;
idir1 = 0;