star-line

Structure for accelerating line importance sampling
git clone git://git.meso-star.com/star-line.git
Log | Files | Refs | README | LICENSE

sln_line.h (1962B)


      1 /* Copyright (C) 2022, 2026 |Méso|Star> (contact@meso-star.com)
      2  * Copyright (C) 2026 Université de Lorraine
      3  * Copyright (C) 2022 Centre National de la Recherche Scientifique
      4  * Copyright (C) 2022 Université Paul Sabatier
      5  *
      6  * This file is part of Star-Line.
      7  *
      8  * This program is free software: you can redistribute it and/or modify
      9  * it under the terms of the GNU General Public License as published by
     10  * the Free Software Foundation, either version 3 of the License, or
     11  * (at your option) any later version.
     12  *
     13  * This program is distributed in the hope that it will be useful,
     14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     16  * GNU General Public License for more details.
     17  *
     18  * You should have received a copy of the GNU General Public License
     19  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     20 
     21 #ifndef SLN_LINE_H
     22 #define SLN_LINE_H
     23 
     24 #include "sln.h"
     25 
     26 #include <star/shtr.h>
     27 #include <rsys/rsys.h>
     28 #include <math.h>
     29 
     30 /* Forward declaration */
     31 struct sln_mixture;
     32 struct sln_tree;
     33 struct darray_vertex;
     34 
     35 static INLINE double
     36 line_center
     37   (const struct shtr_line* line,
     38    const double pressure) /* In atm */
     39 {
     40   ASSERT(line && pressure >= 0);
     41   return line->wavenumber + line->delta_air * pressure;
     42 }
     43 
     44 extern LOCAL_SYM res_T
     45 line_setup
     46   (const struct sln_tree* tree,
     47    const size_t iline,
     48    /* Thermodynamic properties to which the line is recovered.
     49     * Can be NULL, so these properties are those used to build the tree */
     50    const struct sln_thermo_props* props,
     51    struct sln_line* line);
     52 
     53 extern LOCAL_SYM res_T
     54 line_mesh
     55   (struct sln_tree* tree,
     56    const size_t iline,
     57    const size_t nvertices_hint,
     58    /* Vertex buffer in which line vertices are added */
     59    struct darray_vertex* vertices, /* out */
     60    /* Range of generated line vertices. Bounds are inclusive */
     61    size_t vertices_range[2]); /* out */
     62 
     63 #endif /* SLN_LINE_H */