summaryrefslogtreecommitdiff
path: root/c++/examples
diff options
context:
space:
mode:
Diffstat (limited to 'c++/examples')
-rw-r--r--c++/examples/cavity_2d.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/c++/examples/cavity_2d.cpp b/c++/examples/cavity_2d.cpp
index 6caaa11..afa6a91 100644
--- a/c++/examples/cavity_2d.cpp
+++ b/c++/examples/cavity_2d.cpp
@@ -28,10 +28,23 @@ using Cell = CellData<
}
+template<typename Func, typename Schema, size_t Dim>
+void apply_for_cells(Func&& func, saw::data<schema::Array<Schema, Dim>, saw::encode::Native>& dat ){
+ for(std::size_t i = 0; i < dat.get_dim_size(0); ++i){
+ for(std::size_t j = 0; j < data.get_dim_size(1); ++j){
+ func(data.at(i,j), i, j);
+ }
+ }
+}
+
int main(){
using namespace kel::lbm;
saw::data<schema::Lattice<schema::Cell,2>>, saw::encode::Native> lattice{512, 512};
+ apply_for_cells([](auto& cell, std::size_t i, std::size_t j){
+
+ }, lattice);
+
return 0;
}