summaryrefslogtreecommitdiff
path: root/lib/core/c++/hlbm.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-06-02 20:20:48 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-06-02 20:20:48 +0200
commit5ea4875b96bfacd4c5f0125c9e7b64b70f0ccfb9 (patch)
tree96b1625e2559e227e2f12802796450d64ab4ce45 /lib/core/c++/hlbm.hpp
parentcf4132d9a02271847e774035c4a49ff9158ba289 (diff)
parentda25b3a1e7776a810d3bda5af3f363cf3e986cae (diff)
downloadlibs-lbm-5ea4875b96bfacd4c5f0125c9e7b64b70f0ccfb9.tar.gz
Merge branch 'dev'
Diffstat (limited to 'lib/core/c++/hlbm.hpp')
-rw-r--r--lib/core/c++/hlbm.hpp33
1 files changed, 32 insertions, 1 deletions
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<typename T, typename Descriptor, typename Encode>
+class component<T, Descriptor, cmpt::HlbmInit, Encode> final {
+private:
+ typename saw::native_data_type<T>::type relaxation_;
+ saw::data<T> frequency_;
+public:
+ component(typename saw::native_data_type<T>::type relaxation__):
+ relaxation_{relaxation__},
+ frequency_{typename saw::native_data_type<T>::type(1) / relaxation_}
+ {}
+
+ template<typename CellFieldSchema, typename MacroFieldSchema>
+ void apply(const saw::data<CellFieldSchema, Encode>& field, const saw::data<MacroFieldSchema,Encode>& macros, saw::data<sch::FixedArray<sch::UInt64,Descriptor::D>> index, saw::data<sch::UInt64> 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">();
+
}
};