stardis-solver

Solve coupled heat transfers
git clone git://git.meso-star.fr/stardis-solver.git
Log | Files | Refs | README | LICENSE

commit aa183e6471ab84e12f5239eb358692fb37af6047
parent 45354abc37efc5036f69598b0cc897e314819329
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 12 Sep 2025 15:26:53 +0200

Test Picard using either WoS or WoDS

Using either of these algorithms allows to verify that they can be used
interchangeably without any impact on the calculations.

But it is also a way to mitigate the impact of the delta numerical
parameter on the result. Depending on the random sequences (which depend
on the number of threads used to run the simulation), the results may
not match the reference solution in terms of standard error. In this
case, the test fails. Some might reduce the delta parameter in order to
decrease the calculation bias, but at the cost of increased execution
time. As an alternative, the WoDS algorithm can be replaced by the WoS
algorithm, which significantly limits the impact of the “delta” bias.

This is actually the primary reason for this commit: to correct a test
that no longer passes on a machine following update 136834f, without
having to reduce the delta parameter again.

Diffstat:
Msrc/test_sdis_picard.c | 26++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/test_sdis_picard.c b/src/test_sdis_picard.c @@ -435,6 +435,7 @@ static void test_picard (struct sdis_scene* scn, const size_t picard_order, + const enum sdis_diffusion_algorithm algo, const struct reference_result* ref) { struct sdis_solve_probe_args probe_args = SDIS_SOLVE_PROBE_ARGS_DEFAULT; @@ -458,6 +459,7 @@ test_picard probe_args.position[1] = 0; probe_args.position[2] = 0; probe_args.picard_order = picard_order; + probe_args.diff_algo = algo; OK(sdis_solve_probe(scn, &probe_args, &estimator)); OK(sdis_estimator_get_temperature(estimator, &mc)); printf("Temperature at `%g %g %g' = %g ~ %g +/- %g\n", @@ -712,8 +714,8 @@ main(int argc, char** argv) pinterf_props[BOUNDARY_pX]->Tref = 300; radenv_props->temperature = 280; radenv_props->reference = 300; - test_picard(scn_2d, 1/*Picard order*/, &ref); - test_picard(scn_3d, 1/*Picard order*/, &ref); + test_picard(scn_2d, 1/*Picard order*/, SDIS_DIFFUSION_WOS, &ref); + test_picard(scn_3d, 1/*Picard order*/, SDIS_DIFFUSION_WOS, &ref); printf("\n"); /* Test picard1 using T4 as a reference */ @@ -726,8 +728,8 @@ main(int argc, char** argv) pinterf_props[BOUNDARY_pX]->Tref = 350; radenv_props->temperature = 280; radenv_props->reference = 280; - test_picard(scn_2d, 1/*Picard order*/, &ref); - test_picard(scn_3d, 1/*Picard order*/, &ref); + test_picard(scn_2d, 1/*Picard order*/, SDIS_DIFFUSION_DELTA_SPHERE, &ref); + test_picard(scn_3d, 1/*Picard order*/, SDIS_DIFFUSION_DELTA_SPHERE, &ref); printf("\n"); /* Test picard2 */ @@ -740,8 +742,8 @@ main(int argc, char** argv) pinterf_props[BOUNDARY_pX]->Tref = 300; radenv_props->temperature = 280; radenv_props->reference = 300; - test_picard(scn_2d, 2/*Picard order*/, &ref); - test_picard(scn_3d, 2/*Picard order*/, &ref); + test_picard(scn_2d, 2/*Picard order*/, SDIS_DIFFUSION_WOS, &ref); + test_picard(scn_3d, 2/*Picard order*/, SDIS_DIFFUSION_WOS, &ref); printf("\n"); t_range[0] = 200; @@ -761,8 +763,8 @@ main(int argc, char** argv) pinterf_props[BOUNDARY_pX]->Tref = pinterf_props[BOUNDARY_pX]->temperature; radenv_props->temperature = t_range[0]; radenv_props->reference = t_range[0]; - test_picard(scn_2d, 3/*Picard order*/, &ref); - test_picard(scn_3d, 3/*Picard order*/, &ref); + test_picard(scn_2d, 3/*Picard order*/, SDIS_DIFFUSION_WOS, &ref); + test_picard(scn_3d, 3/*Picard order*/, SDIS_DIFFUSION_WOS, &ref); register_heat_paths(scn_2d, 3/*Picard order*/, stream); register_heat_paths(scn_3d, 3/*Picard order*/, stream); printf("\n"); @@ -787,8 +789,8 @@ main(int argc, char** argv) pinterf_props[BOUNDARY_pX]->Tref = 300; radenv_props->temperature = t_range[0]; radenv_props->reference = 300; - test_picard(scn_2d, 1/*Picard order*/, &ref); - test_picard(scn_3d, 1/*Picard order*/, &ref); + test_picard(scn_2d, 1/*Picard order*/, SDIS_DIFFUSION_DELTA_SPHERE, &ref); + test_picard(scn_3d, 1/*Picard order*/, SDIS_DIFFUSION_DELTA_SPHERE, &ref); printf("\n"); /* Test picard1 with a volumic power and T4 a the reference */ @@ -801,8 +803,8 @@ main(int argc, char** argv) pinterf_props[BOUNDARY_pX]->Tref = 350; radenv_props->temperature = 280; radenv_props->reference = 280; - test_picard(scn_2d, 1/*Picard order*/, &ref); - test_picard(scn_3d, 1/*Picard order*/, &ref); + test_picard(scn_2d, 1/*Picard order*/, SDIS_DIFFUSION_WOS, &ref); + test_picard(scn_3d, 1/*Picard order*/, SDIS_DIFFUSION_WOS, &ref); printf("\n"); /* Release memory */