From f85a7ef199c25cabc834f52ccfc1365fe2a11f1f Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 9 Oct 2026 17:29:07 +0200 Subject: Thing --- examples/throat_clog_2d/common.hpp | 1 + examples/throat_clog_2d/init.hpp | 2 +- examples/throat_clog_2d/sim.cpp | 14 ++++++++++---- examples/throat_clog_2d/step.hpp | 1 - 4 files changed, 12 insertions(+), 6 deletions(-) (limited to 'examples/throat_clog_2d') diff --git a/examples/throat_clog_2d/common.hpp b/examples/throat_clog_2d/common.hpp index 6cc41a3..15fe08a 100644 --- a/examples/throat_clog_2d/common.hpp +++ b/examples/throat_clog_2d/common.hpp @@ -21,6 +21,7 @@ namespace lbm { * position at (0.16m,0.32m) */ +// Base resolution. constexpr uint64_t dim_y = 64ul; constexpr uint64_t dim_x = dim_y * 4ul; diff --git a/examples/throat_clog_2d/init.hpp b/examples/throat_clog_2d/init.hpp index 538e314..68b2aaa 100644 --- a/examples/throat_clog_2d/init.hpp +++ b/examples/throat_clog_2d/init.hpp @@ -170,7 +170,7 @@ saw::error_or init( auto& prb = p.template get<"rigid_body">(); auto& p_pos = prb.template get<"position">(); auto& p_pos_old = prb.template get<"position_old">(); - p_pos.at({{0u}}) = conv.meter_si_to_lbm({{0.18}}).handle(); + p_pos.at({{0u}}) = conv.meter_si_to_lbm({{0.16}}).handle(); p_pos.at({{1u}}) = conv.meter_si_to_lbm({{0.25}}).handle(); p_pos_old = p_pos; diff --git a/examples/throat_clog_2d/sim.cpp b/examples/throat_clog_2d/sim.cpp index b3b3cef..4084353 100644 --- a/examples/throat_clog_2d/sim.cpp +++ b/examples/throat_clog_2d/sim.cpp @@ -93,6 +93,12 @@ saw::error_or lbm_main(const saw::data& args){ return eov; } } + { + auto eov = write_vtk_file(out_dir,"initial_state_macro",0u,*lbm_macro_data_ptr); + if(eov.is_error()){ + return eov; + } + } sycl_q.wait(); saw::data, encode::Sycl> lbm_sycl_data{sycl_q}; @@ -216,11 +222,11 @@ saw::error_or k_main(int argc, char** argv){ auto& an = args.template get<"args">(); auto& coupling = an.template get<"coupling">(); - auto resolution_resolve = [&](){ - lbm_main(args); + auto resolution_resolve = [&]() -> saw::error_or{ + return lbm_main(args); }; - auto coupling_resolve = [&](){ + auto coupling_resolve = [&]() -> saw::error_or { if(coupling.stl_view() == "hlbm"){ return resolution_resolve.template operator()(); } else if(coupling.stl_view() == "fplbm"){ @@ -230,7 +236,7 @@ saw::error_or k_main(int argc, char** argv){ } }; - coupling_resolve(); + return coupling_resolve(); return saw::make_error("Invalid coupling"); } diff --git a/examples/throat_clog_2d/step.hpp b/examples/throat_clog_2d/step.hpp index f41fca7..dab9178 100644 --- a/examples/throat_clog_2d/step.hpp +++ b/examples/throat_clog_2d/step.hpp @@ -118,7 +118,6 @@ saw::error_or step( q.submit([&](acpp::sycl::handler& h){ saw::data> grav; - grav.at({{1u}}) = conv.acceleration_si_to_lbm({-9.81}).handle(); component> fplbm_one_part{grav}; h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){ -- cgit v1.3.1