From 24bf28a8fb9cc8c3a90b77de9b60728bece7885d Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sat, 18 Oct 2025 18:01:14 +0200 Subject: Moving project structure for more less compilation --- lib/tests/vtk_write.cpp | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 lib/tests/vtk_write.cpp (limited to 'lib/tests/vtk_write.cpp') diff --git a/lib/tests/vtk_write.cpp b/lib/tests/vtk_write.cpp new file mode 100644 index 0000000..0df9998 --- /dev/null +++ b/lib/tests/vtk_write.cpp @@ -0,0 +1,64 @@ +#include + +#include +#include "../c++/write_vtk.hpp" + +#include + +namespace { +namespace sch { +using namespace kel::lbm::sch; + +using T = Float64; +using D2Q5 = Descriptor<2,5>; +using D2Q9 = Descriptor<2,9>; + +template +using DfCell = Cell; + +template +using CellInfo = Cell; + +/** + * Basic type for simulation + */ +template +using CellStruct = Struct< + Member, "dfs">, + Member, "dfs_old">, + Member, "info"> +>; + +template +using MacroStruct = Struct< + Member, "velocity">, + Member +>; + +} + +SAW_TEST("VTK Write test example"){ + using namespace kel; + + // write_vtk(); + + std::stringstream sstream; + + saw::data, 2>> cells{{{2u,2u}}}; + + 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, 2>>::apply(sstream, cells); + 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<::type; +} +} -- cgit v1.2.3