From e720bbf4ead889a607a11513c4a64cc3ccb3e691 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 10 Oct 2018 22:46:12 +0200 Subject: Improve build instructions --- src/fluid_buffer.cc | 4 +++- src/fluid_buffer.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/fluid_buffer.cc b/src/fluid_buffer.cc index 1f40d2f..9291fdd 100644 --- a/src/fluid_buffer.cc +++ b/src/fluid_buffer.cc @@ -32,7 +32,9 @@ Velocity& FluidBuffer::velocity(Vector pos) { return velocity(pos[0], pos[1]); } -void FluidBuffer::writeAsVTK(const std::string& path) { +void FluidBuffer::writeAsVTK(const std::filesystem::path& path) { + std::filesystem::create_directories(path.parent_path()); + std::ofstream fout; fout.open(path.c_str()); diff --git a/src/fluid_buffer.h b/src/fluid_buffer.h index 72518bb..b0e0936 100644 --- a/src/fluid_buffer.h +++ b/src/fluid_buffer.h @@ -2,6 +2,7 @@ #include #include +#include #include "vector.h" @@ -28,5 +29,5 @@ public: Velocity& velocity(std::size_t x, std::size_t y); Velocity& velocity(Vector pos); - void writeAsVTK(const std::string& path); + void writeAsVTK(const std::filesystem::path& path); }; -- cgit v1.2.3