diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-04-18 16:25:30 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-04-18 16:25:30 +0200 |
commit | ae8711ba90ac2a47ea7654dc873927fb2783ff91 (patch) | |
tree | 04f15d1223fec76a02f1c5261256ce4bdd71eeab /examples | |
parent | 80f35c35295eb07f2b9b61d1fb1bd01c37717caa (diff) |
wip rendering in terminal and extracting example code to files
Diffstat (limited to 'examples')
-rw-r--r-- | examples/cavity_2d.cpp | 26 | ||||
-rw-r--r-- | examples/poiseulle_2d.cpp | 8 |
2 files changed, 9 insertions, 25 deletions
diff --git a/examples/cavity_2d.cpp b/examples/cavity_2d.cpp index 3e2e064..5085635 100644 --- a/examples/cavity_2d.cpp +++ b/examples/cavity_2d.cpp @@ -1,4 +1,5 @@ #include "../c++/descriptor.hpp" +#include "../c++/macroscopic.hpp" /** */ @@ -47,31 +48,6 @@ using CavityFieldD2Q9 = CellField<D2Q9, CellStruct<D2Q9>>; } /** - * Calculate the macroscopic variables rho and u in Lattice Units. - */ -template<typename Desc> -void compute_rho_u ( - saw::data<sch::DfCell<Desc>>& dfs, - typename saw::native_data_type<sch::T>::type& rho, - std::array<typename saw::native_data_type<sch::T>::type, 2>& vel - ) -{ - using dfi = df_info<sch::T, Desc>; - - rho = 0; - std::fill(vel.begin(), vel.end(), 0); - - for(size_t i = 0; i < Desc::Q; ++i){ - rho += dfs(i).get(); - vel[0] += dfi::directions[i][0] * dfs(i).get(); - vel[1] += dfi::directions[i][1] * dfs(i).get(); - } - - vel[0] /= rho; - vel[1] /= rho; -} - -/** * Unsure if feasible. I would have a rho normalization on the dfs and then I would use the const rho_computation */ template<typename Desc> diff --git a/examples/poiseulle_2d.cpp b/examples/poiseulle_2d.cpp new file mode 100644 index 0000000..be3efbc --- /dev/null +++ b/examples/poiseulle_2d.cpp @@ -0,0 +1,8 @@ +#include "../c++/descriptor.hpp" + +#include <forstio/codec/data.hpp> + +int main(int argc, char** argv){ + + return 0; +} |