summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-07-18 21:45:14 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-07-18 21:45:14 +0200
commit1693f8ccb3fbdbc8a1bd35a5ffde684ca4c68a3f (patch)
tree430706084b96d2e7c887ef65bf870e43daffc5bb /examples
parent8bc7955f5d95521f7c932b9551a3b71a62117630 (diff)
downloadlibs-lbm-1693f8ccb3fbdbc8a1bd35a5ffde684ca4c68a3f.tar.gz
Dangling
Diffstat (limited to 'examples')
-rw-r--r--examples/moving_poiseulle_particles_2d_hlbm_gpu/sim.cpp29
1 files changed, 28 insertions, 1 deletions
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<void> setup_initial_conditions(
);
saw::data<sch::Scalar<T>> rad;
- rad.at({}) = 2.0f;
+ rad.at({}) = dim_y * 0.1f;
saw::data<sch::Scalar<T>> dense;
dense.at({}) = 1.0f;
particles = create_spheroid_particle_group<T,Desc::D,particle_amount>(rad,dense,{16u});
@@ -174,6 +174,18 @@ saw::error_or<void> step(
auto& porous_f = macros.template get<"porosity">();
q.submit([&](acpp::sycl::handler& h){
+ component<T,Desc,cmpt::HlbmReset,encode::Sycl<saw::encode::Native>> hlbm_reset;
+ h.parallel_for(acpp::sycl::range<Desc::D>{dim_x,dim_y}, [=](acpp::sycl::id<Desc::D> idx){
+ saw::data<sch::FixedArray<sch::UInt64,Desc::D>> 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<T,Desc,cmpt::HlbmOneParticle,encode::Sycl<saw::encode::Native>> hlbm_one_part;
h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){
@@ -361,6 +373,21 @@ saw::error_or<void> 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<T,Desc,cmpt::Stream,encode::Sycl<saw::encode::Native>> stream;