diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/config.json | 5 | ||||
-rw-r--r-- | examples/meta_2d.cpp | 19 |
2 files changed, 23 insertions, 1 deletions
diff --git a/examples/config.json b/examples/config.json new file mode 100644 index 0000000..dcd7f91 --- /dev/null +++ b/examples/config.json @@ -0,0 +1,5 @@ +{ + "delta_x" : 0.1, + "delta_t" : 0.1, + "kinematic_viscosity" : 1e-3 +} diff --git a/examples/meta_2d.cpp b/examples/meta_2d.cpp index 5aa39f4..a66f0e9 100644 --- a/examples/meta_2d.cpp +++ b/examples/meta_2d.cpp @@ -1,14 +1,31 @@ #include "../c++/lbm.hpp" +#include <iostream> + int main(int argc, char** argv){ using namespace kel::lbm; + + auto eo_conf = load_lbm_config<sch::Float64,sch::Descriptor<2,9>>("config.json"); + if(eo_conf.is_error()){ + auto& err = eo_conf.get_error(); + std::cerr<<"[Error]: "<<err.get_category(); + auto err_msg = err.get_message(); + if(!err_msg.empty()){ + std::cerr<<" - "<<err_msg; + } + std::cerr<<std::endl; + + return err.get_id(); + } + + auto& conf = eo_conf.get_value(); converter<sch::Float64> conv{ {0.1}, {0.1} }; - print_lbm_meta<sch::Float64,sch::Descriptor<2,9>>(conv, {1e-5}); + print_lbm_meta<sch::Float64,sch::Descriptor<2,9>>(conv, {conf.template get<"kinematic_viscosity">()}); return 0; } |