]> https://gitweb.dealii.org/ - dealii.git/commitdiff
pass cycle not name to function
authorTimo Heister <timo.heister@gmail.com>
Tue, 29 Oct 2019 06:53:59 +0000 (07:53 +0100)
committerTimo Heister <timo.heister@gmail.com>
Tue, 29 Oct 2019 06:53:59 +0000 (07:53 +0100)
examples/step-42/step-42.cc

index 3b4c8bda5aecb0da7b6e5779c93ec35e4513dac4..5a8f1e08e9dcd2a4c2e20bdc21a2c58a60e071dc 100644 (file)
@@ -623,7 +623,8 @@ namespace Step42
     void solve_newton();
     void refine_grid();
     void move_mesh(const TrilinosWrappers::MPI::Vector &displacement) const;
-    void output_results(const std::string &filename_base);
+    void output_results(const unsigned int current_refinement_cycle);
+
     void output_contact_force() const;
 
     // As far as member variables are concerned, we start with ones that we use
@@ -1972,7 +1973,7 @@ namespace Step42
   // ghost entries for all locally relevant degrees of freedom.
   template <int dim>
   void PlasticityContactProblem<dim>::output_results(
-    const std::string &filename_base)
+    const unsigned int current_refinement_cycle)
   {
     TimerOutput::Scope t(computing_timer, "Graphical output");
 
@@ -2046,9 +2047,9 @@ namespace Step42
     // output files. We then do the same again for the competitor of
     // Paraview, the Visit visualization program, by creating a matching
     // <code>.visit</code> file.
-    data_out.write_vtu_with_pvtu_record(
-      output_dir, filename_base, 0, 1, mpi_communicator);
-    pcout << output_dir + filename_base << ".pvtu" << std::endl;
+    const std::string master_name = data_out.write_vtu_with_pvtu_record(
+      output_dir, "solution", current_refinement_cycle, 2, mpi_communicator);
+    pcout << master_name << std::endl;
 
     TrilinosWrappers::MPI::Vector tmp(solution);
     tmp *= -1;
@@ -2162,8 +2163,7 @@ namespace Step42
 
         solve_newton();
 
-        output_results(std::string("solution-") +
-                       Utilities::int_to_string(current_refinement_cycle, 2));
+        output_results(current_refinement_cycle);
 
         computing_timer.print_summary();
         computing_timer.reset();

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.