From d8321ed7a23f7554cd0144c4f5e8dc625bbee4fe Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 26 Feb 2026 14:35:57 +0100 Subject: Clean repo for run and make benchmarkable hlbm case --- examples/poiseulle_particles_2d_gpu/sim.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'examples/poiseulle_particles_2d_gpu') diff --git a/examples/poiseulle_particles_2d_gpu/sim.cpp b/examples/poiseulle_particles_2d_gpu/sim.cpp index 01fec89..fffcb31 100644 --- a/examples/poiseulle_particles_2d_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_gpu/sim.cpp @@ -10,9 +10,10 @@ namespace kel { namespace lbm { -constexpr uint64_t dim_x = 1024ul; constexpr uint64_t dim_y = 512ul; -constexpr uint64_t particle_size = 1ul; +constexpr uint64_t dim_x = dim_y * 20ul; + +constexpr uint64_t particle_amount = 1ul; namespace sch { using namespace saw::schema; @@ -60,7 +61,7 @@ template saw::error_or setup_initial_conditions( saw::data>& fields, saw::data>& macros, - saw::data, particle_size>>& particles + saw::data, particle_amount>>& particles ){ auto& info_f = fields.template get<"info">(); auto& porous_f = macros.template get<"porosity">(); @@ -158,14 +159,14 @@ saw::error_or setup_initial_conditions( df_f.get_dims() ); - for(saw::data i{0u}; i < saw::data{particle_size}; ++i){ + for(saw::data i{0u}; i < saw::data{particle_amount}; ++i){ auto& part = particles.at(i); saw::data> pos; - pos.at({{0u}}) = dim_x * 0.5; + pos.at({{0u}}) = dim_x * 0.25; pos.at({{1u}}) = dim_y * 0.5; saw::data> rad, dense, dt; - rad.at({}) = dim_y * 0.2; + rad.at({}) = dim_y * 0.1; dense.at({}) = 1.0; dt.at({}) = 1.0; part = create_spheroid_particle( @@ -182,7 +183,7 @@ template saw::error_or step( saw::data>,encode::Sycl>& fields, saw::data>,encode::Sycl>& macros, - saw::data, particle_size>>& particles, + saw::data, particle_amount>>& particles, saw::data t_i, device& dev ){ @@ -321,7 +322,7 @@ saw::error_or lbm_main(int argc, char** argv){ // saw::data> meta{{dim_x,dim_y}}; auto lbm_data_ptr = saw::heap>>(); auto lbm_macro_data_ptr = saw::heap>>(); - auto lbm_particle_data_ptr = saw::heap, particle_size>>>(); + auto lbm_particle_data_ptr = saw::heap, particle_amount>>>(); std::cout<<"Estimated Bytes: "<,sch::MacroStruct>().get()< lbm_main(int argc, char** argv){ saw::data, encode::Sycl> lbm_sycl_data{sycl_q}; saw::data, encode::Sycl> lbm_sycl_macro_data{sycl_q}; - saw::data, particle_size>, encode::Sycl> lbm_sycl_particle_data{sycl_q}; + saw::data, particle_amount>, encode::Sycl> lbm_sycl_particle_data{sycl_q}; sycl_q.wait(); auto lsd_view = make_chunk_struct_view(lbm_sycl_data); -- cgit v1.2.3 From 8f7b9a04e5d72a451c7e9bdc6cd084f5614dc56a Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 26 Feb 2026 14:40:59 +0100 Subject: Matched initial conditions to intention and added better CharVel values --- examples/poiseulle_particles_2d_gpu/sim.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/poiseulle_particles_2d_gpu') diff --git a/examples/poiseulle_particles_2d_gpu/sim.cpp b/examples/poiseulle_particles_2d_gpu/sim.cpp index fffcb31..1832965 100644 --- a/examples/poiseulle_particles_2d_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_gpu/sim.cpp @@ -143,7 +143,7 @@ saw::error_or setup_initial_conditions( iterator::apply( [&](auto& index){ saw::data> middle, ind_vec; - middle.at({{0u}}) = dim_x * 0.5; + middle.at({{0u}}) = dim_x * 0.25; middle.at({{1u}}) = dim_y * 0.5; ind_vec.at({{0u}}) = index.at({{0u}}).template cast_to(); @@ -151,7 +151,7 @@ saw::error_or setup_initial_conditions( auto dist = middle - ind_vec; auto dist_2 = saw::math::dot(dist,dist); - if(dist_2.at({}).get() < 128*128){ + if(dist_2.at({}).get() < dim_y*dim_y*0.01){ porous_f.at(index).at({}) = 0.0; } }, @@ -317,7 +317,7 @@ saw::error_or lbm_main(int argc, char** argv){ {{1.0}} }; - print_lbm_meta(conv,{0.01},{0.1},{1024.0}); + print_lbm_meta(conv,{0.01},{0.01},{0.4 * dim_y}); // saw::data> meta{{dim_x,dim_y}}; auto lbm_data_ptr = saw::heap>>(); -- cgit v1.2.3