summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-07-30 21:27:06 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-07-30 21:27:06 +0200
commitea3564475a0e8431c553fb34d4b680e05c451c8a (patch)
treef902e06419efc0175aca4c6fd5fc390650724182 /modules
parent87b0148bb6814171983b537a456f7b5004833529 (diff)
downloadlibs-lbm-ea3564475a0e8431c553fb34d4b680e05c451c8a.tar.gz
Turns out, you need to reference the data type you retrieve ._.
Diffstat (limited to 'modules')
-rw-r--r--modules/core/c++/fplbm.hpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/modules/core/c++/fplbm.hpp b/modules/core/c++/fplbm.hpp
index 3c8e173..cfb0062 100644
--- a/modules/core/c++/fplbm.hpp
+++ b/modules/core/c++/fplbm.hpp
@@ -1,8 +1,7 @@
#pragma once
#include "common.hpp"
-#include "particle/aabb.hpp"
-#include "particle/porosity.hpp"
+#include "particle/particle.hpp"
#include "iterator.hpp"
namespace kel {
@@ -153,7 +152,7 @@ public:
auto parts = pg.template get<"particles">();
auto parts_size = parts.meta().at({0u});
- auto pi = parts.at(index);
+ auto& pi = parts.at(index);
auto& pirb = pi.template get<"rigid_body">();
auto& pirb_pos = pirb.template get<"position">();
@@ -181,6 +180,8 @@ public:
saw::data<sch::Scalar<T>> eps;
eps.at({}) = 1.5f;
+ saw::data<sch::Vector<T,Descriptor::D>> force_p;
+
iterator<Descriptor::D>::apply([&](const auto& index_f) -> void {
auto& force = force_f.at(index_f);
auto& vel = vel_f.at(index_f);
@@ -193,7 +194,16 @@ public:
auto flip_por = one - por;
force = ( vel_s * rho - vel * rho ) * two * flip_por;
+
+ force_p = force_p + force;
}, aabb.template get<"a">(), aabb.template get<"b">());
+
+ auto& pirb_acc = pirb.template get<"acceleration">();
+ pirb_acc = - force_p / pg.template get<"total_mass">().at({});
+
+ for(saw::data<sch::UInt64> i{0u}; i < sub_steps; ++i){
+ verlet_step_lambda<T,Descriptor::D>(pi,sss);
+ }
}
};