summaryrefslogtreecommitdiff
path: root/c++/equilibrium.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-04-18 16:25:30 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-04-18 16:25:30 +0200
commitae8711ba90ac2a47ea7654dc873927fb2783ff91 (patch)
tree04f15d1223fec76a02f1c5261256ce4bdd71eeab /c++/equilibrium.hpp
parent80f35c35295eb07f2b9b61d1fb1bd01c37717caa (diff)
wip rendering in terminal and extracting example code to files
Diffstat (limited to 'c++/equilibrium.hpp')
-rw-r--r--c++/equilibrium.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/c++/equilibrium.hpp b/c++/equilibrium.hpp
index ac36dbc..bb55d00 100644
--- a/c++/equilibrium.hpp
+++ b/c++/equilibrium.hpp
@@ -13,14 +13,20 @@ saw::data<sch::FixedArray<T, Descriptor::Q>> equilibrium(saw::data<T> rho, saw::
// 0.0
// / \
// | |
+ //
+ // Velocity * Velocity meaning || vel ||_2^2 or <vel,vel>_2
saw::data<T> vel_vel{0.0};
for(uint64_t j = 0u; j < Descriptor::D; ++j){
vel_vel = vel_vel + vel.at(j) * vel.at(j);
}
+ /**
+ * Calculate equilibrium
+ */
for(uint64_t i = 0u; i < eq.template get_dim_size<0u>(); ++i){
saw::data<T> vel_c{};
for(uint64_t j = 0u; j < Descriptor::D; ++j){
+ // <vel,c_i>_2
vel_c = vel_c + (vel.at(j) * saw::data<T>{static_cast<saw::native_data_type<T>::type>(dfi::directions[i][j])});
}