htrdr

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

htrdr_combustion_args.h.in (7609B)


      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 de Physique du Globe de Paris
      4  * Copyright (C) 2018-2025 |Méso|Star> (contact@meso-star.com)
      5  * Copyright (C) 2022-2025 Université de Reims Champagne-Ardenne
      6  * Copyright (C) 2022-2025 Université de Versaille Saint-Quentin
      7  * Copyright (C) 2018-2019, 2022-2025 Université Paul Sabatier
      8  *
      9  * This program is free software: you can redistribute it and/or modify
     10  * it under the terms of the GNU General Public License as published by
     11  * the Free Software Foundation, either version 3 of the License, or
     12  * (at your option) any later version.
     13  *
     14  * This program is distributed in the hope that it will be useful,
     15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     17  * GNU General Public License for more details.
     18  *
     19  * You should have received a copy of the GNU General Public License
     20  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     21 
     22 #ifndef HTRDR_COMBUSTION_ARGS_H
     23 #define HTRDR_COMBUSTION_ARGS_H
     24 
     25 #include "core/htrdr_args.h"
     26 #include <rsys/rsys.h>
     27 
     28 #include <limits.h> /* UINT_MAX support */
     29 
     30 enum htrdr_combustion_args_output_type {
     31   HTRDR_COMBUSTION_ARGS_OUTPUT_FLUX_MAP,
     32   HTRDR_COMBUSTION_ARGS_OUTPUT_IMAGE,
     33   HTRDR_COMBUSTION_ARGS_OUTPUT_LASER_SHEET,
     34   HTRDR_COMBUSTION_ARGS_OUTPUT_OCTREES,
     35   HTRDR_COMBUSTION_ARGS_OUTPUT_TYPES_COUNT__
     36 };
     37 
     38 enum htrdr_combustion_args_grid_definition_type {
     39   HTRDR_COMBUSTION_ARGS_GRID_DEFINITION_AUTO,
     40   HTRDR_COMBUSTION_ARGS_GRID_DEFINITION_FIXED,
     41   HTRDR_COMBUSTION_ARGS_GRID_DEFINITION_TYPES_COUNT__
     42 };
     43 
     44 enum htrdr_combustion_args_phase_func_type {
     45   HTRDR_COMBUSTION_ARGS_PHASE_FUNC_ISOTROPIC,
     46   HTRDR_COMBUSTION_ARGS_PHASE_FUNC_RDGFA,
     47   HTRDR_COMBUSTION_ARGS_PHASE_FUNC_TYPES_COUNT__
     48 };
     49 
     50 struct htrdr_combustion_args_grid_definition {
     51   union {
     52     unsigned hint; /* Hint on the grid definition to eval */
     53     unsigned fixed[3]; /* Fixed grid definition along the 3 axis */
     54   } definition;
     55   enum htrdr_combustion_args_grid_definition_type type;
     56 };
     57 #define HTRDR_COMBUSTION_ARGS_GRID_DEFINITION_DEFAULT__ {                      \
     58   {@HTRDR_COMBUSTION_ARGS_DEFAULT_GRID_DEFINITION_HINT@},                      \
     59   HTRDR_COMBUSTION_ARGS_GRID_DEFINITION_AUTO                                   \
     60 }
     61 static const struct htrdr_combustion_args_grid_definition
     62 HTRDR_COMBUSTION_ARGS_GRID_DEFINITION_DEFAULT =
     63  HTRDR_COMBUSTION_ARGS_GRID_DEFINITION_DEFAULT__;
     64 
     65 struct htrdr_combustion_args {
     66   struct htrdr_args_geometry geom; /* Combustion chamber geometry */
     67 
     68   const char* path_tetra; /* Volumetric mesh of the medium */
     69   const char* path_therm_props; /* Thermodynamic properties of the medium */
     70   const char* path_refract_ids; /* Refractive indices in the medium */
     71 
     72   const char* path_cache; /* Path of the file to store/restore cached data */
     73   const char* path_output; /* Name of the output file */
     74 
     75   struct htrdr_args_camera_perspective cam_persp; /* Perspective camera */
     76   struct htrdr_args_camera_orthographic cam_ortho; /* Ortographic camera */
     77   enum htrdr_args_camera_type cam_type;
     78 
     79   struct htrdr_args_rectangle flux_map; /* Flux map */
     80 
     81   struct htrdr_args_rectangle laser; /* Laser surface emission */
     82   double wavelength; /* Wavelength of the laser in nanometre */
     83   double laser_flux_density; /* In W/m^2 */
     84 
     85   struct htrdr_args_image image; /* Output Image */
     86 
     87   /* RDG-FA parameters */
     88   double fractal_prefactor;
     89   double fractal_dimension;
     90 
     91   struct htrdr_combustion_args_grid_definition grid;
     92 
     93   double optical_thickness; /* Threshold used during octree building */
     94 
     95   /* Miscellaneous parameters */
     96   unsigned nthreads; /* Hint on the number of threads to use */
     97   enum htrdr_combustion_args_output_type output_type;
     98   enum htrdr_combustion_args_phase_func_type phase_func_type;
     99   int precompute_normals; /* Pre-compute the tetrahedra normals */
    100   int force_overwriting;
    101   int verbose; /* Verbosity level */
    102   int use_simd; /* Use the SIMD instruction set if available */
    103   int quit; /* Stop the command */
    104 };
    105 
    106 #define HTRDR_COMBUSTION_ARGS_DEFAULT__ {                                      \
    107   HTRDR_ARGS_GEOMETRY_NULL__,                                                  \
    108                                                                                \
    109   NULL, /* Tetra path */                                                       \
    110   NULL, /* Therm props path */                                                 \
    111   NULL, /* Refractive ids path */                                              \
    112                                                                                \
    113   NULL, /* Cache path */                                                       \
    114   NULL, /* Output path */                                                      \
    115                                                                                \
    116   HTRDR_ARGS_CAMERA_PERSPECTIVE_DEFAULT__, /* Perspective camera */            \
    117   HTRDR_ARGS_CAMERA_ORTHOGRAPHIC_DEFAULT__, /* Orthographic camera */          \
    118   HTRDR_ARGS_CAMERA_PERSPECTIVE,                                               \
    119                                                                                \
    120   HTRDR_ARGS_RECTANGLE_DEFAULT__, /* Flux map */                               \
    121                                                                                \
    122   HTRDR_ARGS_RECTANGLE_DEFAULT__, /* Laser surface emission */                 \
    123   @HTRDR_COMBUSTION_ARGS_DEFAULT_WAVELENGTH@, /* Wavelength in nanometre */    \
    124   @HTRDR_COMBUSTION_ARGS_DEFAULT_LASER_FLUX_DENSITY@, /* Flux density */       \
    125                                                                                \
    126   HTRDR_ARGS_IMAGE_DEFAULT__, /* Image */                                      \
    127                                                                                \
    128   /* Fractal coefficients */                                                   \
    129   @HTRDR_COMBUSTION_ARGS_DEFAULT_FRACTAL_PREFACTOR@,                           \
    130   @HTRDR_COMBUSTION_ARGS_DEFAULT_FRACTAL_DIMENSION@,                           \
    131                                                                                \
    132   HTRDR_COMBUSTION_ARGS_GRID_DEFINITION_DEFAULT__,                             \
    133                                                                                \
    134   @HTRDR_COMBUSTION_ARGS_DEFAULT_OPTICAL_THICKNESS_THRESHOLD@,                 \
    135                                                                                \
    136   UINT_MAX, /* #threads */                                                     \
    137   HTRDR_COMBUSTION_ARGS_OUTPUT_IMAGE, /* Output type */                        \
    138   HTRDR_COMBUSTION_ARGS_PHASE_FUNC_RDGFA, /* Phase func type */                \
    139   0, /* Precompute normals */                                                  \
    140   0, /* Force overwriting */                                                   \
    141   0, /* Verbose flag */                                                        \
    142   0, /* Use SIMD */                                                            \
    143   0  /* Stop the command */                                                    \
    144 }
    145 static const struct htrdr_combustion_args HTRDR_COMBUSTION_ARGS_DEFAULT =
    146   HTRDR_COMBUSTION_ARGS_DEFAULT__;
    147 
    148 extern LOCAL_SYM res_T
    149 htrdr_combustion_args_init
    150   (struct htrdr_combustion_args* args,
    151    int argc,
    152    char** argv);
    153 
    154 extern LOCAL_SYM void
    155 htrdr_combustion_args_release
    156   (struct htrdr_combustion_args* args);
    157 
    158 #endif /* HTRDR_COMBUSTION_ARGS_H */