diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-12-19 14:11:57 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-12-19 14:11:57 +0100 |
| commit | 6a918f0827a6e8806f77e39e0348b1a2abed71f2 (patch) | |
| tree | 30e70bf0533e91a4aa9246de1dd3aa256c64d0c1 /lib/core/tests/vtk_write.cpp | |
| parent | 434607c33deab6ad91cfeb203050138c108958ed (diff) | |
| download | libs-lbm-6a918f0827a6e8806f77e39e0348b1a2abed71f2.tar.gz | |
Rewriting large portion for simpler approach
Diffstat (limited to 'lib/core/tests/vtk_write.cpp')
| -rw-r--r-- | lib/core/tests/vtk_write.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/core/tests/vtk_write.cpp b/lib/core/tests/vtk_write.cpp index 0df9998..231fd37 100644 --- a/lib/core/tests/vtk_write.cpp +++ b/lib/core/tests/vtk_write.cpp @@ -61,4 +61,32 @@ SAW_TEST("VTK Write test example"){ // using Type = typename parameter_pack_type<i,T...>::type; } + +SAW_TEST("VTK Write raw test example"){ + using namespace kel; + + // write_vtk(); + + std::stringstream sstream; + + saw::data<sch::Array<sch::MacroStruct<sch::T,2>, 2>> cells{{{2u,2u}}}; + + auto meta = cells.dims(); + + auto& cell_0 = cells.at({{{0,0}}}); + cell_0.template get<"velocity">()= {{0.5,-0.1}}; + cell_0.template get<"pressure">().set(1.1); + + auto eov = lbm::impl::lbm_vtk_writer_raw<sch::MacroStruct<sch::T,2u>,2u>::apply(sstream, &cell_0, meta); + SAW_EXPECT(eov.is_value(), "vtk writer failed to write"); + + // I want to print it to see it for myself. For now I have no tooling to more easily view associated and potentially generated files + std::cout<<sstream.str()<<std::endl; + + static std::string_view comparison_str = "# vtk DataFile Version 3.0\nLBM File\nASCII\nDATASET STRUCTURED_POINTS\nSPACING 1.0 1.0 1.0\nORIGIN 0.0 0.0 0.0\nDIMENSIONS 2 2 1\nPOINT_DATA 4\n\nVECTORS velocity float\n0.5 -0.1 0\n0 0 0\n0 0 0\n0 0 0\nSCALARS pressure float\nLOOKUP_TABLE default\n1.1\n0\n0\n0\n"; + SAW_EXPECT(sstream.str() == comparison_str, "Expected different encoding"); + + // using Type = typename parameter_pack_type<i,T...>::type; +} + } |
