commit 99ea07a6faddcf909825032aade17d4be50210e8
parent 0991a2d7d978a6b6a98c1e8d7212c4e39215e53c
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 9 Jul 2024 17:39:48 +0200
Update custom sampling of a conductive path
Updated warning message indicating that a position is not where it
should be, i.e. at a boundary. The message now indicates not only the
search distance, but also the position from which the boundary is being
searched.
In addition, a boundary should not be searched if the sampled trajectory
has already reached its initial condition.
Diffstat:
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/sdis_heat_path_conductive_custom_Xd.h b/src/sdis_heat_path_conductive_custom_Xd.h
@@ -122,8 +122,9 @@ XD(get_path_hit)
if(SXD_HIT_NONE(hit)) {
log_warn(scn->dev,
"%s: the position returned by custom sampling of the conductive path "
- "is too far from the primitive it should be on -- search distance=%g\n",
- FUNC_NAME, delta);
+ "is too far from the primitive it should be on -- "
+ "query position=("FORMAT_VECX"); search distance=%g\n",
+ FUNC_NAME, SPLITX(path->vtx.P), delta);
res = RES_BAD_OP;
goto error;
}
@@ -168,13 +169,18 @@ XD(conductive_path_custom)
res = XD(check_sampled_path)(scn, rwalk, &path);
if(res!= RES_OK) goto error;
- res = XD(get_path_hit)(scn, &path, mdm, &rwalk->XD(hit));
- if(res != RES_OK) goto error;
-
/* Update random walk position and time from sampled path */
rwalk->elapsed_time += rwalk->vtx.time - path.vtx.time;
rwalk->vtx = path.vtx;
+ /* Calculate path intersection with geometry if it hasn't already reached a
+ * boundary condition */
+ if(!path.at_limit) {
+ res = XD(get_path_hit)(scn, &path, mdm, &rwalk->XD(hit));
+ if(res != RES_OK) goto error;
+ }
+
+
/* The path reached a boundary */
if(!SXD_HIT_NONE(&rwalk->XD(hit))) {
unsigned enc_ids[2] = {ENCLOSURE_ID_NULL, ENCLOSURE_ID_NULL};