diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-05 15:59:23 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-05 15:59:23 +0200 |
| commit | c0549d71b2109f10c1238db8b22362e7826ba61b (patch) | |
| tree | 16cd5264fcc3afe912e1b1b67738c8940d6d1177 /lib/core/c++/config.hpp | |
| parent | 9a3147bc79caf3c0fb1a9cdee29d156b5ff092c7 (diff) | |
| download | libs-lbm-c0549d71b2109f10c1238db8b22362e7826ba61b.tar.gz | |
Just rename from lib to modules
Diffstat (limited to 'lib/core/c++/config.hpp')
| -rw-r--r-- | lib/core/c++/config.hpp | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/lib/core/c++/config.hpp b/lib/core/c++/config.hpp deleted file mode 100644 index 64f7a0f..0000000 --- a/lib/core/c++/config.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include <forstio/codec/data.hpp> -#include <forstio/codec/json/json.hpp> - -#include <fstream> -#include <sstream> -#include <string_view> -#include <string> - -namespace kel { -namespace lbm { -namespace sch { -using namespace saw::schema; -template<typename T, typename Desc> -using LbmConfig = Struct< - Member<T, "delta_x">, - Member<T, "kinematic_viscosity">, - Member<T, "delta_t"> ->; -} - -template<typename T, typename Desc> -saw::error_or<saw::data<sch::LbmConfig<T,Desc>>> load_lbm_config(std::string_view file_name){ - std::ifstream file{std::string{file_name}}; - - if(!file.is_open()){ - return saw::make_error<saw::err::not_found>("Couldn't open file"); - } - - saw::data<sch::LbmConfig<T,Desc>, saw::encode::Json> lbm_json_conf{saw::heap<saw::array_buffer>(1u)}; - - uint8_t ele{}; - while(file.readsome(reinterpret_cast<char*>(&ele), 1u) > 0u){ - auto err = lbm_json_conf.get_buffer().push(ele,1u); - if(err.failed()){ - return err; - } - } - - saw::data<sch::LbmConfig<T,Desc>> lbm_conf; - saw::codec<sch::LbmConfig<T,Desc>, saw::encode::Json> json_codec; - { - auto eov = json_codec.decode(lbm_json_conf, lbm_conf); - if(eov.is_error()){ - return std::move(eov.get_error()); - } - } - - return lbm_conf; -} -} -} |
