htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

commit a535d68dc5bdaa31ac36feed38a026ba4d89e4aa
parent 9c12d6d512caea604a7d6145c896952095f2de90
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon,  4 Feb 2019 09:27:29 +0100

Merge branch 'release_0.0.3'

Diffstat:
MREADME.md | 18++++++++++++++----
Mcmake/CMakeLists.txt | 6+++---
Mcmake/doc/CMakeLists.txt | 2+-
Mdoc/htrdr-image.5.txt | 2+-
Mdoc/htrdr.1.txt.in | 4++--
Msrc/htrdr.c | 2+-
Msrc/htrdr.h | 2+-
Msrc/htrdr_args.c | 4++--
Msrc/htrdr_args.h.in | 2+-
Msrc/htrdr_buffer.c | 2+-
Msrc/htrdr_buffer.h | 2+-
Msrc/htrdr_c.h | 2+-
Msrc/htrdr_camera.c | 2+-
Msrc/htrdr_camera.h | 2+-
Msrc/htrdr_compute_radiance_sw.c | 2+-
Msrc/htrdr_draw_radiance_sw.c | 2+-
Msrc/htrdr_grid.c | 3++-
Msrc/htrdr_grid.h | 2+-
Msrc/htrdr_ground.c | 2+-
Msrc/htrdr_ground.h | 2+-
Msrc/htrdr_main.c | 2+-
Msrc/htrdr_rectangle.c | 2+-
Msrc/htrdr_rectangle.h | 2+-
Msrc/htrdr_sky.c | 13++++++++++++-
Msrc/htrdr_sky.h | 2+-
Msrc/htrdr_slab.c | 2+-
Msrc/htrdr_slab.h | 2+-
Msrc/htrdr_solve.h | 2+-
Msrc/htrdr_sun.c | 2+-
Msrc/htrdr_sun.h | 2+-
Msrc/htrdr_version.h.in | 2+-
31 files changed, 60 insertions(+), 38 deletions(-)

