stardis

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

commit 5c5b6524af1d39b4b0ad27bbf09d0b7087043e7c
parent 472c6ce26d2f6dfa4d84018fd6b7a97f95a489c5
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Thu, 14 May 2020 20:33:06 +0200

Some renames + remove useless code

Diffstat:
Msrc/stardis-compute.c | 26++++++++++----------------
Msrc/stardis-output.c | 4++--
Msrc/stardis-parsing.c | 7+++----
3 files changed, 15 insertions(+), 22 deletions(-)

diff --git a/src/stardis-compute.c b/src/stardis-compute.c @@ -36,7 +36,7 @@ /* Check probe position and move it to the closest point on an interface * if on_interface is set */ static res_T -select_probe_type +check_probe_conform_to_type (const struct stardis* stardis, const int move2boundary, double pos[3], @@ -267,7 +267,7 @@ static res_T compute_probe(struct stardis* stardis) { res_T res = RES_OK; - double time[2], pos[3], uv[2] = { 0,0 }; + double time[2], uv[2] = { 0,0 }; size_t iprim = SIZE_MAX; struct sdis_green_function* green = NULL; struct sdis_estimator* estimator = NULL; @@ -276,13 +276,12 @@ compute_probe(struct stardis* stardis) ASSERT(stardis && (stardis->mode & MODE_PROBE_COMPUTE)); - d3_set(pos, stardis->probe); - ERR(select_probe_type(stardis, 0, pos, &iprim, uv)); + ERR(check_probe_conform_to_type(stardis, 0, stardis->probe, &iprim, uv)); if(stardis->mode & (MODE_BIN_GREEN | MODE_GREEN)) { ERR(sdis_solve_probe_green_function(stardis->sdis_scn, stardis->samples, - pos, + stardis->probe, stardis->scale_factor, stardis->ambient_temp, stardis->ref_temp, @@ -304,7 +303,7 @@ compute_probe(struct stardis* stardis) d2_splat(time, stardis->probe[3]); ERR(sdis_solve_probe(stardis->sdis_scn, stardis->samples, - pos, + stardis->probe, time, stardis->scale_factor, stardis->ambient_temp, @@ -331,7 +330,7 @@ static res_T compute_probe_on_interface(struct stardis* stardis) { res_T res = RES_OK; - double time[2], pos[3], uv[2] = { 0,0 }; + double time[2], uv[2] = { 0,0 }; size_t iprim = SIZE_MAX; struct sdis_estimator* estimator = NULL; struct sdis_green_function* green = NULL; @@ -339,8 +338,7 @@ compute_probe_on_interface(struct stardis* stardis) FILE* stream = NULL; ASSERT(stardis && (stardis->mode & MODE_PROBE_COMPUTE_ON_INTERFACE)); - d3_set(pos, stardis->probe); - ERR(select_probe_type(stardis, 1, pos, &iprim, uv)); + ERR(check_probe_conform_to_type(stardis, 1, stardis->probe, &iprim, uv)); ASSERT(iprim != SIZE_MAX); if(stardis->mode & (MODE_BIN_GREEN | MODE_GREEN)) { @@ -669,7 +667,7 @@ static res_T compute_boundary(struct stardis* stardis) { res_T res = RES_OK; - double time[2], pos[3]; + double time[2]; struct sdis_green_function* green = NULL; struct sdis_estimator* estimator = NULL; struct dump_path_context dump_ctx; @@ -677,8 +675,6 @@ compute_boundary(struct stardis* stardis) ASSERT(stardis && (stardis->mode & MODE_BOUNDARY_COMPUTE)); - d3_set(pos, stardis->probe); - if(stardis->mode & (MODE_BIN_GREEN | MODE_GREEN)) { ERR(sdis_solve_boundary_green_function(stardis->sdis_scn, stardis->samples, @@ -735,14 +731,13 @@ static res_T compute_flux_boundary(struct stardis* stardis) { res_T res = RES_OK; - double time[2], pos[3]; + double time[2]; struct sdis_green_function* green = NULL; struct sdis_estimator* estimator = NULL; struct dump_path_context dump_ctx; ASSERT(stardis && (stardis->mode & MODE_FLUX_BOUNDARY_COMPUTE)); - d3_set(pos, stardis->probe); d2_splat(time, stardis->probe[3]); ERR(sdis_solve_boundary_flux(stardis->sdis_scn, stardis->samples, @@ -772,7 +767,7 @@ static res_T compute_map(struct stardis* stardis) { res_T res = RES_OK; - double time[2], pos[3]; + double time[2]; struct sdis_green_function* green = NULL; struct darray_estimators estimators; int estimators_initialized = 0; @@ -784,7 +779,6 @@ compute_map(struct stardis* stardis) darray_estimators_init(stardis->allocator, &estimators); estimators_initialized = 1; - d3_set(pos, stardis->probe); d2_splat(time, stardis->probe[3]); ERR(darray_estimators_resize(&estimators, diff --git a/src/stardis-output.c b/src/stardis-output.c @@ -927,7 +927,7 @@ print_single_MC_result case MODE_PROBE_COMPUTE: case MODE_PROBE_COMPUTE_ON_INTERFACE: if(stardis->mode & MODE_EXTENDED_RESULTS) { - fprintf(stream, "Temperature at [%g, %g, %g] at t=%g = %g +/- %g\n", + fprintf(stream, "Boundary temperature at [%g, %g, %g] at t=%g = %g +/- %g\n", SPLIT4(stardis->probe), result.E, /* Expected value */ result.SE); /* Standard error */ @@ -937,7 +937,7 @@ print_single_MC_result break; case MODE_MEDIUM_COMPUTE: if(stardis->mode & MODE_EXTENDED_RESULTS) { - fprintf(stream, "Temperature in medium %s at t=%g = %g +/- %g\n", + fprintf(stream, "Temperature in medium '%s' at t=%g = %g +/- %g\n", str_cget(&stardis->solve_name), stardis->probe[3], result.E, /* Expected value */ result.SE); /* Standard error */ diff --git a/src/stardis-parsing.c b/src/stardis-parsing.c @@ -1317,8 +1317,7 @@ read_imposed_temperature /* Could be 'unknown' */ _strupr(tk); if(0 == strcmp(tk, "UNKNOWN")) { - /* Unknown for stadis solver is -1 */ - *imposed_temperature = -1; + *imposed_temperature = UNKNOWN_MEDIUM_TEMPERATURE; } else { res = RES_BAD_ARG; goto error; @@ -1357,8 +1356,8 @@ read_delta /* Could be 'auto' */ _strupr(tk); if(0 == strcmp(tk, "AUTO")) { - /* Set to -1 until actual value is substituted */ - *delta = -1; + /* Set to DELTA_AUTO until actual value is substituted */ + *delta = DELTA_AUTO; } else { res = RES_BAD_ARG; goto error;