atrstm

Load and structure a combustion gas mixture
git clone git://git.meso-star.fr/atrstm.git
Log | Files | Refs | README | LICENSE

atrstm_c.h (2461B)


      1 /* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
      2  * Copyright (C) 2020, 2021 Centre National de la Recherche Scientifique
      3  *
      4  * This program is free software: you can redistribute it and/or modify
      5  * it under the terms of the GNU General Public License as published by
      6  * the Free Software Foundation, either version 3 of the License, or
      7  * (at your option) any later version.
      8  *
      9  * This program is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     12  * GNU General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU General Public License
     15  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     16 
     17 #ifndef ATRSTM_C_H
     18 #define ATRSTM_C_H
     19 
     20 #include "atrstm.h"
     21 
     22 #include <astoria/atrri.h>
     23 
     24 #include <rsys/logger.h>
     25 #include <rsys/mem_allocator.h>
     26 #include <rsys/ref_count.h>
     27 #include <rsys/str.h>
     28 
     29 /* Forward declaration of external data types */
     30 struct atrri;
     31 struct atrtp;
     32 struct cache;
     33 struct suvm;
     34 
     35 struct atrstm {
     36   struct atrtp* atrtp; /* Handle toward the Astoria Thermodynamic Properties */
     37   struct atrri* atrri; /* Handle toward the Astoria Refractive Indices */
     38 
     39   /* Unstructured volumetric mesh */
     40   struct suvm_device* suvm;
     41   struct suvm_volume* volume;
     42 
     43   struct svx_device* svx;
     44   struct svx_tree* octree;
     45 
     46   unsigned nthreads; /* #nthreads */
     47 
     48   struct str name; /* Name of the semi-transparent medium */
     49 
     50   double fractal_prefactor;
     51   double fractal_dimension;
     52 
     53   enum atrstm_spectral_type spectral_type;
     54   double wlen_range[2]; /* Spectral range in nm */
     55   unsigned grid_max_definition[3];
     56   double optical_thickness;
     57 
     58   /* Pre-fetched refractive id in shortwave */
     59   struct atrri_refractive_index refract_id;
     60 
     61   struct cache* cache; /* Cache of the SVX data structures */
     62 
     63   struct mem_allocator* allocator;
     64   struct mem_allocator svx_allocator;
     65   struct logger* logger;
     66   struct logger logger__; /* Default logger */
     67   int verbose;
     68   int use_simd;
     69   ref_T ref;
     70 };
     71 
     72 extern LOCAL_SYM res_T
     73 setup_unstructured_volumetric_mesh
     74   (struct atrstm* atrstm,
     75    const int precompute_normals,
     76    const char* sth_filename,
     77    struct suvm_volume** out_volume);
     78 
     79 extern LOCAL_SYM void
     80 dump_memory_size
     81   (const size_t size, /* In Bytes */
     82    size_t* real_dump_len, /* May be NULL */
     83    char* dump, /* May be NULL */
     84    size_t max_dump_len);
     85 
     86 #endif /* ATRSTM_C_H */