aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-09-09 12:15:07 +0200
committerAdrian Kummerlaender2018-09-09 12:15:07 +0200
commit996916a493fb55437208e50a3a9fda7c04423747 (patch)
treed9fd3037172825123dbfc364bb4a9f42a7a66a98 /src
parentacdba1d0ba0de53df326956352ff09bea2b80c6a (diff)
downloadboltzbub-996916a493fb55437208e50a3a9fda7c04423747.tar
boltzbub-996916a493fb55437208e50a3a9fda7c04423747.tar.gz
boltzbub-996916a493fb55437208e50a3a9fda7c04423747.tar.bz2
boltzbub-996916a493fb55437208e50a3a9fda7c04423747.tar.lz
boltzbub-996916a493fb55437208e50a3a9fda7c04423747.tar.xz
boltzbub-996916a493fb55437208e50a3a9fda7c04423747.tar.zst
boltzbub-996916a493fb55437208e50a3a9fda7c04423747.zip
Extract result path generation
Diffstat (limited to 'src')
-rw-r--r--src/fluid_buffer.cc4
-rw-r--r--src/fluid_buffer.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/fluid_buffer.cc b/src/fluid_buffer.cc
index e73c818..1f40d2f 100644
--- a/src/fluid_buffer.cc
+++ b/src/fluid_buffer.cc
@@ -32,9 +32,9 @@ Velocity& FluidBuffer::velocity(Vector<std::size_t> pos) {
return velocity(pos[0], pos[1]);
}
-void FluidBuffer::writeAsVTK(int time) {
+void FluidBuffer::writeAsVTK(const std::string& path) {
std::ofstream fout;
- fout.open(("result/data_t" + std::to_string(time) + ".vtk").c_str());
+ fout.open(path.c_str());
fout << "# vtk DataFile Version 3.0\n";
fout << "lbm_output\n";
diff --git a/src/fluid_buffer.h b/src/fluid_buffer.h
index 1d802c0..72518bb 100644
--- a/src/fluid_buffer.h
+++ b/src/fluid_buffer.h
@@ -1,6 +1,7 @@
#pragma once
#include <memory>
+#include <string>
#include "vector.h"
@@ -27,5 +28,5 @@ public:
Velocity& velocity(std::size_t x, std::size_t y);
Velocity& velocity(Vector<std::size_t> pos);
- void writeAsVTK(int time);
+ void writeAsVTK(const std::string& path);
};