star-line

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

commit 7e5465ec59e8987ea384b466519b0e1c8415f7d9
parent 35154726da267e5b5561960e1107787d5e48bd59
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri,  6 Feb 2026 15:25:42 +0100

Update to the construction of a "fit mesh" tree

When two nodes are merged, the ka values of the vertices of one node
must be evaluated for the lines contained in the other node.

For an “upper" tree, these ka values were calculated based on the node's
mesh. For a "fit" tree, the ka values were calculated based on the
node's line list in order to avoid any approximation. This obviously
takes too much time, and now the ka values are always calculated based
on the node's mesh.

Diffstat:
Msrc/sln_tree_build.c | 19++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/src/sln_tree_build.c b/src/sln_tree_build.c @@ -85,19 +85,12 @@ eval_ka double ka = 0; ASSERT(tree && node); - switch(tree->args.mesh_type) { - case SLN_MESH_UPPER: - SLN(node_get_mesh(tree, node, &mesh)); - ka = sln_mesh_eval(&mesh, wavenumber); - break; - case SLN_MESH_FIT: - /* We choose not to make any approximation when calculating the usual - * mesh. One thus evaluates ka on the lines of the node and not on the - * mesh of the node. */ - ka = sln_node_eval(tree, node, wavenumber); - break; - default: FATAL("Unreachable code.\n"); break; - } + /* Whether the mesh to be constructed corresponds to the spectrum or its upper + * limit, use the node mesh to calculate the value of ka at a given wave + * number. Calculating the value from the node lines would take far too long*/ + SLN(node_get_mesh(tree, node, &mesh)); + ka = sln_mesh_eval(&mesh, wavenumber); + return ka; }