commit 7bc29c88b53c4396433e1686db141bca85b36fa0
parent 7e64e3bd99960fbcc8c4fce1f7173a8759434953
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 4 Mar 2021 18:59:12 +0100
Implement the dump option to the combustion command
Diffstat:
3 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/src/combustion/htrdr_combustion.c b/src/combustion/htrdr_combustion.c
@@ -231,6 +231,25 @@ error:
goto exit;
}
+static res_T
+dump_volumetric_acceleration_structure(struct htrdr_combustion* cmd)
+{
+ struct atrstm_dump_svx_octree_args args = ATRSTM_DUMP_SVX_OCTREE_ARGS_DEFAULT;
+ res_T res = RES_OK;
+ ASSERT(cmd);
+
+ /* Nothing to do on non master process */
+ if(htrdr_get_mpi_rank(cmd->htrdr) != 0) goto exit;
+
+ res = atrstm_dump_svx_octree(cmd->medium, &args, cmd->output);
+ if(res != RES_OK) goto error;
+
+exit:
+ return res;
+error:
+ goto exit;
+}
+
static void
combustion_release(ref_T* ref)
{
@@ -319,6 +338,25 @@ htrdr_combustion_ref_put(struct htrdr_combustion* cmd)
ref_put(&cmd->ref, combustion_release);
}
+res_T
+htrdr_combustion_run(struct htrdr_combustion* cmd)
+{
+ res_T res = RES_OK;
+ ASSERT(cmd);
+
+ if(cmd->dump_volumetric_acceleration_structure) {
+ res = dump_volumetric_acceleration_structure(cmd);
+ if(res != RES_OK) goto error;
+ } else {
+ /* TODO */
+ }
+
+exit:
+ return res;
+error:
+ goto exit;
+}
+
/*******************************************************************************
* Local functions
******************************************************************************/
diff --git a/src/combustion/htrdr_combustion.h b/src/combustion/htrdr_combustion.h
@@ -41,6 +41,10 @@ HTRDR_API void
htrdr_combustion_ref_put
(struct htrdr_combustion* cmd);
+HTRDR_API res_T
+htrdr_combustion_run
+ (struct htrdr_combustion* cmd);
+
HTRDR_API int
htrdr_combustion_main
(int argc,
diff --git a/src/combustion/htrdr_combustion_main.c b/src/combustion/htrdr_combustion_main.c
@@ -62,7 +62,8 @@ htrdr_combustion_main(int argc, char** argv)
res = htrdr_combustion_create(htrdr, &cmd_args, &cmd);
if(res != RES_OK) goto error;
- /* TODO run the command */
+ res = htrdr_combustion_run(cmd);
+ if(res != RES_OK) goto error;
exit:
htrdr_combustion_args_release(&cmd_args);