stardis

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

commit 50f00b539c7e94b6026fe4ab99ac93043160f879
parent fa71d0c640e9a96196309f3ac415dea570c61e28
Author: Benjamin Piaud <benjamin.piaud@meso-star.com>
Date:   Mon, 23 Apr 2018 14:14:10 +0200

ajout d'une fonction de check entre probe et boundary

Diffstat:
Msrc/stardis-app.c | 25++++++++++++++++++++++++-
Msrc/stardis-app.h | 1+
Msrc/stardis-compute.c | 1-
3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/stardis-app.c b/src/stardis-app.c @@ -2,7 +2,6 @@ #include <string.h> #include "stardis-app.h" -#include <tinyexpr.h> #define MEDIUM 0 @@ -305,6 +304,26 @@ error: goto exit; } +static res_T +check_consistency +(struct boundary* boundary, double* probe) +{ + res_T res = RES_OK; + int i = 0; + + for (i=0; i<sa_size(boundary); ++i){ + if (strchr(boundary[i].T,'t') && probe[3] == INF) { + fprintf(stderr,"Transient bounday condition is inconsistent with INF time of the probe.\n"); + res = RES_BAD_ARG; + goto error; + } + } + +exit: + return res; +error: + goto exit; +} /******************************************************************************* * @@ -322,6 +341,7 @@ stardis_init &stardis->geometry, &stardis->material, &stardis->boundary); + if (res != RES_OK) goto error; stardis->N = args->N; stardis->nthreads = args->nthreads; @@ -330,6 +350,9 @@ stardis_init stardis->probe[2] = args->probe[2]; stardis->probe[3] = args->probe[3]; + res = check_consistency(stardis->boundary, stardis->probe); + if (res != RES_OK) goto error; + exit: return res; error: diff --git a/src/stardis-app.h b/src/stardis-app.h @@ -9,6 +9,7 @@ #include <rsys/stretchy_array.h> #include <rsys/hash_table.h> #include <sdis.h> +#include <tinyexpr.h> #include "args.h" struct vertex{ diff --git a/src/stardis-compute.c b/src/stardis-compute.c @@ -2,7 +2,6 @@ #include "stardis-app.h" #include <sdis.h> -#include <tinyexpr.h> static void geometry_get_position