]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-47: misc cleanup 11357/head
authorTimo Heister <timo.heister@gmail.com>
Thu, 10 Dec 2020 23:34:59 +0000 (18:34 -0500)
committerTimo Heister <timo.heister@gmail.com>
Fri, 11 Dec 2020 14:29:11 +0000 (09:29 -0500)
- line up numbers in std::cout messages
- minor formatting

examples/step-47/step-47.cc

index a37518416ecd3234fe9ef1c2de600eb8da148717..5bda3cd3333d998d1c81720ee0a219954fbe2c11 100644 (file)
@@ -769,7 +769,7 @@ namespace Step47
         VectorTools::compute_global_error(triangulation,
                                           norm_per_cell,
                                           VectorTools::L2_norm);
-      std::cout << "   Error in the L2 norm       :     " << error_norm
+      std::cout << "   Error in the L2 norm           :     " << error_norm
                 << std::endl;
     }
 
@@ -860,8 +860,9 @@ namespace Step47
     data_out.add_data_vector(solution, "solution");
     data_out.build_patches();
 
-    std::ofstream output_vtu(
-      ("output_" + Utilities::int_to_string(iteration, 6) + ".vtu").c_str());
+    const std::string filename =
+      ("output_" + Utilities::int_to_string(iteration, 6) + ".vtu");
+    std::ofstream output_vtu(filename);
     data_out.write_vtu(output_vtu);
   }
 
@@ -877,7 +878,7 @@ namespace Step47
     const unsigned int n_cycles = 4;
     for (unsigned int cycle = 0; cycle < n_cycles; ++cycle)
       {
-        std::cout << "Cycle: " << cycle << " of " << n_cycles << std::endl;
+        std::cout << "Cycle " << cycle << " of " << n_cycles << std::endl;
 
         triangulation.refine_global(1);
         setup_system();

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.