From 7095c698f5c5b7e960db9f9347501b8628f94dac Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 9 Oct 2026 13:24:17 +0200 Subject: Trying to fix things --- examples/throat_clog_2d/.nix/derivation.nix | 4 ++-- examples/throat_clog_2d/common.hpp | 4 ++-- examples/throat_clog_2d/init.hpp | 4 ++-- examples/throat_clog_2d/sim.cpp | 25 +++++++++++++++++-------- 4 files changed, 23 insertions(+), 14 deletions(-) (limited to 'examples/throat_clog_2d') diff --git a/examples/throat_clog_2d/.nix/derivation.nix b/examples/throat_clog_2d/.nix/derivation.nix index 4dfce2a..2f73494 100644 --- a/examples/throat_clog_2d/.nix/derivation.nix +++ b/examples/throat_clog_2d/.nix/derivation.nix @@ -28,8 +28,8 @@ in stdenv.mkDerivation { forstio.codec forstio.codec-unit forstio.io - forstio.remote - forstio.remote-filesystem + forstio.remote + forstio.remote-filesystem forstio.codec-json adaptive-cpp kel.lbm.core diff --git a/examples/throat_clog_2d/common.hpp b/examples/throat_clog_2d/common.hpp index 4a1e211..6cc41a3 100644 --- a/examples/throat_clog_2d/common.hpp +++ b/examples/throat_clog_2d/common.hpp @@ -22,7 +22,7 @@ namespace lbm { */ constexpr uint64_t dim_y = 64ul; -constexpr uint64_t dim_x = static_cast(dim_y * (256.0 / 64.0)); +constexpr uint64_t dim_x = dim_y * 4ul; constexpr uint64_t particle_amount = 1ul; @@ -64,7 +64,7 @@ using MacroStruct = Struct< >; template -using ParticleSpheroidGroup = ParticleGroup>; +using ParticleSpheroidGroup = ParticleGroup>; } } diff --git a/examples/throat_clog_2d/init.hpp b/examples/throat_clog_2d/init.hpp index 1fb1e32..538e314 100644 --- a/examples/throat_clog_2d/init.hpp +++ b/examples/throat_clog_2d/init.hpp @@ -169,11 +169,11 @@ saw::error_or init( auto& p = parts.at({0u}); auto& prb = p.template get<"rigid_body">(); auto& p_pos = prb.template get<"position">(); - auto& p_posold = prb.template get<"position_old">(); + auto& p_pos_old = prb.template get<"position_old">(); p_pos.at({{0u}}) = conv.meter_si_to_lbm({{0.18}}).handle(); p_pos.at({{1u}}) = conv.meter_si_to_lbm({{0.25}}).handle(); - p_posold = p_pos; + p_pos_old = p_pos; } } diff --git a/examples/throat_clog_2d/sim.cpp b/examples/throat_clog_2d/sim.cpp index 7fda532..b3b3cef 100644 --- a/examples/throat_clog_2d/sim.cpp +++ b/examples/throat_clog_2d/sim.cpp @@ -12,6 +12,7 @@ using namespace saw::schema; using LbmArgsStruct = Struct< Member + //,Member >; using LbmArgs = Args< @@ -80,7 +81,6 @@ saw::error_or lbm_main(const saw::data& args){ auto& sycl_q = dev.get_handle(); - sycl_q.wait(); { auto eov = init(conv,*lbm_data_ptr,*lbm_macro_data_ptr,*lbm_particle_data_ptr); if(eov.is_error()){ @@ -93,6 +93,7 @@ saw::error_or lbm_main(const saw::data& args){ return eov; } } + sycl_q.wait(); saw::data, encode::Sycl> lbm_sycl_data{sycl_q}; saw::data, encode::Sycl> lbm_sycl_macro_data{sycl_q}; @@ -215,13 +216,21 @@ saw::error_or k_main(int argc, char** argv){ auto& an = args.template get<"args">(); auto& coupling = an.template get<"coupling">(); - if(coupling.stl_view() == "hlbm"){ - return lbm_main(args); - } else if(coupling.stl_view() == "fplbm"){ - return lbm_main(args); - } else if(coupling.stl_view() == "psm"){ - return lbm_main(args); - } + auto resolution_resolve = [&](){ + lbm_main(args); + }; + + auto coupling_resolve = [&](){ + if(coupling.stl_view() == "hlbm"){ + return resolution_resolve.template operator()(); + } else if(coupling.stl_view() == "fplbm"){ + return resolution_resolve.template operator()(); + } else if(coupling.stl_view() == "psm"){ + return resolution_resolve.template operator()(); + } + }; + + coupling_resolve(); return saw::make_error("Invalid coupling"); } -- cgit v1.3.1