diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-03-20 14:58:37 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-03-20 14:58:37 +0100 |
| commit | 09cce8c175bcf93a077e63035fc68a3f2627bd75 (patch) | |
| tree | c4004422c4423c9088305bb35a04d54a86a9e028 | |
| parent | 25b8f0503c56114f097f60db215880416bd187d8 (diff) | |
| parent | df2ce610f0389edb0583fed15eaabe5d21518fb5 (diff) | |
| download | libs-lbm-09cce8c175bcf93a077e63035fc68a3f2627bd75.tar.gz | |
Merge branch 'dev'
| -rw-r--r-- | default.nix | 9 | ||||
| -rw-r--r-- | examples/poiseulle_particles_2d_psm_gpu/sim.cpp | 10 | ||||
| -rw-r--r-- | lib/core/c++/boundary.hpp | 52 |
3 files changed, 64 insertions, 7 deletions
diff --git a/default.nix b/default.nix index 2b99863..2232e47 100644 --- a/default.nix +++ b/default.nix @@ -162,11 +162,6 @@ in rec { inherit kel; }; - s_poiseulle_particles_2d_gpu = pkgs.callPackage ./examples/s_poiseulle_particles_2d_gpu/.nix/derivation.nix { - inherit pname version stdenv forstio adaptive-cpp; - inherit kel; - }; - poiseulle_3d = pkgs.callPackage ./examples/poiseulle_3d/.nix/derivation.nix { inherit pname version stdenv forstio adaptive-cpp; inherit kel; @@ -198,7 +193,9 @@ in rec { kel.lbm.core kel.lbm.sycl examples.meta - examples.poiseulle_particles_2d_gpu + examples.poiseulle_particles_2d_bgk_gpu + examples.poiseulle_particles_2d_psm_gpu + examples.poiseulle_particles_2d_hlbm_gpu examples.poiseulle_3d_gpu ]; }; diff --git a/examples/poiseulle_particles_2d_psm_gpu/sim.cpp b/examples/poiseulle_particles_2d_psm_gpu/sim.cpp index cf68d24..ff636ca 100644 --- a/examples/poiseulle_particles_2d_psm_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_psm_gpu/sim.cpp @@ -286,7 +286,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){ } auto& lbm_dir = eo_lbm_dir.get_value(); - auto out_dir = lbm_dir / "poiseulle_particles_2d_gpu"; + auto out_dir = lbm_dir / "poiseulle_particles_2d_psm_gpu"; { std::error_code ec; @@ -385,6 +385,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){ } } sycl_q.wait(); + /* { { auto eov = dev.copy_to_host(lbm_sycl_macro_data,*lbm_macro_data_ptr); @@ -399,6 +400,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){ } } } + */ /* { { @@ -443,6 +445,12 @@ saw::error_or<void> lbm_main(int argc, char** argv){ // After Loop sycl_q.wait(); { + auto eov = dev.copy_to_host(lbm_sycl_macro_data,*lbm_macro_data_ptr); + if(eov.is_error()){ + return eov; + } + } + { auto eov = write_vtk_file(out_dir,"m",time_steps.get(), *lbm_macro_data_ptr); if(eov.is_error()){ return eov; diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp index 9afdfd7..3503681 100644 --- a/lib/core/c++/boundary.hpp +++ b/lib/core/c++/boundary.hpp @@ -8,6 +8,9 @@ namespace lbm { namespace cmpt { struct BounceBack {}; +template<uint64_t i> +struct AntiBounceBack {}; + template<bool East> struct ZouHeHorizontal{}; @@ -69,6 +72,55 @@ public: } }; +/** + * Anti Full-Way BounceBack. + */ +template<typename T, typename Descriptor, uint64_t D, typename Encode> +class component<T, Descriptor, cmpt::AntiBounceBack<D>, Encode> { +private: +public: + component() = default; + + using Component = cmpt::AntiBounceBack<D>; + + /** + * Thoughts regarding automating order setup + */ + using access = cmpt::access_tuple< + cmpt::access<"dfs", 1, true, true, true> + >; + + /** + * Thoughts regarding automating order setup + */ + static constexpr saw::string_literal name = "full_way_anti_bounce_back"; + static constexpr saw::string_literal after = ""; + static constexpr saw::string_literal before = "streaming"; + + /** + * Raw setup + */ + template<typename CellFieldSchema> + void apply(const saw::data<CellFieldSchema, Encode>& field, const saw::data<sch::FixedArray<sch::UInt64,Descriptor::D>>& index, saw::data<sch::UInt64> time_step)const{ + bool is_even = ((time_step.get() % 2u) == 0u); + + // This is a ref + + // auto& dfs_f = (is_even) ? field.template get<"dfs">() : field.template get<"dfs_old">(); + auto& dfs_old_f = (is_even) ? field.template get<"dfs_old">() : field.template get<"dfs">(); + + using dfi = df_info<T,Descriptor>; + + // Technically use .copy() + auto& dfs_old = dfs_old_f.at(index); + auto df_cpy = dfs_old; + + for(uint64_t i = 0u; i < Descriptor::Q; ++i){ + dfs_old.at({i}) = df_cpy.at({dfi::opposite_index.at(i)}); + } + } +}; + template<typename FP, typename Descriptor, typename Encode> class component<FP, Descriptor, cmpt::Equilibrium, Encode> final { private: |
