diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-03-24 17:41:28 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-03-24 17:41:28 +0100 |
| commit | 3af0e20773b21b519ea474e34e7c1df73d04a307 (patch) | |
| tree | 45d1e7842b2f9866053824e9fb6ddf088723e973 | |
| parent | 72e61f9d345c43a6106e68c207bb0d2e11237adb (diff) | |
| download | libs-lbm-3af0e20773b21b519ea474e34e7c1df73d04a307.tar.gz | |
Dangling changesdev
| -rw-r--r-- | examples/settling_cubes_2d_ibm_gpu/sim.cpp | 7 | ||||
| -rw-r--r-- | lib/core/c++/collision.hpp | 15 | ||||
| -rw-r--r-- | lib/core/c++/particle/particle.hpp | 5 |
3 files changed, 24 insertions, 3 deletions
diff --git a/examples/settling_cubes_2d_ibm_gpu/sim.cpp b/examples/settling_cubes_2d_ibm_gpu/sim.cpp index 4501a54..05a4a09 100644 --- a/examples/settling_cubes_2d_ibm_gpu/sim.cpp +++ b/examples/settling_cubes_2d_ibm_gpu/sim.cpp @@ -103,6 +103,11 @@ saw::error_or<void> setup_initial_conditions( } template<typename T, typename Desc> +void add_particles(saw::data<sch::Array<sch::Particle<T,Desc::D>>>& particles){ + ////// TODO +} + +template<typename T, typename Desc> saw::error_or<void> step( saw::data<sch::Ptr<sch::ChunkStruct<T,Desc>>,encode::Sycl<saw::encode::Native>>& fields, saw::data<sch::Ptr<sch::MacroStruct<T,Desc>>,encode::Sycl<saw::encode::Native>>& macros, @@ -148,6 +153,8 @@ saw::error_or<void> step( break; } }); + + }).wait(); diff --git a/lib/core/c++/collision.hpp b/lib/core/c++/collision.hpp index f8312c0..df45bbe 100644 --- a/lib/core/c++/collision.hpp +++ b/lib/core/c++/collision.hpp @@ -95,10 +95,21 @@ class component<T, Descriptor, cmpt::BGKGuo, Encode> { private: typename saw::native_data_type<T>::type relaxation_; saw::data<T> frequency_; + saw::data<sch::Vector<T,Descriptor::D>> global_force_; public: component(typename saw::native_data_type<T>::type relaxation__): relaxation_{relaxation__}, - frequency_{typename saw::native_data_type<T>::type(1) / relaxation_} + frequency_{typename saw::native_data_type<T>::type(1) / relaxation_}, + global_force_{} + {} + + component( + typename saw::native_data_type<T>::type relaxation__, + saw::data<sch::Vector<T,Descriptor::D>>& global_force__ + ): + relaxation_{relaxation__}, + frequency_{typename saw::native_data_type<T>::type(1) / relaxation_}, + global_force_{global_force__} {} using Component = cmpt::BGKGuo; @@ -153,7 +164,7 @@ public: saw::data<sch::Scalar<T>> w; w.at({}).set(dfi::weights[i]); - auto F_i_d = saw::math::dot(force * w, (ci - vel * dfi_inv_cs2 + ci * ci_dot_u * dfi_inv_cs2 * dfi_inv_cs2 )); + auto F_i_d = saw::math::dot((force+global_force_) * w, (ci - vel * dfi_inv_cs2 + ci * ci_dot_u * dfi_inv_cs2 * dfi_inv_cs2 )); /* saw::data<sch::Scalar<T>> F_i_sum; for(uint64_t d = 0u; d < Descriptor::D; ++d){ diff --git a/lib/core/c++/particle/particle.hpp b/lib/core/c++/particle/particle.hpp index 8ef590d..f8104fd 100644 --- a/lib/core/c++/particle/particle.hpp +++ b/lib/core/c++/particle/particle.hpp @@ -43,12 +43,15 @@ using ParticleCollisionSpheroid = Struct< Member<Scalar<T>, "radius"> >; +tem + template<typename T, uint64_t D, typename CollisionType = ParticleCollisionSpheroid<T>> using Particle = Struct< Member<ParticleRigidBody<T,D>, "rigid_body">, Member<CollisionType, "collision">, // Problem is that dynamic data would two layered - // Member<FixedArray<Float64,D,D,D>, "mask">, + // Member<Array<Float64,D>, "mask">, + Member<UInt64, "mask_id">, Member<Scalar<T>, "mass"> >; } |
