From 5fee9c698f5f1ebe6ef8bf07f5a75e04dab92681 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 9 Feb 2026 16:49:12 +0100 Subject: Add rar as dep and implement collision --- lib/core/c++/collision.hpp | 6 +++--- lib/core/c++/hlbm.hpp | 10 +++++++++- lib/core/c++/psm.hpp | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 lib/core/c++/psm.hpp (limited to 'lib/core') diff --git a/lib/core/c++/collision.hpp b/lib/core/c++/collision.hpp index 6c39646..349833f 100644 --- a/lib/core/c++/collision.hpp +++ b/lib/core/c++/collision.hpp @@ -118,8 +118,8 @@ public: auto& dfs_old = (is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">(); // auto& dfs = (not is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">(); - saw::data rho; - saw::data> vel; + saw::data> rho; + saw::data> vel; compute_rho_u(dfs_old,rho,vel); auto eq = equilibrium(rho,vel); @@ -131,7 +131,7 @@ public: // saw::data ci_min_u{0}; saw::data ci_dot_u{0}; for(uint64_t d = 0u; d < Descriptor::D; ++d){ - ci_dot_u = ci_dot_u + vel.at({d}) * saw::data{static_cast::type>(dfi::directions[i][d])}; + ci_dot_u = ci_dot_u + vel.at({{d}}) * saw::data{static_cast::type>(dfi::directions[i][d])}; } saw::data F_i{0};// = saw::data{dfi::weights[i]} * (ci_dot_F * dfi::inv_cs2 + ci_dot_u * ci_dot_F * (dfi::inv_cs2 * dfi::inv_cs2)); diff --git a/lib/core/c++/hlbm.hpp b/lib/core/c++/hlbm.hpp index 1c665ce..f8f0118 100644 --- a/lib/core/c++/hlbm.hpp +++ b/lib/core/c++/hlbm.hpp @@ -13,11 +13,19 @@ struct HLBM {}; /** * HLBM collision operator for LBM */ -template +template class component { private: public: component() = default; + + template + 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); + + + } }; } diff --git a/lib/core/c++/psm.hpp b/lib/core/c++/psm.hpp new file mode 100644 index 0000000..8e151c3 --- /dev/null +++ b/lib/core/c++/psm.hpp @@ -0,0 +1,35 @@ +#pragma once + +#include "macroscopic.hpp" +#include "component.hpp" +#include "equilibrium.hpp" + +namespace kel { +namespace lbm { +namespace cmpt { +struct PSM {}; +} + +/** + * HLBM collision operator for LBM + */ +template +class component { +private: +public: + component() = default; + + template + 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); + + auto& dfs_old_f = (is_even) ? field.template get<"dfs_old">() : field.template get<"dfs">(); + auto& porous = field.template get<"porosity">(); + + + } +}; + +} +} -- cgit v1.2.3