From b9aacd9c2fdc61721c8ca3e1b40ebc92daa3772e Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 5 Nov 2025 13:38:04 +0100 Subject: Reworking structure --- lib/c++/macroscopic.hpp | 92 ------------------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 lib/c++/macroscopic.hpp (limited to 'lib/c++/macroscopic.hpp') diff --git a/lib/c++/macroscopic.hpp b/lib/c++/macroscopic.hpp deleted file mode 100644 index 51368e9..0000000 --- a/lib/c++/macroscopic.hpp +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once - -#include "descriptor.hpp" - -namespace kel { -namespace lbm { -/** - * Calculate the macroscopic variables rho and u in Lattice Units. - */ -template -void compute_rho_u ( - const saw::data>& dfs, - typename saw::native_data_type::type& rho, - std::array::type, 2>& vel - ) -{ - using dfi = df_info; - - rho = 0; - std::fill(vel.begin(), vel.end(), 0); - - for(size_t j = 0; j < Desc::Q; ++j){ - rho += dfs(j).get(); - for(size_t i = 0; i < Desc::D; ++i){ - vel[i] += dfi::directions[j][i] * dfs(j).get(); - } - } - - for(size_t i = 0; i < Desc::D; ++i){ - vel[i] /= rho; - } -} - -/** - * Calculate the macroscopic variables rho and u in Lattice Units. - */ -template -void compute_rho_u ( - const saw::data>& dfs, - saw::ref> rho, - saw::ref>> vel - ) -{ - using dfi = df_info; - - rho().set(0); - for(uint64_t i = 0; i < Desc::D; ++i){ - vel().at({i}).set(0); - } - - for(size_t j = 0; j < Desc::Q; ++j){ - rho() = rho() + dfs(j); - for(size_t i = 0; i < Desc::D; ++i){ - vel().at({i}) = vel().at({i}) + saw::data{static_cast::type>(dfi::directions[j][i])} * dfs(j); - } - } - - for(size_t i = 0; i < Desc::D; ++i){ - vel().at({i}) = vel().at({i}) / rho(); - } -} - -/** - * Calculate the macroscopic variables rho and u in Lattice Units. - */ -template -void compute_rho_u ( - const saw::data>& dfs, - saw::ref> rho, - saw::ref>> vel - ) -{ - using dfi = df_info; - - rho().set(0); - for(uint64_t i = 0; i < Desc::D; ++i){ - vel().at({{i}}).set(0); - } - - for(size_t j = 0; j < Desc::Q; ++j){ - rho() = rho() + dfs(j); - for(size_t i = 0; i < Desc::D; ++i){ - vel().at({{i}}) = vel().at({{i}}) + saw::data{static_cast::type>(dfi::directions[j][i])} * dfs(j); - } - } - - for(size_t i = 0; i < Desc::D; ++i){ - vel().at({{i}}) = vel().at({{i}}) / rho(); - } -} -} -} -- cgit v1.2.3