From a77c3a2301cdc6ea220c3bac18b771fd42800687 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 7 May 2025 13:39:51 +0200 Subject: Stack smashing probably due to UB fixed --- c++/write_vtk.hpp | 10 ++++++++++ tests/particles.cpp | 8 ++++++++ tests/vtk_write.cpp | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/c++/write_vtk.hpp b/c++/write_vtk.hpp index fec4ea5..294ec6d 100644 --- a/c++/write_vtk.hpp +++ b/c++/write_vtk.hpp @@ -31,6 +31,14 @@ struct lbm_vtk_writer> { } }; +template +struct lbm_vtk_writer> { + static saw::error_or apply(std::ostream& vtk_file, std::string_view name){ + vtk_file<<"VECTORS "< struct lbm_vtk_writer...>>> { template @@ -38,6 +46,7 @@ struct lbm_vtk_writer @@ -87,6 +96,7 @@ struct lbm_vtk_writer pd_size{1u}; // DIMENSIONS + { vtk_file << "DIMENSIONS "; for(saw::data i{0u}; i.get() < Desc::D; ++i){ diff --git a/tests/particles.cpp b/tests/particles.cpp index 6332195..873b8ad 100644 --- a/tests/particles.cpp +++ b/tests/particles.cpp @@ -31,4 +31,12 @@ SAW_TEST("Minor Test for mask"){ //saw::data> reference_mask{{{4+2,4+2}}}; //reference_mask.at({{0,0}}); } + +SAW_TEST("Verlet integration test"){ + using namespace kel; + lbm::particle_system> system; + + // system.step(); + +} } diff --git a/tests/vtk_write.cpp b/tests/vtk_write.cpp index 0fcc169..5d61580 100644 --- a/tests/vtk_write.cpp +++ b/tests/vtk_write.cpp @@ -38,7 +38,7 @@ SAW_TEST("VTK Write test example"){ std::stringstream sstream; - saw::data>> cells; + saw::data>> cells{{{2u,2u}}}; auto eov = lbm::impl::lbm_vtk_writer>>::apply(sstream, cells); SAW_EXPECT(eov.is_value(), "vtk writer failed to write"); -- cgit v1.2.3