summaryrefslogtreecommitdiff
path: root/lib/core/c++
diff options
context:
space:
mode:
Diffstat (limited to 'lib/core/c++')
-rw-r--r--lib/core/c++/chunk.hpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/core/c++/chunk.hpp b/lib/core/c++/chunk.hpp
index 38b567b..223ceec 100644
--- a/lib/core/c++/chunk.hpp
+++ b/lib/core/c++/chunk.hpp
@@ -6,23 +6,29 @@ namespace kel {
namespace lbm {
namespace sch {
namespace impl {
-template<typename Sch, uint64_t Dim, uint64_t Side, typename... AddedSides>
+template<typename Sch, uint64_t Ghost, typename LeftG, typename RightG>
struct chunk_schema_type_helper {
- using Schema = typename chunk_schema_type_helper<Sch,Dim-1u,Side,AddedSides...,Side>::Schema;
+ using Schema = typename chunk_schema_type_helper<Sch,Ghost,LeftG,RightG>::Schema;
};
-template<typename Sch, uint64_t Side, typename... AddedSides>
-struct chunk_schema_type_helper<Sch, 0u, Side, AddedSides...> {
+template<typename Sch, uint64_t Ghost, typename Side0, typename... Sides, typename... AddedSides>
+struct chunk_schema_type_helper<Sch, Ghost, saw::tmpl_group<Side0,Sides...>, saw::tmpl_group<AddedSides...>> final {
+ using Schema = FixedArray<Sch,AddedSides...>;
+};
+
+template<typename Sch, uint64_t Ghost, uint64_t... AddedSides>
+struct chunk_schema_type_helper<Sch, Ghost, saw::tmpl_group<Side0,Sides...>, saw::tmpl_group<AddedSides...>> final {
using Schema = FixedArray<Sch,AddedSides...>;
};
}
-template<typename Schema, uint64_t Dim, uint64_t Side, uint64_t Ghost = 0u>
+template<typename Schema, uint64_t Ghost, uint64_t... Side>
struct Chunk {
- using InnerSchema = typename impl::chunk_schema_type_helper<Sch, Dim, Side + (2u*Ghost)>::Schema;
+ using InnerSchema = typename impl::chunk_schema_type_helper<Sch, Ghost, Side...>::Schema;
};
+// Not needed for now
template<typename ChunkSchema, uint64_t Dim>
using SuperChunk = Array<ChunkSchema,Dim>;
}
@@ -35,7 +41,7 @@ class data<kel::lbm::sch::Chunk<Sch,Dim,Side,Ghost>,Encode> final {
public:
using Schema = kel::lbm::sch::Chunk<Sch,Dim,Side,Ghost>;
private:
- data<Schema::InnerSchema, Encode>
+ data<typename Schema::InnerSchema, Encode> values_;
public:
};
}