From da25b3a1e7776a810d3bda5af3f363cf3e986cae Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 1 Jun 2026 20:36:51 +0200 Subject: Helping getting porosity checks against particles --- lib/core/c++/hlbm.hpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'lib/core/c++/hlbm.hpp') diff --git a/lib/core/c++/hlbm.hpp b/lib/core/c++/hlbm.hpp index 196de73..7590cc2 100644 --- a/lib/core/c++/hlbm.hpp +++ b/lib/core/c++/hlbm.hpp @@ -7,10 +7,39 @@ namespace kel { namespace lbm { namespace cmpt { +struct HlbmInit {}; struct Hlbm {}; struct HlbmParticle {}; } +template +class component final { +private: + typename saw::native_data_type::type relaxation_; + saw::data frequency_; +public: + component(typename saw::native_data_type::type relaxation__): + relaxation_{relaxation__}, + frequency_{typename saw::native_data_type::type(1) / relaxation_} + {} + + template + void apply(const saw::data& field, const saw::data& macros, saw::data> index, saw::data time_step) const { + auto& porosity_f = macros.template get<"porosity">(); + auto& particle_N_f = field.template get<"particle_N">(); + auto& particle_D_f = field.template get<"particle_D">(); + + auto& por = porosity_f.at(index); + por = {}; + + auto& pnf = particle_N_f.at(index); + pnf = {}; + + auto& pnd = particle_D_f.at(index); + pnd = {}; + } +}; + /** * HLBM collision operator for LBM */ @@ -61,8 +90,9 @@ public: 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})); } - // porosity.at({}) = 1.0; + porosity.at({}) = 1.0; D.at({}) = 0.0; + N = {}; } }; @@ -80,6 +110,7 @@ public: /// Iterate over the grid bounds // auto& grid = p.template get<"grid">(); + } }; -- cgit v1.2.3