commit b07f9bf0e5b655f3458e2ab4fb0c81a2bec31df3
parent 06d6ba021463ac43fba8ea00a713baf6d77268ac
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 18 Dec 2023 12:15:16 +0100
Define the internal constant HIT_FILTER_DATA_NULL
It was simply missing. Local variables used to filter intersections are
now initialized with this constant. This means that adding optional
member variables to this data type is now handled transparently.
Some comments have also been updated and minor changes have been made to
the formatting of the sources.
Diffstat:
7 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/sdis_Xd_begin.h b/src/sdis_Xd_begin.h
@@ -118,7 +118,7 @@ get_picard_order(const struct rwalk_context* ctx)
#define fX_set_dX CONCAT(CONCAT(CONCAT(f, DIM), _set_d), DIM)
#define dX_set_fX CONCAT(CONCAT(CONCAT(d, DIM), _set_f), DIM)
-/* Macro making generic its submitted nae to SDIS_XD_DIMENSION */
+/* Macro making generic its submitted name to SDIS_XD_DIMENSION */
#define XD(Name) CONCAT(CONCAT(CONCAT(Name, _), DIM), d)
/* Generate the generic data structures and constants */
@@ -155,4 +155,3 @@ struct XD(temperature) {
static const struct XD(temperature) XD(TEMPERATURE_NULL) = { NULL, 0, 0 };
#endif /* SDIX_<2|3>D_H */
-
diff --git a/src/sdis_heat_path_boundary_Xd_c.h b/src/sdis_heat_path_boundary_Xd_c.h
@@ -320,7 +320,7 @@ XD(find_reinjection_ray)
struct sdis_medium* mdm0;
struct sdis_medium* mdm1;
- struct hit_filter_data filter_data;
+ struct hit_filter_data filter_data = HIT_FILTER_DATA_NULL;
struct sXd(hit) hit;
struct sXd(hit) hit0;
struct sXd(hit) hit1;
diff --git a/src/sdis_heat_path_boundary_Xd_solid_fluid_picard1.h b/src/sdis_heat_path_boundary_Xd_solid_fluid_picard1.h
@@ -227,7 +227,7 @@ XD(solid_fluid_boundary_picard1_path)
p_conv = h_conv / h_hat;
p_cond = h_cond / h_hat;
- /* Handle the net flux if any */
+ /* Handle the net flux if any */
handle_net_flux_args.interf = interf;
handle_net_flux_args.frag = frag;
handle_net_flux_args.green_path = ctx->green_path;
diff --git a/src/sdis_heat_path_conductive_Xd.h b/src/sdis_heat_path_conductive_Xd.h
@@ -25,7 +25,7 @@
#include "sdis_Xd_begin.h"
/*******************************************************************************
- * Non generic helper function
+ * Non generic helper functions
******************************************************************************/
#ifndef SDIS_HEAT_PATH_CONDUCTIVE_XD_H
#define SDIS_HEAT_PATH_CONDUCTIVE_XD_H
diff --git a/src/sdis_heat_path_convective_Xd.h b/src/sdis_heat_path_convective_Xd.h
@@ -73,7 +73,7 @@ XD(register_heat_vertex_in_fluid)
const double weight)
{
struct sdis_rwalk_vertex vtx = SDIS_RWALK_VERTEX_NULL;
- struct hit_filter_data filter_data;
+ struct hit_filter_data filter_data = HIT_FILTER_DATA_NULL;
const float empirical_dst = 0.1f;
const float range[2] = {0, FLT_MAX};
float org[DIM];
diff --git a/src/sdis_heat_path_radiative_Xd.h b/src/sdis_heat_path_radiative_Xd.h
@@ -55,7 +55,7 @@ XD(trace_radiative_path)
/* Launch the radiative random walk */
for(;;) {
const struct sdis_interface* interf = NULL;
- struct hit_filter_data filter_data;
+ struct hit_filter_data filter_data = HIT_FILTER_DATA_NULL;
struct sdis_interface_fragment frag = SDIS_INTERFACE_FRAGMENT_NULL;
struct sdis_medium* chk_mdm = NULL;
double alpha;
diff --git a/src/sdis_scene_c.h b/src/sdis_scene_c.h
@@ -37,6 +37,9 @@ struct hit_filter_data {
struct s3d_hit hit_3d;
double epsilon; /* Threshold defining roughly equal intersections */
};
+#define HIT_FILTER_DATA_NULL__ {S2D_HIT_NULL__, S3D_HIT_NULL__, 0}
+static const struct hit_filter_data HIT_FILTER_DATA_NULL =
+ HIT_FILTER_DATA_NULL__;
struct get_medium_info {
/* Targeted position */