stardis

Perform coupled heat transfer calculations
git clone git://git.meso-star.fr/stardis.git
Log | Files | Refs | README | LICENSE

commit 484ad0894489549f10f8e5dea1e26711faf2a203
parent bf832062f9fcbdf6633d22db5c43b36a46066535
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 18 Apr 2024 17:47:29 +0200

Fix of compilation errors due to solver API updates

The profile of the function creating external sources has been updated
to make it consistent with the API for other resources. It now relies on
a shader containing its (programmable) parameters and a pointer to
user-side data.

Diffstat:
Msrc/stardis-extern-source.c | 28++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/src/stardis-extern-source.c b/src/stardis-extern-source.c @@ -64,8 +64,7 @@ create_solver_source_sphere (struct extern_source* src, struct stardis* stardis) { - struct sdis_spherical_source_create_args args = - SDIS_SPHERICAL_SOURCE_CREATE_ARGS_NULL; + struct sdis_spherical_source_shader shader = SDIS_SPHERICAL_SOURCE_SHADER_NULL; struct sdis_data* data = NULL; res_T res = RES_OK; ASSERT(src && src->type == EXTERN_SOURCE_SPHERE && stardis); @@ -77,12 +76,11 @@ create_solver_source_sphere *((struct spherical_source**)sdis_data_get(data)) = &src->data.sphere; /* Create the spherical source */ - args.position = sphere_get_position; - args.power = sphere_get_power; - args.diffuse_radiance = sphere_get_diffuse_radiance; - args.data = data; - args.radius = src->data.sphere.radius; - res = sdis_spherical_source_create(stardis->dev, &args, &src->sdis_src); + shader.position = sphere_get_position; + shader.power = sphere_get_power; + shader.diffuse_radiance = sphere_get_diffuse_radiance; + shader.radius = src->data.sphere.radius; + res = sdis_spherical_source_create(stardis->dev, &shader, data, &src->sdis_src); if(res != RES_OK) goto error; exit: @@ -132,8 +130,7 @@ create_solver_source_sphere_prog (struct extern_source* src, struct stardis* stardis) { - struct sdis_spherical_source_create_args args = - SDIS_SPHERICAL_SOURCE_CREATE_ARGS_NULL; + struct sdis_spherical_source_shader shader = SDIS_SPHERICAL_SOURCE_SHADER_NULL; struct sdis_data* data = NULL; res_T res = RES_OK; ASSERT(src && src->type == EXTERN_SOURCE_SPHERE_PROG && stardis); @@ -145,12 +142,11 @@ create_solver_source_sphere_prog *((struct spherical_source_prog**)sdis_data_get(data)) = &src->data.sphere_prog; /* Create the spherical source */ - args.position = sphere_prog_get_position; - args.power = sphere_prog_get_power; - args.diffuse_radiance = sphere_prog_get_diffuse_radiance; - args.data = data; - args.radius = src->data.sphere_prog.radius; - res = sdis_spherical_source_create(stardis->dev, &args, &src->sdis_src); + shader.position = sphere_prog_get_position; + shader.power = sphere_prog_get_power; + shader.diffuse_radiance = sphere_prog_get_diffuse_radiance; + shader.radius = src->data.sphere_prog.radius; + res = sdis_spherical_source_create(stardis->dev, &shader, data, &src->sdis_src); if(res != RES_OK) goto error; exit: