From df685922e8f6ca415021b7e2e2c2fecc003626df Mon Sep 17 00:00:00 2001
From: Oliver Sander <oliver.sander@tu-dresden.de>
Date: Thu, 11 Feb 2016 16:21:49 +0100
Subject: [PATCH] Also write the results as binary data, to alloc EOC
 measurements

---
 src/gradient-flow.cc | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/gradient-flow.cc b/src/gradient-flow.cc
index 957881a7..b461b658 100644
--- a/src/gradient-flow.cc
+++ b/src/gradient-flow.cc
@@ -253,6 +253,11 @@ int main (int argc, char *argv[]) try
 #endif
   vtkWriter.write("gradientflow_result_0");
 
+  // Write the corresponding coefficient vector: verbatim in binary, to be completely lossless
+  std::ofstream outFile("gradientflow_result_0.data", std::ios_base::binary);
+  GenericVector::writeBinary(outFile, xEmbedded);
+  outFile.close();
+
   ///////////////////////////////////////////////////////
   //   Time loop
   ///////////////////////////////////////////////////////
@@ -291,6 +296,12 @@ int main (int argc, char *argv[]) try
     vtkWriter.addVertexData(vtkFunction(xFunction), VTK::FieldInfo("orientation", VTK::FieldInfo::Type::scalar, xEmbedded[0].size()));
 #endif
     vtkWriter.write("gradientflow_result_" + std::to_string(i+1));
+
+    // Write the corresponding coefficient vector: verbatim in binary, to be completely lossless
+    std::ofstream outFile("gradientflow_result_" + std::to_string(i+1) + ".data", std::ios_base::binary);
+    GenericVector::writeBinary(outFile, xEmbedded);
+    outFile.close();
+
   }
 
   return 0;
-- 
GitLab