commit 087bc681bda8dd86a30c1828943fcc8ed8911bec
parent 914b9674595eee9d6ab1a1c906d0378007d56e99
Author: Benjamin Piaud <benjamin.piaud@meso-star.com>
Date: Fri, 29 Jun 2018 15:16:45 +0200
passage à stardis 0.4
Diffstat:
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/src/Makefile b/src/Makefile
@@ -1,11 +1,12 @@
-#SDIS_SDK=../Stardis-0.3.0-GNU-Linux64
-SDIS_SDK=/home/piaud/code/star-engine-stardis/local/
-SDIS_SDK_DBG=/home/piaud/code/star-engine-stardis/local/
+SDIS_SDK=../Stardis-0.3.0-GNU-Linux64
+#SDIS_SDK=../Stardis-0.4.0-GNU-Linux64
+#SDIS_SDK=/home/piaud/code/star-engine-stardis/local/
+#SDIS_SDK_DBG=/home/piaud/code/star-engine-stardis/local/
INC=-I${SDIS_SDK}/include
CFLAGS=-std=c99 -pedantic -Wall
-LDFLAGS =-lsdis -lsstl -lrsys -ltinyexpr -lm -L${SDIS_SDK_DBG}/lib -Wl,-rpath=${SDIS_SDK_DBG}/lib
-LDFLAGS_DBG=-lsdis-dbg -lsstl -lrsys -ltinyexpr -lm -L${SDIS_SDK_DBG}/lib -Wl,-rpath=${SDIS_SDK_DBG}/lib
+LDFLAGS =-lsdis -lsstl -lrsys -ltinyexpr -lm -L${SDIS_SDK}/lib -Wl,-rpath=${SDIS_SDK}/lib
+LDFLAGS_DBG=-lsdis-dbg -lsstl -lrsys -ltinyexpr -lm -L${SDIS_SDK}/lib -Wl,-rpath=${SDIS_SDK}/lib
SRC=main.c stardis-app.c stardis-compute.c
DEPS=args.h stardis-app.h
diff --git a/src/args.h b/src/args.h
@@ -7,6 +7,7 @@
#include <getopt.h>
#include <rsys/rsys.h>
#include <rsys/cstr.h>
+#include <sdis_version.h>
enum stardis_mode{
PROBE_COMPUTE,
@@ -31,6 +32,8 @@ static const struct args ARGS_DEFAULT = ARGS_DEFAULT__;
static void
print_help(char* prog)
{
+ printf("stardis-app built-on stardis library version %i.%i.%i\n",
+ Stardis_VERSION_MAJOR,Stardis_VERSION_MINOR,Stardis_VERSION_PATCH);
printf("usage : \n%s -m MEDIUM.txt -b BOUNDARY.txt [-p X,Y,Z,TIME]\n", prog);
printf("[-s SCALE_FACTOR] [-d] [-n NUM_OF_REALIZATIONS] [-t NUM_OF_THREADS]\n");
printf("[-r AMBIENT_RAD_TEMP:REFERENCE_TEMP]\n");
@@ -47,7 +50,7 @@ print_help(char* prog)
printf("-------------------\n");
printf("\n -p X:Y:Z:TIME :\n");
printf(" this is the position and the time of the probe.\n");
- printf(" default value: 0.0:0.0:0.0:INF.\n");
+ printf(" default value: 0.0,0.0,0.0,INF.\n");
printf(" The probe must be in a medium. If some boundary conditions are\n");
printf(" time-dependant, TIME can not be INF.\n");
printf("\n -s SCALE_FACTOR :\n");
diff --git a/src/stardis-compute.c b/src/stardis-compute.c
@@ -2,6 +2,7 @@
#include "stardis-app.h"
#include <sdis.h>
+#include <sdis_version.h>
#include <rsys/double3.h>
#include <rsys/image.h>
@@ -132,6 +133,7 @@ solid_get_delta
return solid_props->delta;
}
+#if Stardis_VERSION_MINOR == 3
static double
solid_get_delta_boundary
(const struct sdis_rwalk_vertex* vtx, struct sdis_data* data)
@@ -140,8 +142,9 @@ solid_get_delta_boundary
return solid_props->delta
/* Emperical scale factor that ensures that delta_boundary > delta withouht
* being an exact multiple of delta. */
- * 2.1 ;
+ /** 2.1 */;
}
+#endif
static double
solid_get_temperature
@@ -311,7 +314,7 @@ select_probe_type
d3_sub(dp, pos, projected_pos);
delta = mat[triangle[i].medium_front].delta;
- if (d3_len(dp) < delta*2.1){
+ if (d3_len(dp) < delta){
*iprim = i;
fprintf(stderr,"The probe is very close to the primitive %lu.\n",*iprim );
fprintf(stderr,"So the probe is moved to this primitive at the position: %g %g %g\n",
@@ -425,8 +428,10 @@ stardis_compute(struct stardis* stardis, enum stardis_mode mode)
solid_shader.calorific_capacity = solid_get_calorific_capacity;
solid_shader.thermal_conductivity = solid_get_thermal_conductivity;
solid_shader.volumic_mass = solid_get_volumic_mass;
- solid_shader.delta_solid = solid_get_delta;
+ solid_shader.delta_solid = solid_get_delta;
+#if Stardis_VERSION_MINOR == 3
solid_shader.delta_boundary = solid_get_delta_boundary;
+#endif
solid_shader.temperature = solid_get_temperature;
solid_shader.volumic_power = solid_get_power;