From eb97ceef955fa1c5e3794c74fc9894fda1ce6f21 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 2 Jun 2026 18:15:13 +0200 Subject: Doing aabb computations --- lib/core/c++/hlbm.hpp | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) (limited to 'lib/core/c++/hlbm.hpp') diff --git a/lib/core/c++/hlbm.hpp b/lib/core/c++/hlbm.hpp index 7590cc2..ed49353 100644 --- a/lib/core/c++/hlbm.hpp +++ b/lib/core/c++/hlbm.hpp @@ -96,20 +96,55 @@ public: } }; -template +namespace impl { + +} + +template class component final { private: - typename saw::native_data_type::type relaxation_; - saw::data frequency_; + template + void apply_i(const saw::data& field, const saw::data& macros, const saw::data& part_groups, saw::data> index, saw::data time_step) const { + + } public: + /* + template + void apply_i() + */ template - void apply(const saw::data& field, const saw::data& macros, const saw::data& particles, saw::data> index, saw::data time_step) const { + void apply(const saw::data& field, const saw::data& macros, const saw::data& part_groups, saw::data> index, saw::data time_step) const { /// Figure out how to access the particle list // auto& p = particles.at(i); /// Iterate over the grid bounds // auto& grid = p.template get<"grid">(); + + auto& part_spheroid_group = part_groups.template get<0>(); + { + auto& parts = part_spheroid_group.template get<"particles">(); + auto parts_size = parts.size(); + + auto& pi = parts.at(index); + auto& pirb = pi.template get<"rigid_body">(); + auto& pirb_pos = pirb.template get<"position">(); + + saw::data> start; + saw::data> stop; + + /// Ok, I iterate over the space which covers our particle? So lower bounds to upper bounds + for(uint64_t i{0u}; i < Desc::D; ++i){ + + } + + iterator::apply([&](const auto& index){ + // ask for the d_k value here. + // For every value im iterating over I need sth + },start,stop); + + // Check + } } -- cgit v1.2.3 From d7c88d561d4e2b7a2706d14c11ea5fa4cd6ceaf3 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 2 Jun 2026 19:16:37 +0200 Subject: Fixing Desc name --- lib/core/c++/hlbm.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/core/c++/hlbm.hpp') diff --git a/lib/core/c++/hlbm.hpp b/lib/core/c++/hlbm.hpp index ed49353..6ae7d80 100644 --- a/lib/core/c++/hlbm.hpp +++ b/lib/core/c++/hlbm.hpp @@ -43,8 +43,8 @@ public: /** * HLBM collision operator for LBM */ -template -class component final { +template +class component final { private: typename saw::native_data_type::type relaxation_; saw::data frequency_; @@ -55,7 +55,7 @@ public: {} template - void apply(const saw::data& field, const saw::data& macros, saw::data> index, saw::data time_step) const { + void apply(const saw::data& field, const saw::data& macros, saw::data> index, saw::data time_step) const { bool is_even = ((time_step.get() % 2) == 0); @@ -68,9 +68,9 @@ public: auto& vel_f = macros.template get<"velocity">(); saw::data>& rho = rho_f.at(index); - saw::data>& vel = vel_f.at(index); + saw::data>& vel = vel_f.at(index); - compute_rho_u(dfs_old_f.at(index), rho, vel); + compute_rho_u(dfs_old_f.at(index), rho, vel); auto& porosity = porosity_f.at(index); saw::data> one; @@ -80,13 +80,13 @@ public: auto& N = particle_N_f.at(index); auto& D = particle_D_f.at(index); // Convex combination of velocities - vel = vel * porosity + [&]() -> saw::data> { + vel = vel * porosity + [&]() -> saw::data> { return (D.at({}).get() > 0.0 ? N * flip_porosity / D : N); }(); // Equilibrium - auto eq = equilibrium(rho,vel); + auto eq = equilibrium(rho,vel); - for(uint64_t i = 0u; i < Descriptor::Q; ++i){ + for(uint64_t i = 0u; i < Desc::Q; ++i){ dfs_old_f.at(index).at({i}) = dfs_old_f.at(index).at({i}) + frequency_ * (eq.at(i) - dfs_old_f.at(index).at({i})); } @@ -101,7 +101,7 @@ namespace impl { } template -class component final { +class component final { private: template void apply_i(const saw::data& field, const saw::data& macros, const saw::data& part_groups, saw::data> index, saw::data time_step) const { -- cgit v1.2.3