diff options
| -rw-r--r-- | examples/moving_poiseulle_particles_2d_fplbm_gpu/sim.cpp | 4 | ||||
| -rw-r--r-- | examples/poiseulle_particles_2d_gpu/sim.cpp | 4 | ||||
| -rw-r--r-- | modules/core/c++/fplbm.hpp | 16 |
3 files changed, 18 insertions, 6 deletions
diff --git a/examples/moving_poiseulle_particles_2d_fplbm_gpu/sim.cpp b/examples/moving_poiseulle_particles_2d_fplbm_gpu/sim.cpp index 42495c6..f6c09e9 100644 --- a/examples/moving_poiseulle_particles_2d_fplbm_gpu/sim.cpp +++ b/examples/moving_poiseulle_particles_2d_fplbm_gpu/sim.cpp @@ -134,7 +134,7 @@ saw::error_or<void> init( } }, {},// 0-index - df_f.get_dims() + dfs_f.get_dims() ); saw::data<sch::Scalar<T>> rad; @@ -350,7 +350,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){ auto lsdm_view = make_view(lbm_sycl_macro_data); auto lsdp_view = make_view(lbm_sycl_parts_data); - saw::data<sch::UInt64> time_steps{16u*4096ul}; + saw::data<sch::UInt64> time_steps{32u*2048ul}; auto& info_f = lsd_view.template get<"info">(); for(saw::data<sch::UInt64> i{0u}; i < time_steps and krun; ++i){ diff --git a/examples/poiseulle_particles_2d_gpu/sim.cpp b/examples/poiseulle_particles_2d_gpu/sim.cpp index fd6cdca..f5b49e9 100644 --- a/examples/poiseulle_particles_2d_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_gpu/sim.cpp @@ -25,6 +25,8 @@ template<typename T, typename Desc, typename Coll> saw::error_or<void> lbm_main(const saw::data<args::LbmArgs>& args){ using namespace kel::lbm; + auto& an = args.template get<"args">(); + using dfi = df_info<T,Desc>; auto eo_lbm_dir = output_directory(); @@ -33,7 +35,7 @@ saw::error_or<void> lbm_main(const saw::data<args::LbmArgs>& args){ } auto& lbm_dir = eo_lbm_dir.get_value(); - auto out_dir = lbm_dir / "poiseulle_particles_2d_gpu" / "hlbm"; + auto out_dir = lbm_dir / "poiseulle_particles_2d_gpu" / an.template get<"coupling">().stl_view(); { std::error_code ec; diff --git a/modules/core/c++/fplbm.hpp b/modules/core/c++/fplbm.hpp index 3c8e173..cfb0062 100644 --- a/modules/core/c++/fplbm.hpp +++ b/modules/core/c++/fplbm.hpp @@ -1,8 +1,7 @@ #pragma once #include "common.hpp" -#include "particle/aabb.hpp" -#include "particle/porosity.hpp" +#include "particle/particle.hpp" #include "iterator.hpp" namespace kel { @@ -153,7 +152,7 @@ public: auto parts = pg.template get<"particles">(); auto parts_size = parts.meta().at({0u}); - auto pi = parts.at(index); + auto& pi = parts.at(index); auto& pirb = pi.template get<"rigid_body">(); auto& pirb_pos = pirb.template get<"position">(); @@ -181,6 +180,8 @@ public: saw::data<sch::Scalar<T>> eps; eps.at({}) = 1.5f; + saw::data<sch::Vector<T,Descriptor::D>> force_p; + iterator<Descriptor::D>::apply([&](const auto& index_f) -> void { auto& force = force_f.at(index_f); auto& vel = vel_f.at(index_f); @@ -193,7 +194,16 @@ public: auto flip_por = one - por; force = ( vel_s * rho - vel * rho ) * two * flip_por; + + force_p = force_p + force; }, aabb.template get<"a">(), aabb.template get<"b">()); + + auto& pirb_acc = pirb.template get<"acceleration">(); + pirb_acc = - force_p / pg.template get<"total_mass">().at({}); + + for(saw::data<sch::UInt64> i{0u}; i < sub_steps; ++i){ + verlet_step_lambda<T,Descriptor::D>(pi,sss); + } } }; |
