From 7a7d681ce70133ef0bc47a701f5b8448b15b3a29 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 28 Jun 2026 19:17:52 +0200 Subject: Dangling --- default.nix | 5 +++++ .../poiseulle_moving_particle_2d_psm_gpu/SConscript | 2 +- .../poiseulle_moving_particle_2d_psm_gpu/sim.cpp | 2 +- lib/core/c++/particle/particle.hpp | 1 + lib/core/c++/particle/particle_opa.hpp | 20 ++++++++++++++++++-- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/default.nix b/default.nix index 29f4ba4..dc75b57 100644 --- a/default.nix +++ b/default.nix @@ -151,6 +151,11 @@ in rec { inherit pname version stdenv forstio adaptive-cpp; inherit kel; }; + + poiseulle_moving_particle_2d_psm_gpu = pkgs.callPackage ./examples/poiseulle_moving_particle_2d_psm_gpu/.nix/derivation.nix { + inherit pname version stdenv forstio adaptive-cpp; + inherit kel; + }; poiseulle_particles_2d_gpu = pkgs.callPackage ./examples/poiseulle_particles_2d_gpu/.nix/derivation.nix { inherit pname version stdenv forstio adaptive-cpp; diff --git a/examples/poiseulle_moving_particle_2d_psm_gpu/SConscript b/examples/poiseulle_moving_particle_2d_psm_gpu/SConscript index eb856b6..b062091 100644 --- a/examples/poiseulle_moving_particle_2d_psm_gpu/SConscript +++ b/examples/poiseulle_moving_particle_2d_psm_gpu/SConscript @@ -23,7 +23,7 @@ env.headers += examples_env.headers; # Cavity2D examples_objects = []; examples_env.add_source_files(examples_objects, ['sim.cpp'], shared=False); -examples_env.poiseulle_2d_gpu = examples_env.Program('#bin/poiseulle_particles_2d_psm_gpu', [examples_objects]); +examples_env.poiseulle_2d_gpu = examples_env.Program('#bin/poiseulle_moving_particle_2d_psm_gpu', [examples_objects]); # Set Alias env.examples = [ diff --git a/examples/poiseulle_moving_particle_2d_psm_gpu/sim.cpp b/examples/poiseulle_moving_particle_2d_psm_gpu/sim.cpp index 3001ba9..0c10d38 100644 --- a/examples/poiseulle_moving_particle_2d_psm_gpu/sim.cpp +++ b/examples/poiseulle_moving_particle_2d_psm_gpu/sim.cpp @@ -199,7 +199,7 @@ saw::error_or step( component,encode::Sycl> flow_in{1.0}; component,encode::Sycl> flow_out{1.0}; - component> opa; + component> opa{{},{}}; h.parallel_for(acpp::sycl::range{dim_x,dim_y}, [=](acpp::sycl::id idx){ saw::data> index; diff --git a/lib/core/c++/particle/particle.hpp b/lib/core/c++/particle/particle.hpp index 13ed37b..8e75e5a 100644 --- a/lib/core/c++/particle/particle.hpp +++ b/lib/core/c++/particle/particle.hpp @@ -8,6 +8,7 @@ #include "schema.hpp" #include "aabb.hpp" +#include "particle_opa.hpp" namespace kel { namespace lbm { diff --git a/lib/core/c++/particle/particle_opa.hpp b/lib/core/c++/particle/particle_opa.hpp index 470c4e9..4588a55 100644 --- a/lib/core/c++/particle/particle_opa.hpp +++ b/lib/core/c++/particle/particle_opa.hpp @@ -1,6 +1,7 @@ #pragma once -#include "component.hpp" +#include "common.hpp" +#include "../component.hpp" namespace kel { namespace lbm { @@ -12,8 +13,19 @@ template class component final { private: + saw::data> pos_; + saw::data> rad_; + saw::data> eps_; public: - component() = default; + component( + const saw::data> pos__, + const saw::data> rad__, + const saw::data> eps__ + ): + pos_{pos__}, + rad_{rad__}, + eps_{eps__} + {} template void apply(const saw::data& macros, const saw::data> index, saw::data time_step) const { @@ -24,6 +36,10 @@ public: auto& porous = porous_f.at(index); + auto pos_ind = saw::math::vectorize_data(index); + + auto diff = pos_ind - pos_; + auto diff_dot = saw::math::dot(diff,diff); } }; } -- cgit v1.2.3