From 2bae8b93faf614b1acb5df7269087b4f3786da5a Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 30 Jun 2026 23:52:02 +0200 Subject: Final run --- lib/core/c++/fplbm.hpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'lib/core/c++/fplbm.hpp') diff --git a/lib/core/c++/fplbm.hpp b/lib/core/c++/fplbm.hpp index 61def6b..c974472 100644 --- a/lib/core/c++/fplbm.hpp +++ b/lib/core/c++/fplbm.hpp @@ -114,6 +114,19 @@ public: auto& vel_f = macros.template get<"velocity">(); auto& por_f = macros.template get<"porosity">(); + // Temporary find a better way + auto& force_f = macros.template get<"force">(); + + + /** + * The other methods all work with a flipped porosity. + * For compat reasons this is also flipped + */ + auto porosity = por_f.at(index); + saw::data> one; + one.at({}) = 1.0; + auto flip_porosity = one - porosity; + saw::data>& rho = rho_f.at(index); saw::data> half; @@ -128,12 +141,13 @@ public: saw::data> min_two; min_two.at({}).set(-2); - auto force = vel * rho * min_two * por_f.at(index); + // Maybe ? + auto& force = force_f.at(index); + force = vel * rho * min_two * flip_porosity; saw::data> dfi_inv_cs2; dfi_inv_cs2.at({}).set(dfi::inv_cs2); - // auto vel = vel_f.at(index); for(uint64_t i = 0u; i < Descriptor::Q; ++i){ -- cgit v1.2.3