From b5d8593b9a2f0f58cb228444dcd09a2c5002e039 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 21 May 2026 15:00:09 +0200 Subject: Prep for proper com in circle group --- lib/core/c++/math/n_linear.hpp | 3 +++ lib/core/c++/particle/particle.hpp | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/core/c++/math/n_linear.hpp b/lib/core/c++/math/n_linear.hpp index 8fb0600..b378440 100644 --- a/lib/core/c++/math/n_linear.hpp +++ b/lib/core/c++/math/n_linear.hpp @@ -122,6 +122,9 @@ auto n_linear_interpolate( } }, {}, ones_ind); + + /// TODO I need to actually calc stuff + return field.at({}); } template diff --git a/lib/core/c++/particle/particle.hpp b/lib/core/c++/particle/particle.hpp index 01429b2..5110893 100644 --- a/lib/core/c++/particle/particle.hpp +++ b/lib/core/c++/particle/particle.hpp @@ -55,6 +55,8 @@ template, "mask">, Member,1u>, "density">, + Member, "center_of_mass">, + Member, "total_mass">, Member>, "particles"> >; } @@ -76,10 +78,20 @@ saw::data>> cre for(uint64_t i = 0u; i < D; ++i){ mask_dims.at({i}) = mask_resolution; } + saw::data> mask_step; + saw::data dia_d{radius*2}; + mask_step.at({}) = dia_d / mask_resolution.template cast_to(); mask = {mask_dims}; + + auto& com = part.template get<"center_of_mass">(); + for(uint64_t i = 0u; i < D; ++i){ + com.at({{i}}) = {}; + } + saw::data ele_ctr{0u}; iterator::apply([&](const auto& index){ - + ++ele_ctr; + },{},mask_dims); return part; -- cgit v1.2.3