From c634aac438972b7bafb5fbbeba7962d174cc0d03 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 14 Aug 2026 23:43:36 +0200 Subject: Experimental validation --- .../step.hpp | 125 +++++++++++---------- 1 file changed, 64 insertions(+), 61 deletions(-) (limited to 'examples/schaefer_turek_durst_krause_rannbacher/step.hpp') diff --git a/examples/schaefer_turek_durst_krause_rannbacher/step.hpp b/examples/schaefer_turek_durst_krause_rannbacher/step.hpp index 37eb4e7..1a70f6a 100644 --- a/examples/schaefer_turek_durst_krause_rannbacher/step.hpp +++ b/examples/schaefer_turek_durst_krause_rannbacher/step.hpp @@ -14,81 +14,84 @@ saw::error_or step( saw::data t_i, device& dev ){ + static constexpr saw::data sub_steps{0u}; + auto& q = dev.get_handle(); 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]); - } + if constexpr ( std::is_same_v ){ + 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(); + hlbm_reset.apply(fields,macros,index,t_i); + }); + }).wait(); + q.submit([&](acpp::sycl::handler& h){ + component> hlbm_one_part; - q.submit([&](acpp::sycl::handler& h){ - component> hlbm_one_part; + h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){ + saw::data> index; + for(uint64_t i = 0u; i < 1u; ++i){ + index.at({{i}}).set(idx[i]); + } - h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){ - saw::data> index; - for(uint64_t i = 0u; i < 1u; ++i){ - index.at({{i}}).set(idx[i]); - } + hlbm_one_part.apply(fields,macros,particles,index,t_i,{0u}); + }); + }).wait(); - hlbm_one_part.apply(fields,macros,particles,index,t_i,{16u}); - }); - }).wait(); + q.submit([&](acpp::sycl::handler& h){ + component> collision{1.0}; + component> bb; - // auto coll_ev = - q.submit([&](acpp::sycl::handler& h){ - component> collision{0.8}; - component> bb; + component,encode::Sycl> flow_in{ + [&](){ + uint64_t target_t_i = 16u; + if(t_i.get() < target_t_i){ + return 1.0 + (0.01 / target_t_i) * t_i.get(); + } + return 1.001; + }() + }; + component,encode::Sycl> flow_out{1.0}; - component,encode::Sycl> flow_in{ - [&](){ - uint64_t target_t_i = 16u; - if(t_i.get() < target_t_i){ - return 1.0 + (0.01 / target_t_i) * t_i.get(); + 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]); } - return 1.01; - }() - }; - component,encode::Sycl> flow_out{1.0}; - - 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]); - } - auto info = info_f.at(index); - - switch(info.get()){ - case 0u: - break; - case 1u: - bb.apply(fields,index,t_i); - break; - case 2u: - collision.apply(fields,macros,index,t_i); + auto info = info_f.at(index); + + switch(info.get()){ + case 0u: break; - case 3u: - flow_in.apply(fields,index,t_i); - collision.apply(fields,macros,index,t_i); + case 1u: + bb.apply(fields,index,t_i); break; - case 4u: - flow_out.apply(fields,index,t_i); - collision.apply(fields,macros,index,t_i); - break; - default: - break; - } - }); - }).wait(); + case 2u: + collision.apply(fields,macros,index,t_i); + break; + case 3u: + flow_in.apply(fields,index,t_i); + collision.apply(fields,macros,index,t_i); + break; + case 4u: + flow_out.apply(fields,index,t_i); + collision.apply(fields,macros,index,t_i); + break; + default: + break; + } + }); + }).wait(); + }else if constexpr ( std::is_same_v ){ + } return saw::make_void(); } -- cgit v1.2.3