htrdr_combustion_c.h (4431B)
1 /* Copyright (C) 2018-2019, 2022-2025 Centre National de la Recherche Scientifique 2 * Copyright (C) 2020-2022 Institut Mines Télécom Albi-Carmaux 3 * Copyright (C) 2022-2025 Institut Pierre-Simon Laplace 4 * Copyright (C) 2022-2025 Institut de Physique du Globe de Paris 5 * Copyright (C) 2018-2025 |Méso|Star> (contact@meso-star.com) 6 * Copyright (C) 2022-2025 Observatoire de Paris 7 * Copyright (C) 2022-2025 Université de Reims Champagne-Ardenne 8 * Copyright (C) 2022-2025 Université de Versaille Saint-Quentin 9 * Copyright (C) 2018-2019, 2022-2025 Université Paul Sabatier 10 * 11 * This program is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation, either version 3 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 23 24 #ifndef HTRDR_COMBUSTION_C_H 25 #define HTRDR_COMBUSTION_C_H 26 27 #include "combustion/htrdr_combustion_args.h" 28 29 #include "core/htrdr_accum.h" 30 #include "core/htrdr_args.h" 31 #include "core/htrdr_buffer.h" 32 33 #include <star/ssf.h> 34 35 #include <rsys/ref_count.h> 36 #include <rsys/str.h> 37 38 /* Forward declarations */ 39 struct atrstm; 40 struct htrdr; 41 struct htrdr_combustion_laser; 42 struct htrdr_geometry; 43 struct htrdr_materials; 44 struct htrdr_rectangle; 45 struct scam; 46 struct ssf_phase; 47 struct ssp_rng; 48 struct suvm_primitive; 49 50 struct combustion_pixel_flux { 51 struct htrdr_accum flux; /* In W/m^2 */ 52 struct htrdr_accum time; /* In microseconds */ 53 }; 54 #define COMBUSTION_PIXEL_FLUX_NULL__ { \ 55 HTRDR_ACCUM_NULL__, /* Flux */ \ 56 HTRDR_ACCUM_NULL__, /* Time */ \ 57 } 58 static const struct combustion_pixel_flux COMBUSTION_PIXEL_FLUX_NULL = 59 COMBUSTION_PIXEL_FLUX_NULL__; 60 61 struct combustion_pixel_image { 62 struct htrdr_estimate radiance; /* In W/m^2/sr */ 63 struct htrdr_accum time; /* In microseconds */ 64 }; 65 #define COMBUSTION_PIXEL_IMAGE_NULL__ { \ 66 HTRDR_ESTIMATE_NULL__, /* Radiance */ \ 67 HTRDR_ACCUM_NULL__, /* Time */ \ 68 } 69 static const struct combustion_pixel_image COMBUSTION_PIXEL_IMAGE_NULL = 70 COMBUSTION_PIXEL_IMAGE_NULL__; 71 72 struct htrdr_combustion { 73 struct htrdr_geometry* geom; /* Combustion chamber geometry */ 74 struct htrdr_materials* mats; /* Materials of the combustion chamber */ 75 struct atrstm* medium; /* Semi transparent medium */ 76 77 struct scam* camera; /* Camera */ 78 struct htrdr_rectangle* flux_map; /* Flux map */ 79 struct htrdr_combustion_laser* laser; /* Laser sheet */ 80 double wavelength; /* Wavelength of the laser in nanometer */ 81 82 struct ssf_phase** phase_functions; /* Per thread phase func */ 83 enum ssf_simd rdgfa_simd; /* SIMD support for the RDG-FA phase func */ 84 85 struct htrdr_buffer_layout buf_layout; 86 struct htrdr_buffer* buf; /* NULL on non master processes */ 87 size_t spp; /* #samples per pixel */ 88 89 FILE* output; /* Output stream */ 90 struct str output_name; /* Name of the output stream */ 91 enum htrdr_combustion_args_output_type output_type; /* Type of output data */ 92 enum htrdr_combustion_args_phase_func_type phase_func_type; /* Phase func */ 93 94 ref_T ref; 95 struct htrdr* htrdr; 96 }; 97 98 extern LOCAL_SYM void 99 combustion_get_pixel_format 100 (const struct htrdr_combustion* cmd, 101 struct htrdr_pixel_format* fmt); 102 103 extern LOCAL_SYM res_T 104 combustion_draw_map 105 (struct htrdr_combustion* cmd); 106 107 extern LOCAL_SYM res_T 108 combustion_compute_radiance_sw 109 (struct htrdr_combustion* cmd, 110 const size_t ithread, 111 struct ssp_rng* rng, 112 const double pos_in[3], 113 const double dir_in[3], 114 double* out_weigh); /* Shortwave radiance in W/m^2/sr */ 115 116 extern LOCAL_SYM struct ssf_phase* 117 combustion_fetch_phase_function 118 (struct htrdr_combustion* cmd, 119 const double wavelength, /* In nanometer */ 120 const struct suvm_primitive* prim, 121 const double bcoords[4], 122 const size_t ithread); 123 124 #endif /* HTRDR_COMBUSTION_C_H */