diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-08-07 12:34:45 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-08-07 12:34:45 +0200 |
| commit | 5d4192c73c72f29debe0f3b6e73889f0204ab74a (patch) | |
| tree | c3b0c1084e3e0642cb986522e6222239669d0f88 /modules/core/c++/particle | |
| parent | a5c654598544f2a33289664ba73a77343d301ce2 (diff) | |
| parent | 7d094fe719923db5eb6b30edcc4fa01c6ce2cc2e (diff) | |
| download | libs-lbm-5d4192c73c72f29debe0f3b6e73889f0204ab74a.tar.gz | |
Merge branch 'dev'
Diffstat (limited to 'modules/core/c++/particle')
| -rw-r--r-- | modules/core/c++/particle/aabb.hpp | 1 | ||||
| -rw-r--r-- | modules/core/c++/particle/cuboid/aabb.hpp | 40 | ||||
| -rw-r--r-- | modules/core/c++/particle/cuboid/common.hpp | 10 | ||||
| -rw-r--r-- | modules/core/c++/particle/cuboid/particle.hpp | 9 | ||||
| -rw-r--r-- | modules/core/c++/particle/cuboid/porosity.hpp | 10 | ||||
| -rw-r--r-- | modules/core/c++/particle/particle.hpp | 4 | ||||
| -rw-r--r-- | modules/core/c++/particle/spheroid/particle.hpp | 9 |
7 files changed, 80 insertions, 3 deletions
diff --git a/modules/core/c++/particle/aabb.hpp b/modules/core/c++/particle/aabb.hpp index da39ec2..e4c930b 100644 --- a/modules/core/c++/particle/aabb.hpp +++ b/modules/core/c++/particle/aabb.hpp @@ -26,7 +26,6 @@ public: static constexpr saw::error_or<saw::data<AABB>> calculate(const saw::data<Sch,Encode>& p_grp, 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 particles"); if(not (index.at({{0u}}).get() < PC) ){ - std::cerr.flush(); return saw::make_error<saw::err::critical>("Too large i in particle_aabb"); } 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 { + +} +} diff --git a/modules/core/c++/particle/particle.hpp b/modules/core/c++/particle/particle.hpp index a3669b4..21b4b34 100644 --- a/modules/core/c++/particle/particle.hpp +++ b/modules/core/c++/particle/particle.hpp @@ -82,8 +82,8 @@ saw::data<sch::ParticleGroup<T, D, PartAmount, coll::Spheroid<T>>> create_sphero total_mass.at({}) = rad_d * rad_d * density.at({}) * 3.141592; }else if constexpr ( D == 3u ){ - }else if constexpr ( D== 1u ){ - + }else if constexpr ( D == 1u ){ + total_mass.at({}) = rad_d * 2.0; } std::cout<<"Total Mass: "<<total_mass.at({}).get()<<std::endl; diff --git a/modules/core/c++/particle/spheroid/particle.hpp b/modules/core/c++/particle/spheroid/particle.hpp new file mode 100644 index 0000000..9c0912e --- /dev/null +++ b/modules/core/c++/particle/spheroid/particle.hpp @@ -0,0 +1,9 @@ +#pragma once + +namespace kel { +namespace lbm { +namespace coll { + +} +} +} |
