summaryrefslogtreecommitdiff
path: root/lib/core/c++/write_vtk.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-02-17 18:29:22 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-02-17 18:29:22 +0100
commitdcee24278ed28d21cd3addffeeb8e5f9f7248602 (patch)
treed590ede2996f04f69e2c4521019ae5b1bedd05df /lib/core/c++/write_vtk.hpp
parentbb90083ca62483a1cf0e1b72dfb96e05701035ef (diff)
downloadlibs-lbm-dcee24278ed28d21cd3addffeeb8e5f9f7248602.tar.gz
End of dayHEADmasterdev
Diffstat (limited to 'lib/core/c++/write_vtk.hpp')
-rw-r--r--lib/core/c++/write_vtk.hpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/core/c++/write_vtk.hpp b/lib/core/c++/write_vtk.hpp
index f7b8f8f..f925361 100644
--- a/lib/core/c++/write_vtk.hpp
+++ b/lib/core/c++/write_vtk.hpp
@@ -222,9 +222,27 @@ struct lbm_vtk_writer<sch::Struct<sch::Member<sch::Chunk<MemberT,Ghost,Dims...>,
}
template<typename Sch>
-saw::error_or<void> write_vtk_file(const std::filesystem::path& file_name, const saw::data<Sch>& field){
+saw::error_or<void> write_vtk_file(const std::filesystem::path& out_dir, const std::string_view& file_name, uint64_t d_t, const saw::data<Sch>& field){
+
+ auto vtk_dir = out_dir / "vtk";
+ {
+ std::error_code ec;
+ std::filesystem::create_directories(vtk_dir,ec);
+ if(ec != std::errc{}){
+ return saw::make_error<saw::err::critical>("Could not create directory for write_vtk_file function");
+ }
+ }
+ std::string ft_name{file_name};
+
+ std::stringstream sstr;
+ sstr
+ <<file_name
+ <<"_"
+ <<d_t
+ <<".vtk"
+ ;
- std::ofstream vtk_file{file_name};
+ std::ofstream vtk_file{vtk_dir / sstr.str() };
if( not vtk_file.is_open() ){
return saw::make_error<saw::err::critical>("Could not open file.");