summaryrefslogtreecommitdiff
path: root/c++
diff options
context:
space:
mode:
Diffstat (limited to 'c++')
-rw-r--r--c++/descriptor.hpp1
-rw-r--r--c++/geometry.hpp2
-rw-r--r--c++/iterator.hpp14
-rw-r--r--c++/lbm.hpp1
-rw-r--r--c++/write_vtk.hpp10
5 files changed, 23 insertions, 5 deletions
diff --git a/c++/descriptor.hpp b/c++/descriptor.hpp
index 23c82f2..0d05a04 100644
--- a/c++/descriptor.hpp
+++ b/c++/descriptor.hpp
@@ -202,6 +202,7 @@ public:
data<Sch, Encode>& operator()(const data<schema::UInt64>& index){
return inner_.at(index);
}
+
const data<Sch, Encode>& operator()(const data<schema::UInt64>& index)const{
return inner_.at(index);
}
diff --git a/c++/geometry.hpp b/c++/geometry.hpp
index fe0fe7e..9802feb 100644
--- a/c++/geometry.hpp
+++ b/c++/geometry.hpp
@@ -2,11 +2,13 @@
namespace kel {
namespace lbm {
+/*
template<typename Schema>
struct geometry {
void apply(const saw::data<Schema>& field, const saw::data<sch::FixedArray<sch::UInt64,2u>>& start, const saw::data<sch::FixedArray<sch::UInt64,2u>>& end, const saw::data<sch::UInt8>& type){
}
};
+*/
}
}
diff --git a/c++/iterator.hpp b/c++/iterator.hpp
index fcc50bc..78babff 100644
--- a/c++/iterator.hpp
+++ b/c++/iterator.hpp
@@ -14,5 +14,19 @@ void iterate_over(Func&& func, const saw::data<sch::FixedArray<sch::UInt64,2u>>&
}
return;
}
+/* Ambiguous
+template<typename Func>
+void iterate_over(Func&& func, const saw::data<sch::FixedArray<sch::UInt64,3u>>& start, const saw::data<sch::FixedArray<sch::UInt64,3u>>& end, const saw::data<sch::FixedArray<sch::UInt64,3u>>& dist = {{{0u,0u,0u}}}){
+ // static_assert(D == 2u, "Currently a lazy implementation for AND combinations of intervalls.");
+ for(saw::data<sch::UInt64> i{start.at({0u}) + dist.at({0u})}; (i+dist.at({0u})) < end.at({0u}); ++i){
+ for(saw::data<sch::UInt64> j{start.at({1u}) + dist.at({1u})}; (j+dist.at({1u})) < end.at({1u}); ++j){
+ for(saw::data<sch::UInt64> k{start.at({2u}) + dist.at({2u})}; (j+dist.at({2u})) < end.at({2u}); ++j){
+ func({{k,j,i}});
+ }
+ }
+ }
+ return;
+}
+*/
}
}
diff --git a/c++/lbm.hpp b/c++/lbm.hpp
index d331c6a..6bcd1e7 100644
--- a/c++/lbm.hpp
+++ b/c++/lbm.hpp
@@ -5,6 +5,7 @@
#include "config.hpp"
#include "component.hpp"
#include "equilibrium.hpp"
+#include "macroscopic.hpp"
#include "write_vtk.hpp"
#include <forstio/codec/unit/unit_print.hpp>
diff --git a/c++/write_vtk.hpp b/c++/write_vtk.hpp
index 5cbc6c0..40597fd 100644
--- a/c++/write_vtk.hpp
+++ b/c++/write_vtk.hpp
@@ -62,13 +62,13 @@ struct lbm_vtk_writer<sch::Array<sch::Struct<sch::Member<StructT,StructN>...> ,
constexpr auto Lit = saw::parameter_key_pack_type<i, StructN...>::literal;
using Type = typename saw::parameter_pack_type<i,StructT...>::type;
- if constexpr (Dep == Dim){
+ if constexpr (Dep == 0u){
return lbm_vtk_writer<Type>::apply(vtk_file, field.at(index).template get<Lit>());
} else {
// Dep < Dim // I hope
- static_assert(Dep < Dim, "Don't fall into this case");
- for(index.at({Dep}) = 0; index.at({Dep}) < field.get_dims().at({Dep}); ++index.at({Dep})){
- auto eov = write_i_iterate_d<i,Dep+1>(vtk_file, field, index);
+ static_assert(Dep > 0u, "Don't fall into this case");
+ for(index.at({Dep-1u}) = 0; index.at({Dep-1u}) < field.get_dims().at({Dep-1u}); ++index.at({Dep-1u})){
+ auto eov = write_i_iterate_d<i,Dep-1u>(vtk_file, field, index);
if(eov.is_error()){
return eov;
}
@@ -95,7 +95,7 @@ struct lbm_vtk_writer<sch::Array<sch::Struct<sch::Member<StructT,StructN>...> ,
}
}
- return write_i_iterate_d<i,0u>(vtk_file, field, index);
+ return write_i_iterate_d<i,Dim>(vtk_file, field, index);
}
template<uint64_t i>