summaryrefslogtreecommitdiff
path: root/lib/core/c++/momentum_gather.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-07-05 15:59:23 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-07-05 15:59:23 +0200
commitc0549d71b2109f10c1238db8b22362e7826ba61b (patch)
tree16cd5264fcc3afe912e1b1b67738c8940d6d1177 /lib/core/c++/momentum_gather.hpp
parent9a3147bc79caf3c0fb1a9cdee29d156b5ff092c7 (diff)
downloadlibs-lbm-c0549d71b2109f10c1238db8b22362e7826ba61b.tar.gz
Just rename from lib to modules
Diffstat (limited to 'lib/core/c++/momentum_gather.hpp')
-rw-r--r--lib/core/c++/momentum_gather.hpp54
1 files changed, 0 insertions, 54 deletions
diff --git a/lib/core/c++/momentum_gather.hpp b/lib/core/c++/momentum_gather.hpp
deleted file mode 100644
index 7b1fc96..0000000
--- a/lib/core/c++/momentum_gather.hpp
+++ /dev/null
@@ -1,54 +0,0 @@
-#pragma once
-
-#include "common.hpp"
-#include "macroscopic.hpp"
-#include "component.hpp"
-#include "equilibrium.hpp"
-
-namespace kel {
-namespace lbm {
-namespace cmpt {
-// Gather the force, Luke!
-struct ForceGather {};
-}
-
-template<typename T, typename Descriptor, typename Encode>
-class component<T,Descriptor,cmpt::ForceGather, Encode> {
-private:
-public:
- 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 {
-
- using dfi = df_info<T,Descriptor>;
- 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_f = macros.template get<"porosity">();
- auto& porous = porous_f.at(index);
-
- auto& force_f = macros.template get<"force">();
- auto& force = force_f.at(index);
-
- for(uint64_t k{0u}; k < Descriptor::D; ++k){
- force.at({{k}}).set(0);
- }
-
- auto& dfs = dfs_old_f.at(index);
- for(uint64_t i{0u}; i < Descriptor::Q; ++i){
- uint64_t i_opp = dfi::opposite_index[i];
- auto dfs_diff = dfs.at({i}) - dfs.at({i_opp});
- for(uint64_t k{0u}; k < Descriptor::D; ++k){
- force.at({{k}}) = force.at({{k}}) + dfs_diff * saw::data<T>{dfi::directions[i][k]};
- }
- }
-
- saw::data<sch::Scalar<T>> one;
- one.at({}) = 1.0;
- auto flip_porous = one - porous;
- force = force * flip_porous;
- }
-};
-}
-}