diff options
| -rw-r--r-- | examples/poiseulle_particles_2d_gpu/sim.cpp | 12 | ||||
| -rw-r--r-- | lib/core/c++/boundary.hpp | 4 | ||||
| -rw-r--r-- | lib/core/tests/collision.cpp | 6 |
3 files changed, 15 insertions, 7 deletions
diff --git a/examples/poiseulle_particles_2d_gpu/sim.cpp b/examples/poiseulle_particles_2d_gpu/sim.cpp index bb81383..644e4d1 100644 --- a/examples/poiseulle_particles_2d_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_gpu/sim.cpp @@ -204,8 +204,8 @@ saw::error_or<void> step( // auto coll_ev = q.submit([&](acpp::sycl::handler& h){ // 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::HLBM,encode::Sycl<saw::encode::Native>> collision{0.65}; + component<T,Desc,cmpt::BGK, encode::Sycl<saw::encode::Native>> collision{0.65}; + // component<T,Desc,cmpt::HLBM,encode::Sycl<saw::encode::Native>> collision{0.65}; // component<T,Desc,cmpt::PSM,encode::Sycl<saw::encode::Native>> collision{0.65}; component<T,Desc,cmpt::BounceBack,encode::Sycl<saw::encode::Native>> bb; @@ -243,14 +243,14 @@ saw::error_or<void> step( bb.apply(fields,index,t_i); break; case 2u: - flow_in.apply(fields,index,t_i); collision.apply(fields,macros,index,t_i); break; case 3u: - flow_out.apply(fields,index,t_i); + 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: @@ -370,7 +370,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){ } } sycl_q.wait(); - saw::data<sch::UInt64> time_steps{32ul}; + saw::data<sch::UInt64> time_steps{4096ul}; auto& info_f = lsd_view.template get<"info">(); @@ -397,6 +397,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){ } } } + /* { { auto eov = dev.copy_to_host(lbm_sycl_data,*lbm_data_ptr); @@ -411,6 +412,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){ } } } + */ // Stream sycl_q.submit([&](acpp::sycl::handler& h){ component<T,Desc,cmpt::Stream,encode::Sycl<saw::encode::Native>> stream; diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp index 0a4ff4d..d5f3022 100644 --- a/lib/core/c++/boundary.hpp +++ b/lib/core/c++/boundary.hpp @@ -135,7 +135,7 @@ public: for(saw::data<sch::UInt64> k{0u}; k < saw::data<sch::UInt64>{Descriptor::Q}; ++k){ auto c_k = dfi::directions[k.get()]; - if(c_k[0u]*known_dir >= 0){ + if(c_k[0u]*known_dir <= 0){ sum_df += dfs_old.at({k}); } } @@ -147,7 +147,7 @@ public: for(saw::data<sch::UInt64> k{0u}; k < saw::data<sch::UInt64>{Descriptor::Q}; ++k){ auto c_k = dfi::directions[k.get()]; - if(c_k[0u]*known_dir > 0){ + if(c_k[0u]*known_dir < 0){ sum_unknown_dfs += dfs_old.at({k}) * c_k[0u]; } } diff --git a/lib/core/tests/collision.cpp b/lib/core/tests/collision.cpp new file mode 100644 index 0000000..cd53336 --- /dev/null +++ b/lib/core/tests/collision.cpp @@ -0,0 +1,6 @@ +#include <forstio/test/suite.hpp> + +#include "../c++/collision.hpp" + +namespace { +} |
