commit c9519be529e1215d8faa76973067745451e01b07
parent 42824c2474a58cbcd24e72fefd685013a62f022d
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Wed, 25 Nov 2020 15:37:01 +0100
Merge branch 'release_0.5.1'
Diffstat:
7 files changed, 145 insertions(+), 94 deletions(-)
diff --git a/README.md b/README.md
@@ -25,15 +25,21 @@ as well as on the [OpenMP](http://www.openmp.org) 2.0 specification to
parallelize its computations.
-First ensure that CMake and a C99 compiler that implements the OpenMP 2.0
+First ensure that CMake and a C89 compiler that implements the OpenMP 2.0
specification are installed on your system. Then install the RCMake package as
well as all the aforementioned prerequisites. Finally generate the project from
the `cmake/CMakeLists.txt` file by appending to the `CMAKE_PREFIX_PATH`
variable the install directories of its dependencies.
-## Note de versions
+## Release notes
-### v0.5
+### Version 0.5.1
+
+- Fix a memleak
+- Add a file format version in binary Green files.
+- Man improvement.
+
+### Version 0.5
- Ensure C89 compliance.
- New output format for infra-red rendering.
@@ -43,14 +49,14 @@ variable the install directories of its dependencies.
- Allow unsteady Green's function computations.
- Model files now include scale parameter.
-### v0.4
+### Version 0.4
- Improve C99 compliance.
- Build on Windows systems.
- Use new stardis-solver 0.5.
- Transition to cmake to manage builds.
-### v0.3.2
+### Version 0.3.2
- Add the solve_probe_boundary feature. The solve_probe_boundary VS
solve_probe selection is automated according the probe-geometry distance.
@@ -58,14 +64,14 @@ variable the install directories of its dependencies.
from geometry.
- Add flux boundary conditions.
-### v0.3.1
+### Version 0.3.1
Add radiative transfer computations. To achieve this, media gain 2 new parameters:
- emissivity;
- specular_fraction.
-### v0.3
+### Version 0.3
- Upgrade stardis-solver to v0.3.
- Add volumic power sources on solids;
@@ -75,7 +81,7 @@ Add radiative transfer computations. To achieve this, media gain 2 new parameter
boundary conditions information.
-### v0.1
+### Version 0.1
- Allow probe computations on conductive-only thermal systems.
- Allow Dirichlet and h.dT boundary conditions.
\ No newline at end of file
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -56,7 +56,7 @@ configure_file(${SDIS_SOURCE_DIR}/../doc/stardis.1.txt.in
set(SDIS_VERSION_MAJOR 0)
set(SDIS_VERSION_MINOR 5)
-set(SDIS_VERSION_PATCH 0)
+set(SDIS_VERSION_PATCH 1)
set(SDIS_VERSION ${SDIS_VERSION_MAJOR}.${SDIS_VERSION_MINOR}.${SDIS_VERSION_PATCH})
configure_file(${SDIS_SOURCE_DIR}/stardis-default.h.in
@@ -71,7 +71,7 @@ configure_file(${SDIS_SOURCE_DIR}/stardis-version.h.in
find_package(RCMake 0.4 REQUIRED)
find_package(RSys 0.11 REQUIRED)
find_package(StarGeom3D 0.1 REQUIRED)
-find_package(Star3D 0.7.1 REQUIRED)
+find_package(Star3D 0.7.3 REQUIRED)
find_package(StarEnc3D 0.4.2 REQUIRED)
find_package(Stardis 0.11 REQUIRED)
find_package(StarSTL 0.3 REQUIRED)
diff --git a/doc/stardis-input.5.txt b/doc/stardis-input.5.txt
@@ -102,25 +102,30 @@ _______
<comment> ::= "#" Any text introduced by the # character
-<scaling_factor> ::= REAL # scaling factor to apply to the geometry ; in ]0 INF)
+<scaling_factor> ::= REAL # scaling factor to apply to the geometry
+ # in ]0 INF)
<solid-frontier> ::= "SOLID" <medium-name> <lambda> <rho> <cp> <delta> \
- <initial-temp> <imposed-temperature> <volumic-power> \
- <triangle-sides>
+ <initial-temperature> <imposed-temperature> \
+ <volumic-power> <triangle-sides>
-<fluid-frontier> ::= "FLUID" <medium-name> <rho> <cp> <initial-temp> \
- <imposed-temperature> <triangle-sides>
+<fluid-frontier> ::= "FLUID" <medium-name> <rho> <cp> \
+ <initial-temperature> <imposed-temperature> \
+ <triangle-sides>
-<t-bound-for-solid> ::= "T_BOUNDARY_FOR_SOLID" <bound-name> <temperature> <triangles>
+<t-bound-for-solid> ::= "T_BOUNDARY_FOR_SOLID" <bound-name> <temperature> \
+ <triangles>
<t-bound-for-fluid> ::= "T_BOUNDARY_FOR_FLUID" <bound-name> <temperature> \
<emissivity> <specular-fraction> <hc> <triangles>
<h-bound-for-solid> ::= "H_BOUNDARY_FOR_SOLID" <bound-name> <emissivity> \
- <specular-fraction> <hc> <outside-temperature> <triangles>
+ <specular-fraction> <hc> <outside-temperature> \
+ <triangles>
<h-bound-for-fluid> ::= "H_BOUNDARY_FOR_FLUID" <bound-name> <emissivity> \
- <specular-fraction> <hc> <outside-temperature> <triangles>
+ <specular-fraction> <hc> <outside-temperature> \
+ <triangles>
<f-bound-for-solid> ::= "F_BOUNDARY_FOR_SOLID" <bound-name> <flux> <triangles>
@@ -135,13 +140,15 @@ _______
<rho> ::= REAL # volumic mass,in kg/m3; in ]0, INF)
-<cp> ::= REAL # capacity, in J/(kg.K) or kg.m2/(s2.K); in ]0, INF)
+<cp> ::= REAL # capacity, in J/(kg.K) or kg.m2/(s2.K)
+ # in ]0, INF)
-<delta> ::= "AUTO" # delta is automatically set to V/6A (V and A being
- # respectively the solid volume and its boundary area)
+<delta> ::= "AUTO" # delta is automatically set to V/6A (V and A
+ # being respectively the solid volume and its
+ # boundary area)
| REAL # delta*scaling_factor in m; in [0, INF)
-<initial-temp> ::= REAL # in K; in [0, INF)
+<initial-temperature> ::= REAL # in K; in [0, INF)
<imposed-temperature> ::= "UNKNOWN" # temperature has to be solved
| REAL # in K; in [0, INF)
diff --git a/doc/stardis-output.5.txt b/doc/stardis-output.5.txt
@@ -127,8 +127,8 @@ _______
<mean-temp> ::= <MC-estimate> <failures-report>
-<mean-flux> ::= <MC-estimate> <MC-estimate> <MC-estimate> <MC-estimate> \
- <MC-estimate> <failures-report>
+<mean-flux> ::= <MC-estimate> <MC-estimate> <MC-estimate> \
+ <MC-estimate> <MC-estimate> <failures-report>
# MC estimates order is: temperature, convective flux,
# radiative flux, imposed flux, total flux
@@ -138,22 +138,29 @@ _______
<failures-report> ::= <error-count> <success-count>
-<ext-probe-temp> ::= "Temperature at" <probe-position> <time> <MC-estimate>
- <failures-report>
-
-<ext-mean-temp> ::= "Temperature at boundary" <file-name> <time> <MC-estimate>
- <failures-report>
-
-<ext-mean-flux> ::= "Temperature at boundary" <file-name> <time> <MC-estimate>
- "Convective flux at boundary " <file-name> <time> \
- <MC-estimate>
- "Radiative flux at boundary" <file-name> <time> <MC-estimate>
- "Imposed flux at boundary" <file-name> <time> <MC-estimate>
- "Total flux at boundary" <file-name> <time> <MC-estimate>
- <failures-report>
-
-<ext-medium-temp> ::= "Temperature in medium" <medium-name> <time> <MC-estimate>
- <failures-report>
+<ext-probe-temp> ::= "Temperature at" <ext-probe-position> <ext-time> \
+ <ext-MC-estimate>
+ <ext-failures-report>
+
+<ext-mean-temp> ::= "Temperature at boundary" <file-name> <ext-time> \
+ <ext-MC-estimate>
+ <ext-failures-report>
+
+<ext-mean-flux> ::= "Temperature at boundary" <file-name> <ext-time> \
+ <ext-MC-estimate>
+ "Convective flux at boundary " <file-name> \
+ <ext-time> <ext-MC-estimate>
+ "Radiative flux at boundary" <file-name> <ext-time> \
+ <ext-MC-estimate>
+ "Imposed flux at boundary" <file-name> <ext-time> \
+ <ext-MC-estimate>
+ "Total flux at boundary" <file-name> <ext-time> \
+ <ext-MC-estimate>
+ <ext-failures-report>
+
+<ext-medium-temp> ::= "Temperature in medium" <medium-name> <ext-time> \
+ <ext-MC-estimate>
+ <ext-failures-report>
<ext-probe-position> ::= "[" <x-value> "," <y-value> "," <z-value> "]"
@@ -181,7 +188,8 @@ _______
<success-count> ::= INTEGER # in [0, #samples]
-<expected-value> ::= REAL # depending on value semantics, range can be restricted
+<expected-value> ::= REAL # depending on value semantics,
+ # range can be restricted
<standard-deviation> ::= REAL # in [0, INF)
@@ -231,7 +239,8 @@ _______
#h-boundaries # unsigned
#flux-boundaries # unsigned
#solid-fluid-connections # unsigned
- names-pool-size # size of concatenated description names: unsigned
+ names-pool-size # size of concatenated description names
+ # unsigned
#ok-samples # size_t
#failed-samples # size_t
<descriptions>
@@ -368,10 +377,10 @@ _______
<ascii-green> ::= "---BEGIN GREEN---"
"# time range"
<time-range>
- "# #solids #fluids #t_boundaries #h_boundaries #f_boundaries \
- #ok #failures"
- #solids #fluids #t_boundaries #h_boundaries #f_boundaries \
- #ok #failures
+ "# #solids #fluids #t_boundaries #h_boundaries \
+ #f_boundaries #ok #failures"
+ #solids #fluids #t_boundaries #h_boundaries \
+ #f_boundaries #ok #failures
"# Solids"
"# ID Name lambda rho cp power"
<solids>
@@ -391,9 +400,10 @@ _______
"# ID Rad_Temp Lin_Temp"
<rad-temps>
"# Samples"
- "# end #power_terms #flux_terms power_term_1 ... power_term_n \
- flux_term_1 ... flux_term_n"
- "# end = end_type end_id; end_type = T | H | X | R | F | S"
+ "# end #power_terms #flux_terms power_term_1 ... \
+ power_term_n flux_term_1 ... flux_term_n"
+ "# end = end_type end_id; end_type = T | H | X | R | F \
+ | S"
"# power_term_i = power_id_i factor_i"
"# flux_term_i = flux_id_i factor_i"
<samples>
@@ -423,16 +433,19 @@ _______
-------------------------------------
-<sample> ::= <end-spec> <power-count> <flux-count> <power-terms> <flux-terms>
+<sample> ::= <end-spec> <power-count> <flux-count> <power-terms> \
+ <flux-terms>
-<solid> ::= <green-id> <name> <lambda> <rho> <cp> <power> <initial-temp> <imposed-temp>
+<solid> ::= <green-id> <name> <lambda> <rho> <cp> <power> \
+ <initial-temp> <imposed-temp>
-<fluid> ::= <green-id> <name> <rho> <cp> <initial-temp> <imposed-temp>
+<fluid> ::= <green-id> <name> <rho> <cp> <initial-temp> \
+ <imposed-temp>
<t-bound> ::= <green-id> <name> <temperature>
-<h-bound> ::= <green-id> <name> <emissivity> <specular_fraction> <hc> \
- <temperature>
+<h-bound> ::= <green-id> <name> <emissivity> <specular_fraction> \
+ <hc> <temperature>
<f-bound> ::= <green-id> <name> <flux>
@@ -497,10 +510,12 @@ _______
<flux-term> ::= <green-id> <flux-factor>
<power-factor> ::= REAL # in ]0, INF)
- # the temperature gain is power-factor * Power(green-id)
+ # the temperature gain is:
+ # <power-factor> * Power(green-id)
<flux-factor> ::= REAL # in ]0, INF)
- # the temperature gain is flux-factor * Flux(green-id)
+ # the temperature gain is:
+ # <flux-factor> * Flux(green-id)
_______
== HEAT PATHS' ENDS
@@ -588,7 +603,8 @@ _______
<unique-ids>
<user-ids>
[ <merge-conflicts> ] # if some merge conflict occured
- [ <property-conflicts> ] # if some property conflict occured
+ [ <property-conflicts> ] # if some property conflict
+ # occured
<file-ids>
<boundaries>
[ <compute-region> ] # if defined
@@ -640,7 +656,8 @@ _______
"LOOKUP_TABLE default"
<region-membership>
-<encl-or-overlaps> ::= <encl-information> # if enclosure extraction was possible
+<encl-or-overlaps> ::= <encl-information> # if enclosure extraction was
+ # possible
| <overlaps> # if overlapping triangles where detected
-----------------
@@ -689,7 +706,8 @@ _______
| "16" # SOLID_FLUID_CONNECTION between 2 solids
| "17" # SOLID_FLUID_CONNECTION between 2 fluids
| "18" # SOLID_FLUID_CONNECTION used as boundary
- | "19" # SOLID_FLUID_CONNECTION between 2 undefined media
+ | "19" # SOLID_FLUID_CONNECTION between 2 undefined
+ # media
| "20" # no connexion between 2 fluids
| "21" # no connexion between a solid and a fluid
| "22" # no boundary around a fluid
@@ -707,7 +725,8 @@ _______
<boundary-ids> ::= INTEGER # in [0 #submitted descriptions[
<boundary-ids> # #triangles ids
-<region-membership> ::= <reg-not-member> # triangle not part of the compute region
+<region-membership> ::= <reg-not-member> # triangle not part of the compute
+ # region
| <reg-member> # triangle is part of the compute region
<region-membership> # #triangles membership status
@@ -725,7 +744,8 @@ _______
<enclosures> ::= "FIELD FieldData 2"
"Enclosures" #enclosures #triangles "unsigned_char"
<encl-memberships>
- "Enclosures_internal_media" #enclosures #triangles "unsigned_int"
+ "Enclosures_internal_media" #enclosures #triangles \
+ "unsigned_int"
<encl-media>
-----------------
@@ -734,10 +754,10 @@ _______
| "1" # triangle surrounding a hole
<hole-memberships> # #triangles hole memberships
-<encl-memberships> ::= <enclosure-status 0> ... <enclosure-status #enclosures-1>
+<encl-memberships> ::= <encl-status 0> ... <encl-status #enclosures-1>
<encl-memberships> # #triangles enclosure memberships
-<encl-media> ::= <enclosure 0 medium> ... <enclosure #enclosures-1 medium>
+<encl-media> ::= <encl 0 medium> ... <encl #enclosures-1 medium>
<encl-media> # #triangles enclosure media
<medium-id> ::= INTEGER # in [0, #medium[
@@ -749,22 +769,29 @@ _______
<reg-member> ::= "1" # the FRONT side is member of the region
| "2" # the BACK side is member of the region
| "3" # both sides are member of the region
- | "4294967295" # the triangle is an invalid part of the region
+ | "4294967295" # the triangle is an invalid part of
+ # the region
<overlapping-status> ::= "0" # triangle not overlapping another triangle
| "1" # triangle overlapping another triangle
<overlapping-status> # #triangles overlapping status
-<enclosure-status i> ::= <encl-not-member> # the triangle is not part of the ith enclosure
- | <encl-member> # the triangle is part of the ith enclosure
-
-<enclosure i medium> ::= <medium-id> # the triangle is part of the ith enclosure and
- # has this medium in the involved side(s)
- | "4294967293" # the triangle is part of the ith enclosure and
- # has no defined medium in the involved side(s)
- | "4294967294" # the 2 sides of the triangle are part of the ith
- # enclosure, but have 2 different media
- | "4294967295" # the triangle is not part of the ith enclosure
+<encl-status i> ::= <encl-not-member> # the triangle is not part of the
+ # ith enclosure
+ | <encl-member> # the triangle is part of the ith
+ # enclosure
+
+<enc i medium> ::= <medium-id> # the triangle is part of the ith
+ # enclosure and has this medium in the
+ # involved side(s)
+ | "4294967293" # the triangle is part of the ith
+ # enclosure and has no defined medium in
+ # the involved side(s)
+ | "4294967294" # the 2 sides of the triangle are part of
+ # the ith enclosure, but have 2 different
+ #media
+ | "4294967295" # the triangle is not part of the ith
+ # enclosure
-----------------
@@ -772,8 +799,10 @@ _______
<encl-member> ::= "1" # valid enclosure
| "3" # invalid enclosure: more than 1 medium
- | "5" # invalid enclosure: some triangles with no defined medium
- | "7" # invalid enclosure: more than 1 "medium", including undefined
+ | "5" # invalid enclosure: some triangles with no
+ # defined medium
+ | "7" # invalid enclosure: more than 1 "medium",
+ # including undefined
_______
== INFRARED IMAGE
@@ -784,9 +813,9 @@ sub-option, this file can be either in VTK [1] format on in *htrdr-image*(5)
format.
=== HTRDR-IMAGE INFRARED IMAGE
-If the output image is in htrdr-image format, it comply with the *lw* section
-of the format, with only the temperature fields being informed. The resulting
-format is as follows:
+If the output image is in *htrdr-image*(5) format, it comply with the *lw*
+section of the format, with only the temperature fields being informed. The
+resulting format is as follows:
[verse]
_______
@@ -848,19 +877,24 @@ _______
<failures_counts>
<temperatures> ::= REAL # in [0, INF)
- <temperatures> # <image-width>*<image-height> temperatures
+ <temperatures> # <image-width>*<image-height>
+ # temperatures
<temp_std_devs> ::= REAL # in [0, INF)
- <temperature_std_devs> # <image-width>*<image-height> std_devs
+ <temperature_std_devs> # <image-width>*<image-height>
+ # std_devs
<computation_times> ::= REAL # in [0, INF)
- <computation_times> # <image-width>*<image-height> times
+ <computation_times> # <image-width>*<image-height>
+ # times
<comp_time_std_devs> ::= REAL # in [0, INF)
- <comp_time_std_devs> # <image-width>*<image-height> std_devs
+ <comp_time_std_devs> # <image-width>*<image-height>
+ # std_devs
<failures_counts> ::= INTEGER # in [0, SAMPLES_COUNT]
- <failures_counts> # <image-width>*<image-height> failures_counts
+ <failures_counts> # <image-width>*<image-height>
+ # failures_counts
_______
== DUMP HEAT PATHS
@@ -938,4 +972,5 @@ _______
== SEE ALSO
*stardis*(1),
-*stardis-input*(5)
-\ No newline at end of file
+*stardis-input*(5),
+*htrdr-image*(5)
+\ No newline at end of file
diff --git a/doc/stardis.1.txt.in b/doc/stardis.1.txt.in
@@ -295,7 +295,8 @@ computation encounters erroneous heat paths, they will be dumped to VTK files
named err_path_00000000.vtk, err_path_00000001.vtk, etc. The image file is then
post-processed using *htpp*(1) with default settings to obtain a png file.
- $ stardis -M scn.txt -R t=100:spp=2:img=800x600:fmt=ht -D error,err_path_ > img.ht
+ $ stardis -M scn.txt -R t=100:spp=2:img=800x600:fmt=ht \
+ -D error,err_path_ > img.ht
$ htpp -o img.pgn -v -m default img.ht
Compute the Green fonction that computes the temperature at the probe point
diff --git a/src/stardis-output.c b/src/stardis-output.c
@@ -637,7 +637,8 @@ dump_green_bin
unsigned name_pool_sz = 0;
char* name_pool = NULL;
char* pool_ptr;
- char green_string[] = "BINGREEN";
+ const char green_string[] = "GREEN_BIN_FILE:";
+ const unsigned file_fmt_version = 1;
ASSERT(green && stardis && stream);
@@ -669,8 +670,9 @@ dump_green_bin
pool_ptr += len + 1;
}
ASSERT(pool_ptr == name_pool + name_pool_sz);
- /* Write Green string */
+ /* Write Green string and file format version */
FW(green_string, sizeof(green_string));
+ FW(&file_fmt_version, 1);
/* Write counts */
FW(&szd, 1);
diff --git a/src/stardis-parsing.c b/src/stardis-parsing.c
@@ -960,19 +960,19 @@ parse_camera
char** line = NULL;
char** opt = NULL;
struct camera* cam;
+ struct str keep;
res_T res = RES_OK;
ASSERT(cam_param && stardis);
cam = &stardis->camera;
line = split_line(cam_param, ':');
+ str_init(stardis->allocator, &keep);
if(line) {
- struct str keep;
int i = 0;
- str_init(stardis->allocator, &keep);
for(i = 0; *(line + i); i++) {
size_t len = 0;
- str_set(&keep, line[i]);
+ ERR(str_set(&keep, line[i]));
opt = split_line(line[i], '=');
if(!opt[0] || ! opt[1] || opt[2]) {
if(res == RES_OK) res = RES_BAD_ARG;
@@ -980,7 +980,7 @@ parse_camera
"Invalid option syntax: %s\n", str_cget(&keep));
goto error;
}
- str_set(&keep, opt[0]);
+ ERR(str_set(&keep, opt[0]));
_strupr(opt[0]);
if(strcmp(opt[0], "T") == 0) {
GET_OPTIONAL_TIME_RANGE(opt[1], 0, cam->time_range, logger, "%s",
@@ -1030,7 +1030,6 @@ parse_camera
goto error;
}
}
- str_release(&keep);
}
end:
@@ -1045,6 +1044,7 @@ end:
FREE_AARRAY(opt)
#undef FREE_AARRAY
+ str_release(&keep);
return res;
error:
logger_print(logger, LOG_ERROR, "Error parsing camera options.\n");