summaryrefslogtreecommitdiff
path: root/lib/core
diff options
context:
space:
mode:
Diffstat (limited to 'lib/core')
-rw-r--r--lib/core/c++/collision.hpp9
-rw-r--r--lib/core/c++/descriptor.hpp58
-rw-r--r--lib/core/tests/memory.cpp4
3 files changed, 46 insertions, 25 deletions
diff --git a/lib/core/c++/collision.hpp b/lib/core/c++/collision.hpp
index 349833f..f259c9f 100644
--- a/lib/core/c++/collision.hpp
+++ b/lib/core/c++/collision.hpp
@@ -18,12 +18,17 @@ struct BGKGuo {};
template<typename T, typename Descriptor, typename Encode>
class component<T, Descriptor, cmpt::BGK, Encode> {
private:
- typename saw::native_data_type<T>::type relaxation_;
+ saw::data<T> relaxation_;
saw::data<T> frequency_;
public:
component(typename saw::native_data_type<T>::type relaxation__):
+ relaxation_{{relaxation__}},
+ frequency_{saw::data<T>{1} / relaxation_}
+ {}
+
+ component(const saw::data<T>& relaxation__):
relaxation_{relaxation__},
- frequency_{typename saw::native_data_type<T>::type(1) / relaxation_}
+ frequency_{saw::data<T>{1} / relaxation_}
{}
using Component = cmpt::BGK;
diff --git a/lib/core/c++/descriptor.hpp b/lib/core/c++/descriptor.hpp
index e38daee..73f0cce 100644
--- a/lib/core/c++/descriptor.hpp
+++ b/lib/core/c++/descriptor.hpp
@@ -54,6 +54,22 @@ struct CellFieldStruct {
template<typename T, typename Desc>
class df_info{};
+/*
+namespace impl {
+template<typename Desc>
+struct df_ct_helper {
+ template<uint64_t i>
+ static constexpr uint64_t apply_i(const std::array<std::array<int32_t,Desc::D>,Desc::Q>& dirs, const std::array<T,Desc::D+1u>& inp){
+ if constexpr ( i < Desc::Q ){
+ for(uint64_t j = 0u; j < Desc::D; ++j){
+ }
+ }
+ return 0u;
+ }
+};
+}
+*/
+
template<typename T>
class df_info<T,sch::Descriptor<1,3>> {
public:
@@ -214,34 +230,34 @@ public:
static constexpr std::array<typename saw::native_data_type<T>::type,Q> weights = {
8./27.,
// 1D
- 2./27.,
- 2./27.,
- // 2D
- 2./27.,
- 1./9.,
1./36.,
1./36.,
+ // 2D
1./36.,
+ 1./54.,
+ 1./54.,
1./36.,
+ 1./54.,
+ 1./54.,
// 3D
- 8./27.,
- 1./9.,
- 1./9.,
- 1./9.,
- 1./9.,
- 1./36.,
- 1./36.,
1./36.,
+ 1./54.,
+ 1./54.,
+ 1./54.,
+ 1./216.,
+ 1./216.,
+ 1./54.,
+ 1./216.,
+ 1./216.,
1./36.,
- 8./27.,
- 1./9.,
- 1./9.,
- 1./9.,
- 1./9.,
- 1./36.,
- 1./36.,
- 1./36.,
- 1./36.
+ 1./54.,
+ 1./54.,
+ 1./54.,
+ 1./216.,
+ 1./216.,
+ 1./54.,
+ 1./216.,
+ 1./216.
};
static constexpr std::array<uint64_t,Q> opposite_index = {
diff --git a/lib/core/tests/memory.cpp b/lib/core/tests/memory.cpp
index cdc6f8c..d59d212 100644
--- a/lib/core/tests/memory.cpp
+++ b/lib/core/tests/memory.cpp
@@ -46,13 +46,13 @@ SAW_TEST("Memory Estimate Scalar"){
SAW_TEST("Memory Estimate Chunk"){
using namespace kel::lbm;
- SAW_EXPECT((memory_estimate<sch::TChunk>().get() == 480u), std::string{"TChunk isn't 480 bytes "} + std::to_string(memory_estimate<sch::TChunk>().get()) );
+ SAW_EXPECT((memory_estimate<sch::TChunk>().get() == 480u), std::string{"TChunk isn't 480 bytes, but is "} + std::to_string(memory_estimate<sch::TChunk>().get()) );
}
SAW_TEST("Memory Estimate Struct of Chunk"){
using namespace kel::lbm;
- SAW_EXPECT((memory_estimate<sch::TChunkStruct>().get() == 960u), std::string{"TChunk isn't 480 bytes "} + std::to_string(memory_estimate<sch::TChunk>().get()) );
+ SAW_EXPECT((memory_estimate<sch::TChunkStruct>().get() == 960u), std::string{"TChunkStruct isn't 960 bytes, but is "} + std::to_string(memory_estimate<sch::TChunk>().get()) );
}
}