From a97669c0e67b4068d8491a8993a12aacb717768e Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 3 Jul 2023 14:22:20 +0200 Subject: c++: Building basic blocks for a setup --- README.md | 1 + c++/descriptor.h | 31 +++++++++++++++++++++++++++++++ c++/lattice.h | 12 ++++++------ c++/lbm_unit.h | 31 +++++++++++++++++++++++++++++++ src/block.h | 10 ---------- src/descriptor.h | 6 ------ src/lbm_unit.h | 31 ------------------------------- 7 files changed, 69 insertions(+), 53 deletions(-) create mode 100644 README.md create mode 100644 c++/descriptor.h create mode 100644 c++/lbm_unit.h delete mode 100644 src/block.h delete mode 100644 src/descriptor.h delete mode 100644 src/lbm_unit.h diff --git a/README.md b/README.md new file mode 100644 index 0000000..a3bc0b2 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Lattice-Boltzmann-Method library diff --git a/c++/descriptor.h b/c++/descriptor.h new file mode 100644 index 0000000..f0f7f28 --- /dev/null +++ b/c++/descriptor.h @@ -0,0 +1,31 @@ +#pragma once + +#include + +namespace kel { +namespace lbm { +namespace schema { +using namespace saw::schema; + +template +struct Descriptor {}; + +template +using CellType = FixedArray; + +/** + * T... is restricted to Member schemas + */ +template +using CellData = Struct< + CellT... +>; + +/** + * T is an array of CellData + */ +template +using Lattice = Array; +} +} +} diff --git a/c++/lattice.h b/c++/lattice.h index eb3b4cc..86c643c 100644 --- a/c++/lattice.h +++ b/c++/lattice.h @@ -7,14 +7,14 @@ namespace lbm { namespace schema { using namespace saw::schema; -template -using Lattice = Array; +template +using Lattice = Array,D>; -template -using Lattice2D = Lattice; +template +using Lattice2D = Lattice; -template -using Lattice3D = Lattice; +template +using Lattice3D = Lattice; } } } diff --git a/c++/lbm_unit.h b/c++/lbm_unit.h new file mode 100644 index 0000000..20c6e70 --- /dev/null +++ b/c++/lbm_unit.h @@ -0,0 +1,31 @@ +#pragma once + +#include + +#include + +namespace kel { +namespace lbm_type { +struct meter { + static constexpr std::string_view name = "meter_l"; + static constexpr std::string_view short_name = "m_l"; +}; + +struct second { + static constexpr std::string_view name = "second_l"; + static constexpr std::string_view short_name = "s_l"; +}; +} + +template +using lbm_meter = unit>; + +template +using lbm_second = unit>; + +template +using lbm_velocity = unit, unit_component>; + +template +using lbm_acceleration = unit, unit_component>; +} diff --git a/src/block.h b/src/block.h deleted file mode 100644 index 0d9de22..0000000 --- a/src/block.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "descriptor.h" - -namespace kel { -template -class block; - - -} diff --git a/src/descriptor.h b/src/descriptor.h deleted file mode 100644 index 4ef41e5..0000000 --- a/src/descriptor.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -namespace kel { -template -class descriptor {}; -} diff --git a/src/lbm_unit.h b/src/lbm_unit.h deleted file mode 100644 index 20c6e70..0000000 --- a/src/lbm_unit.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include - -#include - -namespace kel { -namespace lbm_type { -struct meter { - static constexpr std::string_view name = "meter_l"; - static constexpr std::string_view short_name = "m_l"; -}; - -struct second { - static constexpr std::string_view name = "second_l"; - static constexpr std::string_view short_name = "s_l"; -}; -} - -template -using lbm_meter = unit>; - -template -using lbm_second = unit>; - -template -using lbm_velocity = unit, unit_component>; - -template -using lbm_acceleration = unit, unit_component>; -} -- cgit v1.2.3