summaryrefslogtreecommitdiff
path: root/examples/cavity_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cavity_2d.cpp')
-rw-r--r--examples/cavity_2d.cpp26
1 files changed, 1 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>