diff --git a/README.md b/README.md @@ -58,12 +58,22 @@ resulting project can be edited, built, tested and installed as any CMake project. Refer to the [CMake](https://cmake.org/documentation) for further informations on CMake. +## Release notes + +### Version 0.0.3 + +- Fix compilation on systems with a GNU C Library whose version is less than + 2.19. +- Fix a possible invalid memory access to cloud data leading to segmentation + faults. + ## License -htrdr is free software copyright (C) 2018 Centre National de la Recherche +Copyright (C) 2018-2019 Centre National de la Recherche Scientifique (CNRS), [|Meso|Star](http://www.meso-star.com) <contact@meso-star.com>, Université Paul Sabatier -<contact-edstar@laplace.univ-tlse.fr>. It is released under the GPL v3+ -license: GNU GPL version 3 or later. You are welcome to redistribute it under -certain conditions; refer to the COPYING file for details. +<contact-edstar@laplace.univ-tlse.fr>. htrdr is free software released under +the GPL v3+ license: GNU GPL version 3 or later. You are welcome to +redistribute it under certain conditions; refer to the COPYING file for +details. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +# Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ option(NO_TEST "Do not build the tests" OFF) ################################################################################ find_package(RCMake 0.3 REQUIRED) find_package(RSys 0.7 REQUIRED) -find_package(Star3D 0.5 REQUIRED) +find_package(Star3D 0.6 REQUIRED) find_package(Star3DAW 0.3.1 REQUIRED) find_package(StarSF 0.6 REQUIRED) find_package(StarSP 0.8 REQUIRED) @@ -60,7 +60,7 @@ include_directories( ################################################################################ set(VERSION_MAJOR 0) set(VERSION_MINOR 0) -set(VERSION_PATCH 2) +set(VERSION_PATCH 3) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) set(HTRDR_ARGS_DEFAULT_CAMERA_POS "0,0,0") diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +# Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/doc/htrdr-image.5.txt b/doc/htrdr-image.5.txt @@ -1,4 +1,4 @@ -// Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +// Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/doc/htrdr.1.txt.in b/doc/htrdr.1.txt.in @@ -1,4 +1,4 @@ -// Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +// Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -255,7 +255,7 @@ NOTES COPYRIGHT --------- -Copyright &copy; 2018 CNRS, |Meso|Star> <contact@meso-star.com>, Université +Copyright &copy; 2018-2019 CNRS, |Meso|Star> <contact@meso-star.com>, Université Paul Sabatier <contact-edstar@laplace.univ-tlse.fr>. *htrdr* is free software released under the GPLv3+ license: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. You are free to change and redistribute diff --git a/src/htrdr.c b/src/htrdr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr.h b/src/htrdr.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_args.c b/src/htrdr_args.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -84,7 +84,7 @@ print_help(const char* cmd) " --version display version information and exit.\n"); printf("\n"); printf( -"htrdr (C) 2018 CNRS, |Meso|Star> <contact@meso-star.com>, Université Paul\n" +"htrdr (C) 2018-2019 CNRS, |Meso|Star> <contact@meso-star.com>, Université Paul\n" "Sabatier <contact-edstar@laplace.univ-tlse.fr>. This is free software released\n" "under the GNU GPL license, version 3 or later. You are free to change or\n" "redistribute it under certain conditions <http://gnu.org/licenses/gpl.html>\n"); diff --git a/src/htrdr_args.h.in b/src/htrdr_args.h.in @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, Université Paul Sabatier, |Meso|Star> +/* Copyright (C) 2018-2019 CNRS, Université Paul Sabatier, |Meso|Star> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_buffer.c b/src/htrdr_buffer.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_buffer.h b/src/htrdr_buffer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_c.h b/src/htrdr_c.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_camera.c b/src/htrdr_camera.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_camera.h b/src/htrdr_camera.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_compute_radiance_sw.c b/src/htrdr_compute_radiance_sw.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_draw_radiance_sw.c b/src/htrdr_draw_radiance_sw.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_grid.c b/src/htrdr_grid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,7 @@ #define _POSIX_C_SOURCE 200809L /* mmap support */ #define _DEFAULT_SOURCE 1 /* MAP_POPULATE support */ +#define _BSD_SOURCE 1 /* MAP_POPULATE for glibc < 2.19 */ #include "htrdr.h" #include "htrdr_c.h" diff --git a/src/htrdr_grid.h b/src/htrdr_grid.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_ground.c b/src/htrdr_ground.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_ground.h b/src/htrdr_ground.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_main.c b/src/htrdr_main.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_rectangle.c b/src/htrdr_rectangle.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_rectangle.h b/src/htrdr_rectangle.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_sky.c b/src/htrdr_sky.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -622,6 +622,10 @@ cloud_vox_get_particle ivox[0] = xyz[0]; ivox[1] = xyz[1]; ivox[2] = pos_z <= split->height ? split->index : split->index + 1; + if(ivox[2] >= ctx->sky->htcp_desc.spatial_definition[2] + && eq_eps(pos_z, split->height, 1.e-6)) { /* Handle numerical inaccuracy */ + ivox[2] = split->index; + } /* Compute the upper bound of the *next* LUT cell clamped to the voxel * upper bound. Note that the upper bound of the current LUT cell is @@ -740,6 +744,10 @@ cloud_vox_get_gas ivox[0] = xyz[0]; ivox[1] = xyz[1]; ivox[2] = pos_z <= split->height ? split->index : split->index + 1; + if(ivox[2] >= ctx->sky->htcp_desc.spatial_definition[2] + && eq_eps(pos_z, split->height, 1.e-6)) { /* Handle numerical inaccuracy */ + ivox[2] = split->index; + } /* Compute the upper bound of the *next* LUT cell clamped to the voxel * upper bound. Note that the upper bound of the current LUT cell is @@ -1140,6 +1148,9 @@ setup_clouds goto error; } + htrdr_log(sky->htrdr, "Clouds bounding box: {%g, %g, %g} / {%g, %g, %g}.\n", + SPLIT3(sky->htcp_desc.lower), SPLIT3(sky->htcp_desc.upper)); + /* Define the number of voxels */ nvoxs[0] = sky->htcp_desc.spatial_definition[0]; nvoxs[1] = sky->htcp_desc.spatial_definition[1]; diff --git a/src/htrdr_sky.h b/src/htrdr_sky.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_slab.c b/src/htrdr_slab.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_slab.h b/src/htrdr_slab.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_solve.h b/src/htrdr_solve.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_sun.c b/src/htrdr_sun.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_sun.h b/src/htrdr_sun.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, |Meso|Star>, Université Paul Sabatier +/* Copyright (C) 2018-2019 CNRS, |Meso|Star>, Université Paul Sabatier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htrdr_version.h.in b/src/htrdr_version.h.in @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 CNRS, Université Paul Sabatier, |Meso|Star> +/* Copyright (C) 2018-2019 CNRS, Université Paul Sabatier, |Meso|Star> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by