From c59aeef2e0c86ec3f0f34ce77c205f3ef0b034cc Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 8 Nov 2026 22:04:06 +0100 Subject: Abstract move. Forstio independence --- examples/throat_clog_2d/step.hpp | 94 ++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'examples/throat_clog_2d/step.hpp') diff --git a/examples/throat_clog_2d/step.hpp b/examples/throat_clog_2d/step.hpp index dab9178..840f8ba 100644 --- a/examples/throat_clog_2d/step.hpp +++ b/examples/throat_clog_2d/step.hpp @@ -6,15 +6,15 @@ namespace kel { namespace lbm { template -saw::error_or step( +kel::lbm::error_or step( const converter& conv, - saw::data>,encode::Sycl>& fields, - saw::data>,encode::Sycl>& macros, - saw::data>,encode::Sycl>& particles, - saw::data t_i, + kel::lbm::data>,encode::Sycl>& fields, + kel::lbm::data>,encode::Sycl>& macros, + kel::lbm::data>,encode::Sycl>& particles, + kel::lbm::data t_i, device& dev ){ - static constexpr saw::data sub_steps{0u}; + static constexpr kel::lbm::data sub_steps{0u}; auto& q = dev.get_handle(); auto& info_f = fields.template get<"info">(); @@ -22,9 +22,9 @@ saw::error_or step( if constexpr ( std::is_same_v ){ q.submit([&](acpp::sycl::handler& h){ - component> hlbm_reset; + component> hlbm_reset; h.parallel_for(acpp::sycl::range{dim_x,dim_y}, [=](acpp::sycl::id idx){ - saw::data> index; + kel::lbm::data> index; for(uint64_t i = 0u; i < Desc::D; ++i){ index.at({{i}}).set(idx[i]); } @@ -33,10 +33,10 @@ saw::error_or step( }); }).wait(); q.submit([&](acpp::sycl::handler& h){ - component> hlbm_one_part; + component> hlbm_one_part; h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){ - saw::data> index; + kel::lbm::data> index; for(uint64_t i = 0u; i < 1u; ++i){ index.at({{i}}).set(idx[i]); } @@ -46,12 +46,12 @@ saw::error_or step( }).wait(); q.submit([&](acpp::sycl::handler& h){ - component> collision{0.8201}; - component> bb; - component,encode::Sycl> flow_out{1.0}; + component> collision{0.8201}; + component> bb; + component,encode::Sycl> flow_out{1.0}; h.parallel_for(acpp::sycl::range{dim_x,dim_y}, [=](acpp::sycl::id idx){ - saw::data> index; + kel::lbm::data> index; for(uint64_t i = 0u; i < Desc::D; ++i){ index.at({{i}}).set(idx[i]); } @@ -69,10 +69,10 @@ saw::error_or step( break; case 3u: { - component,encode::Sycl> flow_in{ - [&]() -> saw::data> { - saw::data> vel; - saw::data scale; + component,encode::Sycl> flow_in{ + [&]() -> kel::lbm::data> { + kel::lbm::data> vel; + kel::lbm::data scale; { scale.set([&](){ if(t_i.get() > 1024u){ @@ -84,7 +84,7 @@ saw::error_or step( } { auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast::type>((0.1 / 0.64) * y_si.get() - (0.1 / (0.64*0.64)) * y_si.get() * y_si.get())}}).handle() * scale; + vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast::type>((0.1 / 0.64) * y_si.get() - (0.1 / (0.64*0.64)) * y_si.get() * y_si.get())}}).handle() * scale; vel.at({{1u}}) = 0.0f; } return vel; @@ -105,9 +105,9 @@ saw::error_or step( }).wait(); }else if constexpr ( std::is_same_v ){ q.submit([&](acpp::sycl::handler& h){ - component> fplbm_reset; + component> fplbm_reset; h.parallel_for(acpp::sycl::range{dim_x,dim_y}, [=](acpp::sycl::id idx){ - saw::data> index; + kel::lbm::data> index; for(uint64_t i = 0u; i < Desc::D; ++i){ index.at({{i}}).set(idx[i]); } @@ -117,11 +117,11 @@ saw::error_or step( }).wait(); q.submit([&](acpp::sycl::handler& h){ - saw::data> grav; - component> fplbm_one_part{grav}; + kel::lbm::data> grav; + component> fplbm_one_part{grav}; h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){ - saw::data> index; + kel::lbm::data> index; for(uint64_t i = 0u; i < 1u; ++i){ index.at({{i}}).set(idx[i]); } @@ -132,13 +132,13 @@ saw::error_or step( // auto coll_ev = q.submit([&](acpp::sycl::handler& h){ - component> bgk{0.8201}; - component> collision{0.8201}; - component> bb; - component,encode::Sycl> flow_out{1.0}; + component> bgk{0.8201}; + component> collision{0.8201}; + component> bb; + component,encode::Sycl> flow_out{1.0}; h.parallel_for(acpp::sycl::range{dim_x,dim_y}, [=](acpp::sycl::id idx){ - saw::data> index; + kel::lbm::data> index; for(uint64_t i = 0u; i < Desc::D; ++i){ index.at({{i}}).set(idx[i]); } @@ -156,12 +156,12 @@ saw::error_or step( break; case 3u: { - component,encode::Sycl> flow_in{ - [&]() -> saw::data> { - saw::data> vel; + component,encode::Sycl> flow_in{ + [&]() -> kel::lbm::data> { + kel::lbm::data> vel; { auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast::type>((0.01 / 0.64) * y_si.get() - (0.01 / (0.64*0.64)) * y_si.get() * y_si.get())}}).handle(); + vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast::type>((0.01 / 0.64) * y_si.get() - (0.01 / (0.64*0.64)) * y_si.get() * y_si.get())}}).handle(); vel.at({{1u}}) = 0.0f; } return vel; @@ -182,9 +182,9 @@ saw::error_or step( }).wait(); }else if constexpr ( std::is_same_v ){ q.submit([&](acpp::sycl::handler& h){ - component> fplbm_reset; + component> fplbm_reset; h.parallel_for(acpp::sycl::range{dim_x,dim_y}, [=](acpp::sycl::id idx){ - saw::data> index; + kel::lbm::data> index; for(uint64_t i = 0u; i < Desc::D; ++i){ index.at({{i}}).set(idx[i]); } @@ -194,10 +194,10 @@ saw::error_or step( }).wait(); q.submit([&](acpp::sycl::handler& h){ - component> fplbm_one_part; + component> fplbm_one_part; h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){ - saw::data> index; + kel::lbm::data> index; for(uint64_t i = 0u; i < 1u; ++i){ index.at({{i}}).set(idx[i]); } @@ -208,13 +208,13 @@ saw::error_or step( // auto coll_ev = q.submit([&](acpp::sycl::handler& h){ - component> bgk{0.8201}; - component> collision{0.8201}; - component> bb; - component,encode::Sycl> flow_out{1.0}; + component> bgk{0.8201}; + component> collision{0.8201}; + component> bb; + component,encode::Sycl> flow_out{1.0}; h.parallel_for(acpp::sycl::range{dim_x,dim_y}, [=](acpp::sycl::id idx){ - saw::data> index; + kel::lbm::data> index; for(uint64_t i = 0u; i < Desc::D; ++i){ index.at({{i}}).set(idx[i]); } @@ -232,12 +232,12 @@ saw::error_or step( break; case 3u: { - component,encode::Sycl> flow_in{ - [&]() -> saw::data> { - saw::data> vel; + component,encode::Sycl> flow_in{ + [&]() -> kel::lbm::data> { + kel::lbm::data> vel; { auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast::type>((1.2 / 0.64) * y_si.get() - (1.2 / (0.64*0.64)) * y_si.get() * y_si.get())}}).handle(); + vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast::type>((1.2 / 0.64) * y_si.get() - (1.2 / (0.64*0.64)) * y_si.get() * y_si.get())}}).handle(); vel.at({{1u}}) = 0.0f; } return vel; @@ -259,7 +259,7 @@ saw::error_or step( } - return saw::make_void(); + return kel::lbm::make_void(); } } -- cgit v1.3.1