stardis-solver

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

commit 34f84f757a0f562f8561da1d5525e429864b9abd
parent d14b6166fd3df6788167c656d7774fb9ae4d27d3
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Mon, 22 Oct 2018 12:06:39 +0200

Fix warnings

Diffstat:
Msrc/sdis_solve_Xd.h | 21+++++++++++++++++----
Msrc/test_sdis_convection.c | 6++++--
Msrc/test_sdis_convection_non_uniform.c | 6++++--
3 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/src/sdis_solve_Xd.h b/src/sdis_solve_Xd.h @@ -1186,6 +1186,20 @@ XD(boundary_temperature) return RES_OK; } +#ifdef COMPILER_CL +#pragma warning(push) +#pragma warning(disable : 4701) +/* potentially uninitialized local variable 'info' used + * + * For warning numbers in the range 4700-4999, which are the ones associated + * with code generation, the state of the warning in effect when the compiler + * encounters the open curly brace of a function will be in effect for the rest + * of the function. Using the warning pragma in the function to change the + * state of a warning that has a number larger than 4699 will only take effect + * after the end of the function. The following example shows the correct + * placement of warning pragmas to disable a code-generation warning message, + * and then to restore it. */ +#endif res_T XD(solid_temperature) (struct sdis_scene* scn, @@ -1393,6 +1407,9 @@ XD(solid_temperature) rwalk->mdm = NULL; /* The random walk is at an interface between 2 media */ return RES_OK; } +#ifdef COMPILER_CL +#pragma warning(pop) +#endif static res_T XD(compute_temperature) @@ -1894,7 +1911,6 @@ XD(solve_boundary) double w = NaN; double uv[DIM-1]; float st[DIM-1]; - double time; res_T res_local = RES_OK; if(ATOMIC_GET(&res) != RES_OK) continue; /* An error occurred */ @@ -1923,9 +1939,6 @@ XD(solve_boundary) iprim = primitives[prim.prim_id]; side = sides[prim.prim_id]; - /* Sample a time */ - time = sample_time(time_range, rng); - /* Invoke the boundary realisation */ res_local = XD(boundary_realisation) (scn, rng, iprim, uv, time_range, side, fp_to_meter, Tarad, Tref, &w); diff --git a/src/test_sdis_convection.c b/src/test_sdis_convection.c @@ -261,7 +261,8 @@ main(int argc, char** argv) printf("Temperature of the box at (%g %g %g)\n", SPLIT3(pos)); FOR_EACH(i, 0, 5) { double time = i ? (double) i / nu : INF; - double time_range[2] = { time, time }; + double time_range[2]; + time_range[0] = time_range[1] = time; ref = Tf_0 * exp(-nu * time) + Tinf * (1 - exp(-nu * time)); /* Solve in 3D */ @@ -283,7 +284,8 @@ main(int argc, char** argv) printf("Temperature of the square at (%g %g)\n", SPLIT2(pos)); FOR_EACH(i, 0, 5) { double time = i ? (double) i / nu : INF; - double time_range[2] = { time, time }; + double time_range[2]; + time_range[0] = time_range[1] = time; ref = Tf_0 * exp(-nu * time) + Tinf * (1 - exp(-nu * time)); /* Solve in 2D */ diff --git a/src/test_sdis_convection_non_uniform.c b/src/test_sdis_convection_non_uniform.c @@ -276,7 +276,8 @@ main(int argc, char** argv) printf("Temperature of the box at (%g %g %g)\n", SPLIT3(pos)); FOR_EACH(i, 0, 5) { double time = i ? (double) i / nu : INF; - double time_range[2] = { time, time }; + double time_range[2]; + time_range[0] = time_range[1] = time; ref = Tf_0 * exp(-nu * time) + Tinf * (1 - exp(-nu * time)); /* Solve in 3D */ @@ -298,7 +299,8 @@ main(int argc, char** argv) printf("Temperature of the square at (%g %g)\n", SPLIT2(pos)); FOR_EACH(i, 0, 5) { double time = i ? (double) i / nu : INF; - double time_range[2] = { time, time }; + double time_range[2]; + time_range[0] = time_range[1] = time; ref = Tf_0 * exp(-nu * time) + Tinf * (1 - exp(-nu * time)); OK(sdis_solve_probe(square_scn, N, pos, time_range, 1.0, 0, 0, &estimator));