summaryrefslogtreecommitdiff
path: root/lib/c++/macroscopic.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-11-05 13:38:04 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-11-05 13:38:04 +0100
commitb9aacd9c2fdc61721c8ca3e1b40ebc92daa3772e (patch)
treebec510bca7b72b8fe63b7f8cec1fd78b7ff03bc2 /lib/c++/macroscopic.hpp
parentf5c40005f576b5a3416c2cda8c60e5f100810ddb (diff)
downloadlibs-lbm-b9aacd9c2fdc61721c8ca3e1b40ebc92daa3772e.tar.gz
Reworking structure
Diffstat (limited to 'lib/c++/macroscopic.hpp')
-rw-r--r--lib/c++/macroscopic.hpp92
1 files changed, 0 insertions, 92 deletions
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<typename T, typename Desc>
-void compute_rho_u (
- const saw::data<sch::Cell<T, Desc, 0, 0, 1>>& dfs,
- typename saw::native_data_type<T>::type& rho,
- std::array<typename saw::native_data_type<T>::type, 2>& vel
- )
-{
- using dfi = df_info<T, Desc>;
-
- 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<typename T, typename Desc>
-void compute_rho_u (
- const saw::data<sch::Cell<T, Desc, 0, 0, 1>>& dfs,
- saw::ref<saw::data<T>> rho,
- saw::ref<saw::data<sch::FixedArray<T,Desc::D>>> vel
- )
-{
- using dfi = df_info<T, Desc>;
-
- 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<T>{static_cast<typename saw::native_data_type<T>::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<typename T, typename Desc>
-void compute_rho_u (
- const saw::data<sch::Cell<T, Desc, 0, 0, 1>>& dfs,
- saw::ref<saw::data<T>> rho,
- saw::ref<saw::data<sch::Vector<T,Desc::D>>> vel
- )
-{
- using dfi = df_info<T, Desc>;
-
- 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<T>{static_cast<typename saw::native_data_type<T>::type>(dfi::directions[j][i])} * dfs(j);
- }
- }
-
- for(size_t i = 0; i < Desc::D; ++i){
- vel().at({{i}}) = vel().at({{i}}) / rho();
- }
-}
-}
-}