From 960a3ef31095af11c7c764a1bcdcb4b424c529b8 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 26 May 2026 22:24:09 +0200 Subject: Dangling changes. Fixed compilation issues which hurt my brain --- lib/core/c++/particle/particle.hpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/core/c++/particle/particle.hpp b/lib/core/c++/particle/particle.hpp index 7249e6a..5449b88 100644 --- a/lib/core/c++/particle/particle.hpp +++ b/lib/core/c++/particle/particle.hpp @@ -55,8 +55,8 @@ template, "mask">, Member,1u>, "density">, - Member, "center_of_mass">, - Member, "total_mass">, + Member,1u>, "center_of_mass">, + Member,1u>, "total_mass">, Member>, "particles"> >; } @@ -71,7 +71,7 @@ saw::data>> cre auto& mask = part.template get<"mask">(); auto& density = part.template get<"density">().at({{0u}}); - auto& total_mass = part.template get<"total_mass">(); + auto& total_mass = part.template get<"total_mass">().at({{0u}}); // Paranoia total_mass.at({}) = {}; @@ -89,7 +89,7 @@ saw::data>> cre mask = {mask_dims}; - auto& com = part.template get<"center_of_mass">(); + auto& com = part.template get<"center_of_mass">().at({{0u}}); // Paranoia for(uint64_t i = 0u; i < D; ++i){ com.at({{i}}) = {}; @@ -115,13 +115,16 @@ saw::data>> cre auto& dpi = mask.at(index); for(uint64_t i = 0u; i < D; ++i){ - com.at({{i}}) = com.at({{i}}) + index.at({i}).template cast_to() * dpi.at({}); + com.at({{i}}) = com.at({{i}}) + index.at({i}).template cast_to() * dpi; } - total_mass = total_mass + dpi; + total_mass.at({}) = total_mass.at({}) + dpi; },{},mask_dims); + for(uint64_t i = 0u; i < D; ++i){ + com.at({{i}}) = com.at({{i}}) / total_mass.at({}); + } return part; } -- cgit v1.2.3