aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-10-10 22:46:12 +0200
committerAdrian Kummerlaender2018-10-10 22:46:12 +0200
commite720bbf4ead889a607a11513c4a64cc3ccb3e691 (patch)
tree3937d2b92e3b06c00dcd183cd71fdba65a9017e5 /src
parentb4a61621fc1d2d6350c8f700ee3196950e476000 (diff)
downloadboltzbub-e720bbf4ead889a607a11513c4a64cc3ccb3e691.tar
boltzbub-e720bbf4ead889a607a11513c4a64cc3ccb3e691.tar.gz
boltzbub-e720bbf4ead889a607a11513c4a64cc3ccb3e691.tar.bz2
boltzbub-e720bbf4ead889a607a11513c4a64cc3ccb3e691.tar.lz
boltzbub-e720bbf4ead889a607a11513c4a64cc3ccb3e691.tar.xz
boltzbub-e720bbf4ead889a607a11513c4a64cc3ccb3e691.tar.zst
boltzbub-e720bbf4ead889a607a11513c4a64cc3ccb3e691.zip
Improve build instructions
Diffstat (limited to 'src')
-rw-r--r--src/fluid_buffer.cc4
-rw-r--r--src/fluid_buffer.h3
2 files changed, 5 insertions, 2 deletions
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<std::size_t> 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 <memory>
#include <string>
+#include <filesystem>
#include "vector.h"
@@ -28,5 +29,5 @@ public:
Velocity& velocity(std::size_t x, std::size_t y);
Velocity& velocity(Vector<std::size_t> pos);
- void writeAsVTK(const std::string& path);
+ void writeAsVTK(const std::filesystem::path& path);
};