From 1693f8ccb3fbdbc8a1bd35a5ffde684ca4c68a3f Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sat, 18 Jul 2026 21:45:14 +0200 Subject: Dangling --- .../moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp b/examples/moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp index a4cae03..a41d2b7 100644 --- a/examples/moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp +++ b/examples/moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp @@ -146,7 +146,7 @@ saw::error_or setup_initial_conditions( ); saw::data> rad; - rad.at({}) = 2.0f; + rad.at({}) = dim_y * 0.1f; saw::data> dense; dense.at({}) = 1.0f; particles = create_spheroid_particle_group(rad,dense,{16u}); @@ -173,6 +173,18 @@ saw::error_or step( auto& info_f = fields.template get<"info">(); auto& porous_f = macros.template get<"porosity">(); + q.submit([&](acpp::sycl::handler& h){ + component> hlbm_reset; + h.parallel_for(acpp::sycl::range{dim_x,dim_y}, [=](acpp::sycl::id idx){ + saw::data> index; + for(uint64_t i = 0u; i < Desc::D; ++i){ + index.at({{i}}).set(idx[i]); + } + + hlbm_reset.apply(fields,macros,index,t_i); + }); + }).wait(); + q.submit([&](acpp::sycl::handler& h){ component> hlbm_one_part; @@ -361,6 +373,21 @@ saw::error_or lbm_main(int argc, char** argv){ } sycl_q.wait(); + if( i.get() % 128u == 0u){ + { + auto eov = dev.copy_to_host(lbm_sycl_macro_data,*lbm_macro_data_ptr); + if(eov.is_error()){ + return eov; + } + } + { + auto eov = write_vtk_file(out_dir,"m",i.get(), *lbm_macro_data_ptr); + if(eov.is_error()){ + return eov; + } + } + } + // Stream sycl_q.submit([&](acpp::sycl::handler& h){ component> stream; -- cgit v1.2.3