diff options
Diffstat (limited to 'lib/core')
| -rw-r--r-- | lib/core/c++/boundary.hpp | 30 | ||||
| -rw-r--r-- | lib/core/c++/grid.hpp | 34 |
2 files changed, 63 insertions, 1 deletions
diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp index d5f3022..9afdfd7 100644 --- a/lib/core/c++/boundary.hpp +++ b/lib/core/c++/boundary.hpp @@ -14,7 +14,10 @@ struct ZouHeHorizontal{}; struct Equilibrium {}; template<bool North> -struct ZouHeVertical{}; +struct ZouHePressureY{}; + +template<bool East> +struct ZouHeVelocityX {}; } /** @@ -167,5 +170,30 @@ public: } } }; + +/* +template<typename FP, typename Descriptor, bool East, typename Encode> +class component<FP, Descriptor, cmpt::ZouHeVelocityX<East>, Encode> final { +private: + saw::data<sch::Vector<FP,Descriptor::D>> velocity_; +public: + component( + saw::data<sch::Vector<FP,Descriptor::D>> velocity__ + ): + velocity_{velocity__} + {} + + template<typename CellFieldSchema> + void apply(const saw::data<CellFieldSchema, Encode>& field, const saw::data<sch::FixedArray<sch::UInt64,Descriptor::D>>& index, saw::data<sch::UInt64> time_step) const { + + bool is_even = ((time_step.get() % 2u) == 0u); + using dfi = df_info<FP,Descriptor>; + + auto& dfs_old_f = (is_even) ? field.template get<"dfs_old">() : field.template get<"dfs">(); + + } +}; +*/ + } } diff --git a/lib/core/c++/grid.hpp b/lib/core/c++/grid.hpp new file mode 100644 index 0000000..be86e18 --- /dev/null +++ b/lib/core/c++/grid.hpp @@ -0,0 +1,34 @@ +#pragma once + +#include "common.hpp" + +namespace kel { +namespace lbm { + +/** + * I'm mixing up the geometry values regarding inflow etc. And a bit of logic + */ +template<typename InfoSchema> +class domain_registry final { +private: + saw::data<sch::Array<InfoSchema>> infos_; +public: + template<typename T> + saw::data<InfoSchema> get_template_id() { + static saw::data<InfoSchema> id{std::numeric_limits<typename saw::native_data_type<InfoSchema>::type>::max()}; + + if( id == std::numeric_limits<typename saw::native_data_type<InfoSchema>::type>::max() ){ + auto err_or_id = search_or_register_id(T::name); + if(err_or_id.is_error()){ + // Unsure about recovery from this + exit(-1); + } + } + } +}; + +void clean_grid(saw::data<Schema>& info_field){ + +} +} +} |
