summaryrefslogtreecommitdiff
path: root/examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-06-08 20:15:59 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-06-08 20:15:59 +0200
commit3a27bca74e7645874e52f101d467aff8ff7d78f4 (patch)
treeb5f742bd3f146a9747c159f9fd8d099a6d566c1f /examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp
parent5ea4875b96bfacd4c5f0125c9e7b64b70f0ccfb9 (diff)
parent932fbf86d60df48623ad5fbc9d60e572bb68ef12 (diff)
downloadlibs-lbm-3a27bca74e7645874e52f101d467aff8ff7d78f4.tar.gz
Merge branch 'dev'HEADmaster
Diffstat (limited to 'examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp')
-rw-r--r--examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp b/examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp
index 9375078..b09aa64 100644
--- a/examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp
+++ b/examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp
@@ -13,7 +13,7 @@ namespace lbm {
constexpr uint64_t dim_y = 256ul;
constexpr uint64_t dim_x = dim_y * 20ul;
-constexpr uint64_t particle_amount = 1ul;
+// constexpr uint64_t particle_amount = 1ul;
namespace sch {
using namespace saw::schema;
@@ -215,6 +215,21 @@ saw::error_or<void> step(
break;
case 2u:
collision.apply(fields,macros,index,t_i);
+ {
+ saw::data<sch::Vector<T,Desc::D>> middle;
+ middle.at({{0u}}) = dim_x * 0.25;
+ middle.at({{1u}}) = dim_y * 0.5;
+
+ saw::data<sch::Vector<T,Desc::D>> ind_vec;
+ ind_vec.at({{0u}}) = index.at({{0u}}).template cast_to<T>();
+ ind_vec.at({{1u}}) = index.at({{1u}}).template cast_to<T>();
+
+ auto dist = middle - ind_vec;
+ auto dist_2 = saw::math::dot(dist,dist);
+ if(dist_2.at({}).get() < dim_y*dim_y*0.01){
+ porous_f.at(index).at({}) = 0.0;
+ }
+ }
break;
case 3u:
flow_in.apply(fields,index,t_i);