commit b00590b567dba3ad4269a3dc2db9db2a57bc5188
parent 3816c6bd89b66a46889f88cdcc952ca8287eb30f
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 28 Apr 2023 14:28:12 +0200
Adjustment to find a reinjection direction
If no valid return direction has been found, we move the boundary
position slightly away from the edges of the primitive and try again to
find a valid direction. But until now, we moved the position even if we
reached the maximum number of tries, which resulted in performance
penalties. In this commit, the position is only moved if there is one
more trial to go.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/sdis_heat_path_boundary_Xd_c.h b/src/sdis_heat_path_boundary_Xd_c.h
@@ -407,7 +407,8 @@ XD(find_reinjection_ray)
* function but this may be not the case due to a "threshold effect". In
* both situations, try to slightly move away from the primitive boundaries
* and retry to find a valid reinjection. */
- if(dst0 == -1 && dst1 == -1) {
+ if(dst0 == -1 && dst1 == -1
+ && iattempt < MAX_ATTEMPTS - 1) { /* Is there still a trial to be done? */
XD(move_away_primitive_boundaries)(args->rwalk, args->distance, ray->org);
ray->position_was_moved = 1;
}