stardis

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

commit 85f43486adbc08a0900b84b5eaa0f2a0debf90b3
parent 34fd967f17421c3cfe3c5340899ef6f3350aa16e
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Thu,  6 Feb 2020 17:41:48 +0100

Fix build wrt API changes

Diffstat:
Mcmake/CMakeLists.txt | 37++++++++++++++++++++++---------------
Msrc/stardis-output.c | 21+++++++++------------
2 files changed, 31 insertions(+), 27 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -18,20 +18,23 @@ project(stardis-app C) set(SDIS_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src) -################################################################################ +############################################################################### # Check dependencies -################################################################################ +############################################################################### find_package(RCMake 0.4 REQUIRED) find_package(RSys 0.8.1 REQUIRED) -find_package(StarEnc 0.3.1 REQUIRED) +find_package(StarGeom3D 0.1 REQUIRED) +find_package(StarEnc3D 0.3.1 REQUIRED) find_package(Stardis 0.7.1 REQUIRED) find_package(StarSTL 0.3 REQUIRED) -set(TINYEXPR_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../tinyexpr" CACHE PATH "Directory for TinyExpr source files") +set(TINYEXPR_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../tinyexpr" + CACHE PATH "Directory for TinyExpr source files") include_directories( ${RSys_INCLUDE_DIR} - ${StarEnc_INCLUDE_DIR} + ${StarGeom3D_INCLUDE_DIR} + ${StarEnc3D_INCLUDE_DIR} ${Stardis_INCLUDE_DIR} ${StarSTL_INCLUDE_DIR} ${TINYEXPR_SOURCE_DIR}) @@ -44,11 +47,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR}) include(rcmake) include(rcmake_runtime) -rcmake_append_runtime_dirs(_runtime_dirs RSys Stardis StarEnc StarSTL) +rcmake_append_runtime_dirs(_runtime_dirs RSys Stardis StarGeom3D StarEnc3D StarSTL) -################################################################################ +############################################################################### # Configure and define targets -################################################################################ +############################################################################### set(VERSION_MAJOR 0) set(VERSION_MINOR 4) set(VERSION_PATCH 0) @@ -81,10 +84,12 @@ rcmake_prepend_path(SDIS_FILES_INC ${SDIS_SOURCE_DIR}) rcmake_prepend_path(SDIS_FILES_DOC ${PROJECT_SOURCE_DIR}/../) # Default is right to left pow and log is natural log -# Build tinyExpr without closure support and with function_1 to function_3 support only -# (these ones cannot be disabled as predefined functions require them). +# Build tinyExpr without closure support and with function_1 to function_3 +# support only (these ones cannot be disabled as predefined functions require +# them). set(TE_DEFAULTS - "-DTE_POW_FROM_RIGHT -DTE_NAT_LOG -DTE_WITHOUT_CLOSURES -DTE_WITHOUT_FUNCTION_0 -DTE_MAX_FUNCTION_ARITY=3") + "-DTE_POW_FROM_RIGHT -DTE_NAT_LOG -DTE_WITHOUT_CLOSURES \ + -DTE_WITHOUT_FUNCTION_0 -DTE_MAX_FUNCTION_ARITY=3") ADD_LIBRARY(tinyexpr STATIC ${TINYEXPR_SOURCE_DIR}/tinyexpr.c ${TINYEXPR_SOURCE_DIR}/tinyexpr.h) @@ -105,19 +110,21 @@ if(CMAKE_COMPILER_IS_GNUCC) set_target_properties(sdis-app PROPERTIES COMPILE_FLAGS "-std=c99 ${TE_DEFAULTS}" VERSION ${VERSION}) - target_link_libraries(sdis-app Stardis StarEnc StarSTL RSys tinyexpr m) + target_link_libraries(sdis-app + Stardis StarGeom3D StarEnc3D StarSTL RSys tinyexpr m) elseif(MSVC) set_target_properties(sdis-app PROPERTIES COMPILE_FLAGS "${TE_DEFAULTS}" VERSION ${VERSION}) - target_link_libraries(sdis-app Stardis StarEnc StarSTL RSys tinyexpr MuslGetopt) + target_link_libraries(sdis-app + Stardis StarGeom3D StarEnc3D StarSTL RSys tinyexpr MuslGetopt) endif() rcmake_copy_runtime_libraries(sdis-app) -################################################################################ +############################################################################### # Define output & install directories -################################################################################ +############################################################################### install(TARGETS sdis-app ARCHIVE DESTINATION bin LIBRARY DESTINATION lib diff --git a/src/stardis-output.c b/src/stardis-output.c @@ -7,7 +7,7 @@ #include <sdis.h> -#include<star/senc.h> +#include<star/senc3d.h> #include <rsys/math.h> #include <rsys/mem_allocator.h> @@ -537,20 +537,17 @@ create_edge_file_if FILE* obj = NULL; struct htable_vrtx_rank ranks; char structs_initialized = 0; - struct senc_descriptor* analyze = NULL; + struct senc3d_scene* senc3d_scn = NULL; struct darray_uint comps; struct darray_uint edges; unsigned cc_count = 0; unsigned *cc, *ee, uimax = UINT_MAX; - res = sdis_scene_get_analysis(scn, &analyze); - if (res != RES_OK) goto error; - res = sdis_scene_release_analysis(scn); - if (res != RES_OK) goto error; - ASSERT(scn && allocator); - res = senc_descriptor_get_frontier_segments_count(analyze, &scount); + res = sdis_scene_get_senc3d_scene(scn, &senc3d_scn); + if (res != RES_OK) goto error; + res = senc3d_scene_get_frontier_segments_count(senc3d_scn, &scount); if (res != RES_OK) goto error; if (scount == 0) @@ -568,7 +565,7 @@ create_edge_file_if vcount = 0; FOR_EACH(i, 0, scount) { unsigned v, edge[2], rk[2]; - res = senc_descriptor_get_frontier_segment(analyze, i, edge); + res = senc3d_scene_get_frontier_segment(senc3d_scn, i, edge); if (res != RES_OK) goto error; FOR_EACH(v, 0, 2) { unsigned* p_rank; @@ -617,13 +614,13 @@ create_edge_file_if * (same numbering scheme for all components) */ FOR_EACH(v, 0, vcount) { double coord[3]; - res = senc_descriptor_get_global_vertex(analyze, ee[v], coord); + res = senc3d_scene_get_vertex(senc3d_scn, ee[v], coord); if (res != RES_OK) goto error; fprintf(obj, "v %f %f %f\n", SPLIT3(coord)); } FOR_EACH(i, 0, scount) { unsigned edge[2], new_ranks[2]; - res = senc_descriptor_get_frontier_segment(analyze, i, edge); + res = senc3d_scene_get_frontier_segment(senc3d_scn, i, edge); if (res != RES_OK) goto error; ASSERT(cc[edge[0]] == cc[edge[1]]); if (cc[edge[0]] != comp) @@ -644,7 +641,7 @@ create_edge_file_if end: if (obj) fclose(obj); - if (analyze) senc_descriptor_ref_put(analyze); + if (senc3d_scn) senc3d_scene_ref_put(senc3d_scn); if (structs_initialized) { htable_vrtx_rank_release(&ranks); darray_uint_release(&comps);