diff options
Diffstat (limited to 'c++')
-rw-r--r-- | c++/converter.hpp | 9 | ||||
-rw-r--r-- | c++/lbm.hpp | 23 |
2 files changed, 32 insertions, 0 deletions
diff --git a/c++/converter.hpp b/c++/converter.hpp index 67058aa..2ad5185 100644 --- a/c++/converter.hpp +++ b/c++/converter.hpp @@ -20,6 +20,14 @@ public: second_conv_{second_conv__} {} + auto delta_x() const { + return meter_conv_*saw::data<sch::LbmMeter<T>>{1.0}; + } + + auto delta_t() const { + return second_conv_*saw::data<sch::LbmSecond<T>>{1.0}; + } + saw::data<sch::LbmMeter<T>> meter_si_to_lbm(const saw::data<sch::SiMeter<T>>& m_si) const { return m_si / meter_conv_; } @@ -40,5 +48,6 @@ public: return kin_si * second_conv_ / (meter_conv_ * meter_conv_); } }; + } } diff --git a/c++/lbm.hpp b/c++/lbm.hpp new file mode 100644 index 0000000..ddfa948 --- /dev/null +++ b/c++/lbm.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include "descriptor.hpp" +#include "converter.hpp" + +#include <forstio/codec/unit/unit_print.hpp> +#include <iostream> + +namespace kel { +namespace lbm { +template<typename T> +void print_lbm_meta(const converter<T>& conv){ + std::cout + <<"[LBM Meta]\n" + <<"==========\n" + <<"\n" + <<"Δx: "<<conv.delta_x()<<"\n" + <<"Δt: "<<conv.delta_t()<<"\n" + <<"" + ; +} +} +} |