From 20e46825069b3974d5cc883163d7e37b4836b2af Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 13 Apr 2026 19:26:57 +0200 Subject: Progress? --- lib/core/c++/particle/particle.hpp | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'lib/core') 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> using ParticleGroup = Struct< Member, "mask">, - Member, - Member, "mass">, + Member,1u>, "density">, Member>, "particles"> >; } -template -saw::data>> create_spheroid_particle_group( +template +saw::data>> create_spheroid_particle_group( saw::data> rad_p, saw::data> density_p, const saw::data& mask_resolution @@ -71,23 +70,10 @@ saw::data>> 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> c; - c.at({}).set(2.0); - mass = rad_p * c * density_p; - } else if constexpr ( D == 2u){ - saw::data> pi; - pi.at({}).set(3.14159); - mass = rad_p * rad_p * pi * density_p; - } else if constexpr ( D == 3u ){ - saw::data> 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> mask_dims; for(uint64_t i = 0u; i < D; ++i){ -- cgit v1.2.3 From ebc2e26a1b3498363bb7522c241de2925bb7f627 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 14 Apr 2026 15:33:11 +0200 Subject: Fixed compilation issues with make_view for sycl --- lib/core/c++/particle/particle.hpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'lib/core') diff --git a/lib/core/c++/particle/particle.hpp b/lib/core/c++/particle/particle.hpp index e48cf08..7af43dc 100644 --- a/lib/core/c++/particle/particle.hpp +++ b/lib/core/c++/particle/particle.hpp @@ -40,9 +40,8 @@ using ParticleRigidBody = Struct< Member::Schema, "angular_acceleration"> >; -template +template::type radius = 1.0f> using ParticleCollisionSpheroid = Struct< - Member, "radius"> >; template @@ -52,7 +51,7 @@ using Particle = Struct< // Member, "mask">, >; -template> +template> using ParticleGroup = Struct< Member, "mask">, Member,1u>, "density">, @@ -60,19 +59,17 @@ using ParticleGroup = Struct< >; } -template +template::type radius> saw::data>> create_spheroid_particle_group( - saw::data> rad_p, saw::data> density_p, const saw::data& mask_resolution ){ - saw::data>> part; + saw::data>> part; auto& mask = part.template get<"mask">(); - auto& collision = part.template get<"collision">(); auto& density = part.template get<"density">().at({{0u}}); - static_assert(D == 0u or D > 3u, "Dimensions only supported for Dim 1,2 & 3."); + static_assert(D >= 1u and D <= 3u, "Dimensions only supported for Dim 1,2 & 3."); density = density_p; saw::data> mask_dims; -- cgit v1.2.3 From c61ba8f8eb86f66915a54551fcc39dfbeab1fad9 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 14 Apr 2026 21:09:42 +0200 Subject: Working on meta schema instantiation, because I'm stupid --- lib/core/c++/abstract/data.hpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'lib/core') diff --git a/lib/core/c++/abstract/data.hpp b/lib/core/c++/abstract/data.hpp index e8f1757..0075718 100644 --- a/lib/core/c++/abstract/data.hpp +++ b/lib/core/c++/abstract/data.hpp @@ -4,28 +4,48 @@ namespace kel { namespace sch { +struct Void {}; + struct UnsignedInteger {}; struct SignedInteger {}; struct FloatingPoint {}; template struct MixedPrecision { + using Meta = Void; using StorageType = StorageT; using InterfaceType = InterfaceT; }; template struct Primitive { - using PrimitiveType = PrimType; + using Meta = Void; + using Type = PrimType; static constexpr uint64_t Bytes = N; }; template -struct Array { - using InnerType = T; +struct FixedArray { + using Meta = Void; + using Inner = T; static constexpr std::array Dimensions{Dims...}; }; +template +struct Array { + using Meta = FixedArray; + using Inner = T; + static constexpr std::array Dimensions{Dims}; +}; + +template +struct Tuple { +}; } + +template +struct schema { + using Type = Sch; +}; } -- cgit v1.2.3 From d01f8faadcec62593e0af5304bcc2db3d22ed0c5 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 16 Apr 2026 16:20:23 +0200 Subject: Brain fried --- lib/core/c++/particle.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/core') diff --git a/lib/core/c++/particle.hpp b/lib/core/c++/particle.hpp index b098ecc..691a74b 100644 --- a/lib/core/c++/particle.hpp +++ b/lib/core/c++/particle.hpp @@ -11,7 +11,12 @@ struct Particle {}; template class component { +private: + saw::data> dt_; public: + component(saw::data> dt__): + dt_{dt__} + {} template void apply(const saw::data& particles, const saw::data& macros, saw::data index, saw::data time_step) const { -- cgit v1.2.3 From 45ebf7411d687ab5530431ab1bcc74edb0499c69 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 22 Apr 2026 16:48:50 +0200 Subject: Working on equalizing poiseulle_particle channel methods --- lib/core/c++/write_vtk.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/core') diff --git a/lib/core/c++/write_vtk.hpp b/lib/core/c++/write_vtk.hpp index f925361..e852172 100644 --- a/lib/core/c++/write_vtk.hpp +++ b/lib/core/c++/write_vtk.hpp @@ -136,7 +136,7 @@ struct lbm_vtk_writer> { template struct lbm_vtk_writer> { static saw::error_or apply_header(std::ostream& vtk_file, std::string_view name){ - vtk_file<<"SCALARS "<, if constexpr (sizeof...(MemberT) > 0u){ // POINT DATA { - vtk_file << "POINT_DATA " << pd_size.get() <<"\n"; + vtk_file << "\nPOINT_DATA " << pd_size.get() <<"\n"; } // HEADER TO BODY -- cgit v1.2.3