stardis-solver

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

commit 5d64a935df38dfee73c45d4a2e49b7a1d701c08b
parent e26ea1b581b5cb20cb2228672726275b4c8192c8
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Thu,  7 Mar 2019 15:15:09 +0100

Fix Windows build

Diffstat:
Msrc/sdis.h | 8++++----
Msrc/sdis_green.c | 15++++++++-------
Msrc/sdis_heat_path_conductive_Xd.h | 2+-
Msrc/test_sdis_utils.c | 4++--
4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/sdis.h b/src/sdis.h @@ -288,7 +288,7 @@ struct sdis_point { struct sdis_rwalk_vertex vertex; } mdmvert; struct { - struct sdis_interface* interface; + struct sdis_interface* intface; struct sdis_interface_fragment fragment; } itfrag; } data; @@ -533,16 +533,16 @@ sdis_interface_ref_put SDIS_API res_T sdis_interface_get_shader - (const struct sdis_interface* interface, + (const struct sdis_interface* interf, struct sdis_interface_shader* shader); SDIS_API struct sdis_data* sdis_interface_get_data - (struct sdis_interface* interface); + (struct sdis_interface* interf); SDIS_API unsigned sdis_interface_get_id - (const struct sdis_interface* interface); + (const struct sdis_interface* interf); /******************************************************************************* * A scene is a collection of primitives. Each primitive is the geometric diff --git a/src/sdis_green.c b/src/sdis_green.c @@ -36,14 +36,15 @@ struct power_term { double term; /* Power term computed during green estimation */ unsigned id; /* Identifier of the medium of the term */ }; + #define POWER_TERM_NULL__ {INF, UINT_MAX} -static const struct power_term POWER_TERM_NULL = POWER_TERM_NULL__; static INLINE void power_term_init(struct mem_allocator* allocator, struct power_term* term) { + struct power_term power_term_null = POWER_TERM_NULL__; ASSERT(term); (void)allocator; - *term = POWER_TERM_NULL; + *term = power_term_null; } /* Generate the dynamic array of power terms */ @@ -58,13 +59,13 @@ struct flux_term { enum sdis_side side; }; #define FLUX_TERM_NULL__ {INF, UINT_MAX, SDIS_SIDE_NULL__} -static const struct flux_term FLUX_TERM_NULL = FLUX_TERM_NULL__; static INLINE void flux_term_init(struct mem_allocator* allocator, struct flux_term* term) { + const struct flux_term flux_term_null = FLUX_TERM_NULL__; ASSERT(term); (void)allocator; - *term = FLUX_TERM_NULL; + *term = flux_term_null; } /* Generate the dynamic array of flux terms */ @@ -577,7 +578,7 @@ sdis_green_path_get_limit_point switch(path->limit_type) { case SDIS_FRAGMENT: - pt->data.itfrag.interface = green_function_fetch_interf(green, path->limit_id); + pt->data.itfrag.intface = green_function_fetch_interf(green, path->limit_id); pt->data.itfrag.fragment = path->limit.fragment; break; case SDIS_VERTEX: @@ -897,7 +898,7 @@ green_path_add_power_term if(iterm < nterms) { terms[iterm].term += val; } else { - struct power_term term = POWER_TERM_NULL; + struct power_term term = POWER_TERM_NULL__; term.term = val; term.id = id; res = darray_power_term_push_back(&handle->path->power_terms, &term); @@ -956,7 +957,7 @@ green_path_add_flux_term if(iterm < nterms) { terms[iterm].term += val; } else { - struct flux_term term = FLUX_TERM_NULL; + struct flux_term term = FLUX_TERM_NULL__; term.term = val; term.id = id; term.side = frag->side; diff --git a/src/sdis_heat_path_conductive_Xd.h b/src/sdis_heat_path_conductive_Xd.h @@ -67,7 +67,7 @@ XD(conductive_path) double rho; /* Volumic mass */ double cp; /* Calorific capacity */ double tmp; - double power_factor; + double power_factor = 0; double power; float delta, delta_solid; /* Random walk numerical parameter */ float range[2]; diff --git a/src/test_sdis_utils.c b/src/test_sdis_utils.c @@ -118,8 +118,8 @@ solve_green_path(struct sdis_green_path* path, void* ctx) case SDIS_FRAGMENT: frag = pt.data.itfrag.fragment; frag.time = INF; - OK(sdis_interface_get_shader(pt.data.itfrag.interface, &interf)); - data = sdis_interface_get_data(pt.data.itfrag.interface); + OK(sdis_interface_get_shader(pt.data.itfrag.intface, &interf)); + data = sdis_interface_get_data(pt.data.itfrag.intface); temp = frag.side == SDIS_FRONT ? interf.front.temperature(&frag, data) : interf.back.temperature(&frag, data);