diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-04-13 19:26:57 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-04-13 19:26:57 +0200 |
| commit | 20e46825069b3974d5cc883163d7e37b4836b2af (patch) | |
| tree | 88460b60379944dc8b877dbf50af6c0bfa7d69ca /lib/core/c++/particle/particle.hpp | |
| parent | 546ee949f384c7c666372b9c1f5c064c8a8f2e89 (diff) | |
| download | libs-lbm-20e46825069b3974d5cc883163d7e37b4836b2af.tar.gz | |
Progress?
Diffstat (limited to 'lib/core/c++/particle/particle.hpp')
| -rw-r--r-- | lib/core/c++/particle/particle.hpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/lib/core/c++/particle/particle.hpp b/lib/core/c++/particle/particle.hpp index c0d115f..e48cf08 100644 --- a/lib/core/c++/particle/particle.hpp +++ b/lib/core/c++/particle/particle.hpp @@ -55,14 +55,13 @@ using Particle = Struct< template<typename T, uint64_t D, typename CollisionType = ParticleCollisionSpheroid<T>> using ParticleGroup = Struct< Member<Array<T,D>, "mask">, - Member<CollisionType, "collision">, - Member<Scalar<T>, "mass">, + Member<FixedArray<Scalar<T>,1u>, "density">, Member<Array<Particle<T,D>>, "particles"> >; } -template<typename T, uint64_t D> -saw::data<sch::ParticleGroup<T,D, sch::ParticleCollisionSpheroid<T>>> create_spheroid_particle_group( +template<typename T, uint64_t D, T radius> +saw::data<sch::ParticleGroup<T,D, sch::ParticleCollisionSpheroid<T,radius>>> create_spheroid_particle_group( saw::data<sch::Scalar<T>> rad_p, saw::data<sch::Scalar<T>> density_p, const saw::data<sch::UInt64>& mask_resolution @@ -71,23 +70,10 @@ saw::data<sch::ParticleGroup<T,D, sch::ParticleCollisionSpheroid<T>>> create_sph auto& mask = part.template get<"mask">(); auto& collision = part.template get<"collision">(); - auto& mass = part.template get<"mass">(); + auto& density = part.template get<"density">().at({{0u}}); - if constexpr ( D == 1u ){ - saw::data<sch::Scalar<T>> c; - c.at({}).set(2.0); - mass = rad_p * c * density_p; - } else if constexpr ( D == 2u){ - saw::data<sch::Scalar<T>> pi; - pi.at({}).set(3.14159); - mass = rad_p * rad_p * pi * density_p; - } else if constexpr ( D == 3u ){ - saw::data<sch::Scalar<T>> c; - c.at({}).set(3.14159 * 4.0 / 3.0); - mass = rad_p * rad_p * rad_p * c * density_p; - } else { - static_assert(D == 0u or D > 3u, "Dimensions only supported for Dim 1,2 & 3."); - } + static_assert(D == 0u or D > 3u, "Dimensions only supported for Dim 1,2 & 3."); + density = density_p; saw::data<sch::FixedArray<sch::UInt64,D>> mask_dims; for(uint64_t i = 0u; i < D; ++i){ |
