summaryrefslogtreecommitdiff
path: root/c++
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-08-08 22:00:04 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-08-08 22:00:04 +0200
commit939d110fdfc1ad5b075756dcd537b3635239260e (patch)
tree32afb7015e1192f47b82b614138b8fa1a571ef5f /c++
parent7a330f62088f391a6bee12bd703ff10bc11daea2 (diff)
Point where code works. Kinda
Diffstat (limited to 'c++')
-rw-r--r--c++/lbm.hpp2
-rw-r--r--c++/particle/particle.hpp11
-rw-r--r--c++/write_vtk.hpp2
3 files changed, 8 insertions, 7 deletions
diff --git a/c++/lbm.hpp b/c++/lbm.hpp
index a874e95..36609bf 100644
--- a/c++/lbm.hpp
+++ b/c++/lbm.hpp
@@ -23,7 +23,7 @@ void print_lbm_meta(const converter<T>& conv, const saw::data<sch::SiKinematicVi
<<"Δx: "<<conv.delta_x()<<"\n"
<<"Δt: "<<conv.delta_t()<<"\n"
<<"KinVis: "<<kin_vis_si<<"\n"
- <<"τ: "<<(saw::data<typename saw::unit_division<sch::Scalar<T>, sch::LbmKinematicViscosity<T>>::Schema >{df_info<T,Desc>::inv_cs2} * conv.kinematic_viscosity_si_to_lbm(kin_vis_si) + saw::data<sch::Scalar<T>>{0.5})<<"\n"
+ <<"τ: "<<(saw::data<typename saw::unit_division<sch::Pure<T>, sch::LbmKinematicViscosity<T>>::Schema >{df_info<T,Desc>::inv_cs2} * conv.kinematic_viscosity_si_to_lbm(kin_vis_si) + saw::data<sch::Pure<T>>{0.5})<<"\n"
;
}
}
diff --git a/c++/particle/particle.hpp b/c++/particle/particle.hpp
index 3860966..a55b06e 100644
--- a/c++/particle/particle.hpp
+++ b/c++/particle/particle.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <forstio/codec/data.hpp>
+#include <forstio/codec/data_math.hpp>
namespace kel {
namespace lbm {
@@ -9,12 +10,12 @@ using namespace saw::schema;
template<typename T, uint64_t D>
using ParticleRigidBody = Struct<
- Member<FixedArray<T,D>, "position">,
- Member<FixedArray<T,D>, "position_old">,
+ Member<Vector<T,D>, "position">,
+ Member<Vector<T,D>, "position_old">,
Member<T, "rotation">,
Member<T, "rotation_old">,
- Member<FixedArray<T,D>, "acceleration">,
+ Member<Vector<T,D>, "acceleration">,
Member<T, "rotational_acceleration">
>;
@@ -47,10 +48,10 @@ private:
auto tsd_squared = time_step_delta * time_step_delta;
- saw::data<sch::FixedArray<T,D>> pos_new;
+ saw::data<sch::Vector<T,D>> pos_new;
// Actual step
for(uint64_t i = 0u; i < D; ++i){
- pos_new.at({i}) = saw::data<T>{2.0} * pos.at({i}) - pos_old.at({i}) + acc.at({i}) * tsd_squared;
+ pos_new.at({{i}}) = saw::data<T>{2.0} * pos.at({{i}}) - pos_old.at({{i}}) + acc.at({{i}}) * tsd_squared;
}
pos_old = pos;
diff --git a/c++/write_vtk.hpp b/c++/write_vtk.hpp
index f81136a..55d4401 100644
--- a/c++/write_vtk.hpp
+++ b/c++/write_vtk.hpp
@@ -101,7 +101,7 @@ struct lbm_vtk_writer<sch::Array<sch::Struct<sch::Member<StructT,StructN>...> ,
template<uint64_t i>
static saw::error_or<void> iterate_i(std::ostream& vtk_file, const saw::data<sch::Array<sch::Struct<sch::Member<StructT,StructN>...>, Dim>>& field){
- constexpr auto Lit = saw::parameter_key_pack_type<i, StructN...>::literal;
+ // constexpr auto Lit = saw::parameter_key_pack_type<i, StructN...>::literal;
{
auto eov = write_i<i>(vtk_file, field);
if(eov.is_error()){