diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-02-04 16:28:48 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-02-04 16:28:48 +0100 |
| commit | ba9c23e4177ab9309f69155601578b118b2fd782 (patch) | |
| tree | 6b365d7a361eca6b15e7fd37c105724ed79f0639 /lib/core/c++/stream.hpp | |
| parent | 2ae8aaa474f888ed7a5a3810cd916977df6d0dcf (diff) | |
| download | libs-lbm-ba9c23e4177ab9309f69155601578b118b2fd782.tar.gz | |
Weird missing vtk writes
Diffstat (limited to 'lib/core/c++/stream.hpp')
| -rw-r--r-- | lib/core/c++/stream.hpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/core/c++/stream.hpp b/lib/core/c++/stream.hpp index 8c0342b..dc7cfb3 100644 --- a/lib/core/c++/stream.hpp +++ b/lib/core/c++/stream.hpp @@ -17,19 +17,44 @@ public: static constexpr saw::string_literal before = ""; template<typename CellFieldSchema> - void apply(const saw::data<CellFieldSchema, Encode>& field, const saw::data<sch::FixedArray<sch::UInt64,Descriptor::D>>& index, saw::data<sch::UInt64> time_step) const { + void apply(const saw::data<CellFieldSchema, Encode>& field, saw::data<sch::FixedArray<sch::UInt64,Descriptor::D>> index, saw::data<sch::UInt64> time_step) const { + using dfi = df_info<T,Descriptor>; + auto g_index = index; + + for(uint64_t i = 0u; i < Descriptor::D; ++i){ + ++g_index.at({{i}}); + } + bool is_even = ((time_step.get() % 2) == 0); auto& dfs_old_f = (is_even) ? field.template get<"dfs_old">() : field.template get<"dfs">(); + auto& dfs_new_f = (is_even) ? field.template get<"dfs">() : field.template get<"dfs_old">(); auto info_f = field.template get<"info">(); auto info_meta = info_f.get_dims(); + /* bool border = false; for(uint64_t i = 0u; i < Descriptor::D; ++i){ auto ind_i = index.at({i}); border |= (ind_i.get()) == 0u or (ind_i == info_meta.at({i})); } + + if (not border){ + } + */ + + auto& dfs_new = dfs_new_f.ghost_at(g_index); + + for(uint64_t i = 0u; i < Descriptor::Q; ++i){ + auto dir = dfi::directions[dfi::opposite_index[i]]; + auto g_index_nb = g_index; + for(uint64_t z = 0u; z < Descriptor::D; ++z){ + g_index_nb.at({z}).set(g_index.at({z}).get() + dir[z]); + } + + dfs_new.at({i}) = dfs_old_f.ghost_at(g_index_nb).at({i}); + } } }; } |
