summaryrefslogtreecommitdiff
path: root/modules/core/c++/descriptor/d2q5.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-08-07 18:15:51 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-08-07 18:15:51 +0200
commit9cc16e97489860ef1989c1bb16745a4dc0155b9f (patch)
tree60636c39dad819388e6fd814a2a9c2efac5dded1 /modules/core/c++/descriptor/d2q5.hpp
parent5d4192c73c72f29debe0f3b6e73889f0204ab74a (diff)
parent15ee0a4a9b398b86001c7a2542e8e98f9dedba70 (diff)
downloadlibs-lbm-master.tar.gz
Merge branch 'dev'HEADmaster
Diffstat (limited to 'modules/core/c++/descriptor/d2q5.hpp')
-rw-r--r--modules/core/c++/descriptor/d2q5.hpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/core/c++/descriptor/d2q5.hpp b/modules/core/c++/descriptor/d2q5.hpp
new file mode 100644
index 0000000..fef9c40
--- /dev/null
+++ b/modules/core/c++/descriptor/d2q5.hpp
@@ -0,0 +1,49 @@
+#pragma once
+
+#include "common.hpp"
+
+namespace kel {
+namespace lbm {
+namespace sch {
+using D2Q5 = Descriptor<2u,5u>;
+}
+
+template<typename T>
+class df_info<T,sch::Descriptor<2, 5>> {
+public:
+ using Descriptor = sch::Descriptor<2,5>;
+
+ static constexpr uint64_t D = 2u;
+ static constexpr uint64_t Q = 5u;
+
+ static constexpr std::array<std::array<int32_t, D>, Q> directions = {{
+ { 0, 0}, // 0
+ {-1, 0}, // 1
+ { 1, 0}, // 2
+ { 0,-1}, // 3
+ { 0, 1} // 4
+ }};
+
+ static constexpr std::array<typename saw::native_data_type<T>::type,Q> weights = {
+ 1./3.,
+ 1./6.,
+ 1./6.,
+ 1./6.,
+ 1./6.
+ };
+
+ static constexpr std::array<uint64_t,Q> opposite_index = {
+ 0,
+ 2,
+ 1,
+ 4,
+ 3
+ };
+
+ static constexpr typename saw::native_data_type<T>::type inv_cs2 = 3.0;
+ static constexpr typename saw::native_data_type<T>::type cs2 = 1./3.;
+};
+
+
+}
+}