commit 52a837058feb2802e8adcd86a50d0a3ce81a701d
parent 1a71eea1aa4c6c93010e31d2fbbe259b282c3aac
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 22 Mar 2024 16:23:34 +0100
Add path registration to WoS diffusion
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/sdis_heat_path_conductive_wos_Xd.h b/src/sdis_heat_path_conductive_wos_Xd.h
@@ -550,8 +550,16 @@ XD(conductive_path_wos)
for(;;) {
double dst = 0; /* [m/fp_to_meter] */
+ /* Register the new vertex against the heat path */
+ #define REGISTER_HEAT_VERTEX { \
+ res = register_heat_vertex(ctx->heat_path, &rwalk->vtx, T->value, \
+ SDIS_HEAT_VERTEX_CONDUCTION, (int)ctx->nbranchings); \
+ if(res != RES_OK) goto error; \
+ } (void)0
+
/* The temperature is known */
if(props.temperature >= 0) {
+ REGISTER_HEAT_VERTEX;
T->value += props.temperature;
T->done = 1;
break;
@@ -571,17 +579,21 @@ XD(conductive_path_wos)
/* The path reaches the initial condition */
if(T->done) {
+ REGISTER_HEAT_VERTEX;
T->func = NULL;
break;
}
/* The path reaches a boundary */
if(!SXD_HIT_NONE(&rwalk->hit)) {
+ REGISTER_HEAT_VERTEX;
T->func = XD(boundary_path);
rwalk->mdm = NULL;
break;
}
+ #undef REGISTER_VERTEX
+
/* Retreive and check solid properties at the new position */
res = solid_get_properties(rwalk->mdm, &rwalk->vtx, &props);
if(res != RES_OK) goto error;