diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-08-17 22:26:14 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-08-17 22:26:14 +0200 |
| commit | ade88e2eb8a4df07489ed8c3b51ca336120b0a58 (patch) | |
| tree | eecd40b0e324657c1eeb0e3cd7f53f10aa6b0db7 /modules/core/c++/descriptor | |
| parent | 118b75b951bcd1d52ca4367716e37585769eb856 (diff) | |
| parent | 5ba7e8470f29f96ea0a12a78b3d97091fe69a581 (diff) | |
| download | libs-lbm-ade88e2eb8a4df07489ed8c3b51ca336120b0a58.tar.gz | |
Merge branch 'dev'
Diffstat (limited to 'modules/core/c++/descriptor')
| -rw-r--r-- | modules/core/c++/descriptor/d2q4.hpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/modules/core/c++/descriptor/d2q4.hpp b/modules/core/c++/descriptor/d2q4.hpp new file mode 100644 index 0000000..e867bbc --- /dev/null +++ b/modules/core/c++/descriptor/d2q4.hpp @@ -0,0 +1,48 @@ +#pragma once + +#include "common.hpp" + +namespace kel { +namespace lbm { +namespace sch { +using D2Q5 = Descriptor<2u,4u>; +} + +template<typename T> +class df_info<T,sch::Descriptor<2, 4>> { +public: + using Descriptor = sch::Descriptor<2,4>; + + static constexpr uint64_t D = 2u; + static constexpr uint64_t Q = 4u; + + static constexpr std::array<std::array<int32_t, D>, Q> directions = {{ + { 0, 0}, // 0 + {-1, 0}, // 1 + { 1, 0}, // 2 + { 0,-1}, // 3 + }}; + + static constexpr std::array<typename saw::native_data_type<T>::type,Q> weights = { + 1./3., + 1./6., + 1./6., + 1./6. + }; + + /* + static constexpr std::array<uint64_t,Q> opposite_index = { + 0, + 2, + 1, + 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.; +}; + + +} +} |
