From f89016a9c46cc32727763aab685c1cf19ba3a62f Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Fri, 4 Nov 2011 15:45:36 +0100 Subject: [PATCH] Produce a stream of data --- src/one-body-sample.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index faf33e22..accd6355 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -43,6 +43,8 @@ #include <dune/tectonic/myconvexproblem.hh> #include <dune/tectonic/myblockproblem.hh> +#include "boost/format.hpp" + int const dim = 2; template <class GridView> @@ -225,6 +227,14 @@ int main() { solver_tolerance, &energyNorm, Solver::FULL); // Solver::QUIET); solver.solve(); + + Dune::VTKWriter<GridType::LeafGridView> writer(leafView); + std::string filename((boost::format("obs%d") % run).str()); + Dune::shared_ptr<Dune::VTKBasisGridFunction<P1Basis, VectorType>> ptr( + new Dune::VTKBasisGridFunction<P1Basis, VectorType>( + p1Basis, u1, "displacement")); + writer.addVertexData(ptr); + writer.write(filename.c_str()); } // Use a linear solver for comparison; should return roughly the @@ -242,13 +252,6 @@ int main() { } } - Dune::shared_ptr<Dune::VTKBasisGridFunction<P1Basis, VectorType>> ptr( - new Dune::VTKBasisGridFunction<P1Basis, VectorType>(p1Basis, u1, - "displacement")); - Dune::VTKWriter<GridType::LeafGridView> writer(leafView); - writer.addVertexData(ptr); - writer.write("weeee"); - VectorType diff = u2; diff -= u1; std::cout << "Infinity norm of the difference of the two solutions: " -- GitLab