star-line

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

commit 5d6020b19ff1689e11c8198bab74d2b2555d3b53
parent 4692b695c2e313a7acfef82f4bfbc43cc1f75a02
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 23 Mar 2026 11:40:14 +0100

Add pressure and temperature to the tree descriptor

There was no way to obtain those thermodynamic properties.

Diffstat:
Msrc/sln.h | 5++++-
Msrc/sln_tree.c | 2++
Msrc/test_sln_tree.c | 2++
3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/sln.h b/src/sln.h @@ -155,13 +155,16 @@ struct sln_tree_desc { enum sln_mesh_type mesh_type; enum sln_line_profile line_profile; + double pressure; /* [atm] */ + double temperature; /* [K] */ + unsigned depth; /* #edges from the root to the deepest leaf */ size_t nlines; size_t nvertices; size_t nnodes; }; #define SLN_TREE_DESC_NULL__ { \ - 0, 0, SLN_MESH_TYPES_COUNT__, SLN_LINE_PROFILES_COUNT__, 0, 0, 0, 0 \ + 0, 0, SLN_MESH_TYPES_COUNT__, SLN_LINE_PROFILES_COUNT__, 0, 0, 0, 0, 0, 0 \ } static const struct sln_tree_desc SLN_TREE_DESC_NULL = SLN_TREE_DESC_NULL__; diff --git a/src/sln_tree.c b/src/sln_tree.c @@ -546,6 +546,8 @@ sln_tree_get_desc(const struct sln_tree* tree, struct sln_tree_desc* desc) desc->line_profile = tree->args.line_profile; desc->nnodes = darray_node_size_get(&tree->nodes); desc->nvertices = darray_vertex_size_get(&tree->vertices); + desc->pressure = tree->args.pressure; /* [atm] */ + desc->temperature = tree->args.temperature; /* [K] */ SHTR(line_list_get_size(tree->args.lines, &desc->nlines)); nlines_adjusted = round_up_pow2(desc->nlines); diff --git a/src/test_sln_tree.c b/src/test_sln_tree.c @@ -181,6 +181,8 @@ test_tree CHK(desc.nvertices >= 1); CHK(desc.nnodes >= 1); CHK(desc.depth == (unsigned)log2i((int)round_up_pow2(desc.nlines))); + CHK(desc.pressure == tree_args.pressure); + CHK(desc.temperature == tree_args.temperature); CHK(node = sln_tree_get_root(tree)); CHK(node != NULL);