stardis

Perform coupled heat transfer calculations
git clone git://git.meso-star.fr/stardis.git
Log | Files | Refs | README | LICENSE

commit f0497ffd06fd9ceea9113104410a454b23e2fde2
parent 02feedff35e343bf06d84517eb2bac9641acda75
Author: christophe coustet <christophe.coustet@meso-star.com>
Date:   Thu,  8 Nov 2018 15:46:56 +0100

Fix remaining gcc warnings

Diffstat:
Msrc/stardis-app.c | 14+++++++-------
Msrc/stardis-app.h | 10+++++-----
Msrc/stardis-compute.c | 19++++++++++++-------
3 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/src/stardis-app.c b/src/stardis-app.c @@ -32,7 +32,7 @@ read_line(char** pb, FILE* stream) return b; } -char** split_line(char* a_str, const char a_delim) +static char** split_line(char* a_str, const char a_delim) { char** result = 0; size_t count = 0; @@ -204,7 +204,7 @@ read_vertices struct vertex** vert_list) { res_T res = RES_OK; - int vtx_index = 0; + unsigned vtx_index = 0; for (vtx_index = 0; vtx_index < desc->vertices_count; ++vtx_index){ struct vertex vtx = NULL_VERTEX; @@ -242,7 +242,7 @@ read_triangles struct triangle** tri_list) { res_T res = RES_OK; - int tri_index = 0; + unsigned tri_index = 0; (void)cl_type; for (tri_index = 0; tri_index < desc->triangles_count; ++tri_index){ struct triangle tri = NULL_TRIANGLE; @@ -392,7 +392,7 @@ check_consistency (struct boundary* boundary, double* probe) { res_T res = RES_OK; - int i = 0; + size_t i = 0; for (i=0; i<sa_size(boundary); ++i){ if ( boundary[i].T && strchr(boundary[i].T,'t') && probe[3] == INF) { @@ -504,7 +504,7 @@ error: res_T stardis_release(struct stardis* stardis) { - int i = 0; + size_t i = 0; res_T res = RES_OK; for (i=0; i<sa_size(stardis->material); ++i){ @@ -533,10 +533,10 @@ res_T dump_vtk (FILE* output, const struct geometry* geometry, - int nbound) + unsigned nbound) { res_T res = RES_OK; - int i,j = 0; + unsigned i,j = 0; struct vertex* vtx = geometry->vertex; struct triangle* tri = geometry->triangle; diff --git a/src/stardis-app.h b/src/stardis-app.h @@ -42,11 +42,11 @@ eq_vertex(const struct vertex* a, const struct vertex* b) struct triangle{ unsigned indices[3]; unsigned sids[3]; - int medium_front; - int medium_back; - int bound_id; + unsigned medium_front; + unsigned medium_back; + unsigned bound_id; }; -#define NULL_TRIANGLE__ {{0, 0, 0}, {0, 0, 0}, -1, -1, -1} +#define NULL_TRIANGLE__ {{0, 0, 0}, {0, 0, 0}, UINT_MAX, UINT_MAX, UINT_MAX} static const struct triangle NULL_TRIANGLE = NULL_TRIANGLE__; static char @@ -153,6 +153,6 @@ extern res_T stardis_release(struct stardis* stardis); extern res_T -dump_vtk(FILE* output, const struct geometry* geometry, int nbound); +dump_vtk(FILE* output, const struct geometry* geometry, unsigned nbound); #endif /*STARDIS-APP_H*/ diff --git a/src/stardis-compute.c b/src/stardis-compute.c @@ -77,7 +77,8 @@ fluid_get_temperature char* math_expr = fluid_props->temperature; static double x, y, z, t; /* Store variable names and pointers. */ - te_variable vars[] = {{"x", &x}, {"y", &y}, {"z", &z}, {"t", &t}}; + te_variable vars[] = {{"x", {&x}, TE_VARIABLE, NULL}, {"y", {&y}, TE_VARIABLE, NULL}, + {"z", {&z}, TE_VARIABLE, NULL}, {"t", {&t}, TE_VARIABLE, NULL}}; int err; /* Compile the expression with variables. */ @@ -164,7 +165,8 @@ solid_get_temperature char* math_expr = solid_props->temperature; static double x, y, z; /* Store variable names and pointers. */ - te_variable vars[] = {{"x", &x}, {"y", &y}, {"z", &z}}; + te_variable vars[] = {{"x", {&x}, TE_VARIABLE, NULL}, {"y", {&y}, TE_VARIABLE, NULL}, + {"z", {&z}, TE_VARIABLE, NULL}}; int err; /* Compile the expression with variables. */ @@ -187,7 +189,8 @@ solid_get_power char* math_expr = solid_props->temperature; static double x, y, z, t; /* Store variable names and pointers. */ - te_variable vars[] = {{"x", &x}, {"y", &y}, {"z", &z}, {"t", &t}}; + te_variable vars[] = {{"x", {&x}, TE_VARIABLE, NULL}, {"y", {&y}, TE_VARIABLE, NULL}, + {"z", {&z}, TE_VARIABLE, NULL}, {"t", {&t}, TE_VARIABLE, NULL}}; int err; /* Compile the expression with variables. */ @@ -235,7 +238,8 @@ interface_get_temperature char* math_expr = interface_props->temperature; static double x, y, z, t; /* Store variable names and pointers. */ - te_variable vars[] = {{"x", &x}, {"y", &y}, {"z", &z}, {"t", &t}}; + te_variable vars[] = {{"x", {&x}, TE_VARIABLE, NULL}, {"y", {&y}, TE_VARIABLE, NULL}, + {"z", {&z}, TE_VARIABLE, NULL}, {"t", {&t}, TE_VARIABLE, NULL}}; int err; /* Compile the expression with variables. */ @@ -264,7 +268,8 @@ interface_get_flux char* math_expr = interface_props->flux; static double x, y, z, t; /* Store variable names and pointers. */ - te_variable vars[] = {{"x", &x}, {"y", &y}, {"z", &z}, {"t", &t}}; + te_variable vars[] = {{"x", {&x}, TE_VARIABLE, NULL}, {"y", {&y}, TE_VARIABLE, NULL}, + {"z", {&z}, TE_VARIABLE, NULL}, {"t", {&t}, TE_VARIABLE, NULL}}; int err; /* Compile the expression with variables. */ @@ -478,9 +483,9 @@ stardis_compute(struct stardis* stardis, enum stardis_mode mode) interface_shader_boundary.back = interface_shader_back; for (i=0; i<sa_size(stardis->geometry.triangle); ++i){ - int bound_id = stardis->geometry.triangle[i].bound_id; + unsigned bound_id = stardis->geometry.triangle[i].bound_id; - if (bound_id > -1){ /* boundary interface */ + if (bound_id != UINT_MAX){ /* boundary interface */ double hc = stardis->boundary[bound_id].hc; char* T = stardis->boundary[bound_id].T; char* flux = stardis->boundary[bound_id].flux;