summaryrefslogtreecommitdiff
path: root/examples/poiseulle_particles_2d_gpu
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-02-05 19:01:53 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-02-05 19:01:53 +0100
commit03bcbc83d1b6d45c4ccd65e8b0b54e49d12ba2c9 (patch)
tree61f8aa33755d3f345d604c1c166346603b2a2662 /examples/poiseulle_particles_2d_gpu
parentb79e5cf1a3c07cad4edcad2c909318a5a5b6115e (diff)
downloadlibs-lbm-03bcbc83d1b6d45c4ccd65e8b0b54e49d12ba2c9.tar.gz
Adding lambda for timesteps management and reduced dimensions
Diffstat (limited to 'examples/poiseulle_particles_2d_gpu')
-rw-r--r--examples/poiseulle_particles_2d_gpu/sim.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/examples/poiseulle_particles_2d_gpu/sim.cpp b/examples/poiseulle_particles_2d_gpu/sim.cpp
index 305ef80..f9ee85b 100644
--- a/examples/poiseulle_particles_2d_gpu/sim.cpp
+++ b/examples/poiseulle_particles_2d_gpu/sim.cpp
@@ -7,8 +7,8 @@
namespace kel {
namespace lbm {
-constexpr uint64_t dim_x = 2048u;
-constexpr uint64_t dim_y = 1024u;
+constexpr uint64_t dim_x = 1024u;
+constexpr uint64_t dim_y = 512u;
namespace sch {
using namespace saw::schema;
@@ -119,7 +119,15 @@ saw::error_or<void> step(
// Need nicer things to handle the flow. I see improvement here
component<T,Desc,cmpt::BGK,encode::Sycl<saw::encode::Native>> collision{0.6};
component<T,Desc,cmpt::BounceBack,encode::Sycl<saw::encode::Native>> bb;
- component<T,Desc,cmpt::ZouHeHorizontal<true>,encode::Sycl<saw::encode::Native>> flow_in{1.01};
+ component<T,Desc,cmpt::ZouHeHorizontal<true>,encode::Sycl<saw::encode::Native>> flow_in{
+ [&](){
+ uint64_t target_t_i = 128u;
+ if(t_i.get() < target_t_i){
+ return 1.0 + (0.001 / target_t_i) * t_i.get();
+ }
+ return 1.001;
+ }()
+ };
component<T,Desc,cmpt::ZouHeHorizontal<false>,encode::Sycl<saw::encode::Native>> flow_out{1.0};
h.parallel_for(acpp::sycl::range<Desc::D>{dim_x,dim_y}, [=](acpp::sycl::id<Desc::D> idx){
@@ -236,7 +244,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){
}
}
sycl_q.wait();
- saw::data<sch::UInt64> time_steps{256ul};
+ saw::data<sch::UInt64> time_steps{512ul};
for(saw::data<sch::UInt64> i{0u}; i < time_steps; ++i){
{