htrdr

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

commit f48d07ddb2b283a82cbf7de9ee90cea6079c3f27
parent ba67b269f7c2c490fad95741928bf266113202a9
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 28 Oct 2022 09:02:49 +0200

htrdr-planeto: setup the source

Diffstat:
Msrc/planeto/htrdr_planeto.c | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/planeto/htrdr_planeto.c b/src/planeto/htrdr_planeto.c @@ -23,6 +23,7 @@ #include "planeto/htrdr_planeto.h" #include "planeto/htrdr_planeto_args.h" #include "planeto/htrdr_planeto_c.h" +#include "planeto/htrdr_planeto_source.h" #include <rad-net/rnatm.h> #include <rad-net/rngrd.h> @@ -212,6 +213,15 @@ error: goto exit; } +static INLINE res_T +setup_source + (struct htrdr_planeto* cmd, + const struct htrdr_planeto_args* args) +{ + ASSERT(cmd && args); + return htrdr_planeto_source_create(cmd, &args->source, &cmd->source); +} + static res_T setup_buffer (struct htrdr_planeto* cmd, @@ -279,6 +289,7 @@ planeto_release(ref_T* ref) if(cmd->atmosphere) RNATM(ref_put(cmd->atmosphere)); if(cmd->ground) RNGRD(ref_put(cmd->ground)); + if(cmd->source) htrdr_planeto_source_ref_put(cmd->source); if(cmd->octrees_storage) CHK(fclose(cmd->octrees_storage) == 0); if(cmd->output && cmd->output != stdout) CHK(fclose(cmd->output) == 0); if(cmd->buf) htrdr_buffer_ref_put(cmd->buf); @@ -324,6 +335,8 @@ htrdr_planeto_create if(res != RES_OK) goto error; res = setup_spectral_domain(cmd, args); if(res != RES_OK) goto error; + res = setup_source(cmd, args); + if(res != RES_OK) goto error; res = setup_buffer(cmd, args); if(res != RES_OK) goto error; res = setup_ground(cmd, args);