commit 58b7c6f5b9741f14c411f78e97ac423dffc85158
parent 007a6585e55707f08ee365fdf7f33aa4e7af28c1
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 27 May 2025 16:29:51 +0200
planets: correction of radiative budget results
The Monte Carlo accumulators were not initialized, leading to invalid
results due to the random data they contained, to which the results of
the realisations were added.
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/planets/htrdr_planets_c.h b/src/planets/htrdr_planets_c.h
@@ -87,6 +87,8 @@ struct planets_voxel_radiative_budget {
}, \
HTRDR_ACCUM_NULL__ \
}
+static const struct planets_voxel_radiative_budget
+PLANETS_VOXEL_RADIATIVE_BUDGET_NULL = PLANETS_VOXEL_RADIATIVE_BUDGET_NULL__;
enum planets_radiance_cpnt_flag {
PLANETS_RADIANCE_CPNT_DIRECT = BIT(0),
diff --git a/src/planets/htrdr_planets_solve_volrad_budget.c b/src/planets/htrdr_planets_solve_volrad_budget.c
@@ -297,6 +297,9 @@ solve_volumic_radiative_budget
SMSH(get_desc(cmd->volrad_mesh, &volrad_mesh_desc));
+ /* Initialse voxel accumulators to 0 */
+ *voxel = PLANETS_VOXEL_RADIATIVE_BUDGET_NULL;
+
FOR_EACH(i, 0, args->nrealisations) {
/* Time recording */
struct time t0, t1;