summaryrefslogtreecommitdiff
path: root/modules/core/c++/particle/cuboid
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-08-07 12:34:22 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-08-07 12:34:22 +0200
commit7d094fe719923db5eb6b30edcc4fa01c6ce2cc2e (patch)
treec3b0c1084e3e0642cb986522e6222239669d0f88 /modules/core/c++/particle/cuboid
parenta0767a86817055744230239284441fdbb024fab5 (diff)
downloadlibs-lbm-7d094fe719923db5eb6b30edcc4fa01c6ce2cc2e.tar.gz
Cleaning up code
Diffstat (limited to 'modules/core/c++/particle/cuboid')
-rw-r--r--modules/core/c++/particle/cuboid/aabb.hpp40
-rw-r--r--modules/core/c++/particle/cuboid/common.hpp10
-rw-r--r--modules/core/c++/particle/cuboid/particle.hpp9
-rw-r--r--modules/core/c++/particle/cuboid/porosity.hpp10
4 files changed, 69 insertions, 0 deletions
diff --git a/modules/core/c++/particle/cuboid/aabb.hpp b/modules/core/c++/particle/cuboid/aabb.hpp
new file mode 100644
index 0000000..502132a
--- /dev/null
+++ b/modules/core/c++/particle/cuboid/aabb.hpp
@@ -0,0 +1,40 @@
+#pragma once
+
+#include "common.hpp"
+#include "../aabb.hpp"
+
+namespace kel {
+namespace lbm {
+
+template<typename T, uint64_t D, uint64_t PC>
+class particle_aabb<
+ sch::ParticleGroup<T,D,PC,coll::Cuboid<T>>
+> final {
+public:
+ using Schema = sch::ParticleGroup<T,D,PC,coll::Cuboid<T>>;
+
+ using AABB = sch::Struct<
+ sch::Member<sch::FixedArray<sch::UInt64,D>, "a">,
+ sch::Member<sch::FixedArray<sch::UInt64,D>, "b">
+ >;
+
+public:
+ template<typename Sch, typename Encode>
+ static constexpr saw::error_or<saw::data<AABB>> calculate(const saw::data<Sch,Encode>& pg, const saw::data<sch::FixedArray<sch::UInt64,1u>>& index, const saw::data<sch::FixedArray<sch::UInt64,D>>& meta){
+ static_assert(PC > 0u, "Can't calculate from no particle");
+ if(not (index.at({0u}).get() < PC)){
+ return saw::make_error<saw::err::critical>("Too large i in particle_aabb coll::Cuboid<T>");
+ }
+
+ saw::data<AABB> aabb;
+ auto& parts = pg.template get<"particles">();
+ auto& pi = parts.at(index);
+ auto& pirb = pi.template get<"rigid_body">();
+
+ /// TODO
+
+ return aabb;
+ }
+};
+}
+}
diff --git a/modules/core/c++/particle/cuboid/common.hpp b/modules/core/c++/particle/cuboid/common.hpp
new file mode 100644
index 0000000..a859cbe
--- /dev/null
+++ b/modules/core/c++/particle/cuboid/common.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+namespace kel {
+namespace lbm {
+namespace coll {
+template<typename T>
+struct Cuboid {};
+}
+}
+}
diff --git a/modules/core/c++/particle/cuboid/particle.hpp b/modules/core/c++/particle/cuboid/particle.hpp
new file mode 100644
index 0000000..e19d543
--- /dev/null
+++ b/modules/core/c++/particle/cuboid/particle.hpp
@@ -0,0 +1,9 @@
+#pragma once
+
+#include "common.hpp"
+#include "porosity.hpp"
+
+namespace kel {
+namespace lbm {
+}
+}
diff --git a/modules/core/c++/particle/cuboid/porosity.hpp b/modules/core/c++/particle/cuboid/porosity.hpp
new file mode 100644
index 0000000..bccfebf
--- /dev/null
+++ b/modules/core/c++/particle/cuboid/porosity.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+#include "common.hpp"
+#include "../porosity.hpp"
+
+namespace kel {
+namespace lbm {
+
+}
+}