diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index faf33e228024fede19d29b77576785bfd17720d9..accd63555e87c399b260a6bc9752e2e8a34d4ff8 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: "