]> https://gitweb.dealii.org/ - dealii.git/commitdiff
unify some example output 16315/head
authorTimo Heister <timo.heister@gmail.com>
Fri, 1 Dec 2023 21:14:11 +0000 (16:14 -0500)
committerTimo Heister <timo.heister@gmail.com>
Mon, 4 Dec 2023 14:03:06 +0000 (09:03 -0500)
examples/step-14/doc/results.dox
examples/step-14/step-14.cc
examples/step-3/doc/results.dox
examples/step-3/step-3.cc
examples/step-9/step-9.cc

index 68ff071a1aec0b752c2ac4be1c62e7b9493f2855..41e85b3975c541443557b835134533df60322ea4 100644 (file)
@@ -10,40 +10,40 @@ it out, by changing the settings in the main program. Here, we start
 by simply letting it run, unmodified:
 @code
 Refinement cycle: 0
-   Number of degrees of freedom=72
-   Point value=0.03243
-   Estimated error=0.000702385
+   Number of degrees of freedom72
+   Point value0.03243
+   Estimated error0.000702385
 Refinement cycle: 1
-   Number of degrees of freedom=67
-   Point value=0.0324827
-   Estimated error=0.000888953
+   Number of degrees of freedom67
+   Point value0.0324827
+   Estimated error0.000888953
 Refinement cycle: 2
-   Number of degrees of freedom=130
-   Point value=0.0329619
-   Estimated error=0.000454606
+   Number of degrees of freedom130
+   Point value0.0329619
+   Estimated error0.000454606
 Refinement cycle: 3
-   Number of degrees of freedom=307
-   Point value=0.0331934
-   Estimated error=0.000241254
+   Number of degrees of freedom307
+   Point value0.0331934
+   Estimated error0.000241254
 Refinement cycle: 4
-   Number of degrees of freedom=718
-   Point value=0.0333675
-   Estimated error=7.4912e-05
+   Number of degrees of freedom718
+   Point value0.0333675
+   Estimated error7.4912e-05
 Refinement cycle: 5
-   Number of degrees of freedom=1665
-   Point value=0.0334083
-   Estimated error=3.69111e-05
+   Number of degrees of freedom1665
+   Point value0.0334083
+   Estimated error3.69111e-05
 Refinement cycle: 6
-   Number of degrees of freedom=3975
-   Point value=0.033431
-   Estimated error=1.54218e-05
+   Number of degrees of freedom3975
+   Point value0.033431
+   Estimated error1.54218e-05
 Refinement cycle: 7
-   Number of degrees of freedom=8934
-   Point value=0.0334406
-   Estimated error=6.28359e-06
+   Number of degrees of freedom8934
+   Point value0.0334406
+   Estimated error6.28359e-06
 Refinement cycle: 8
-   Number of degrees of freedom=21799
-   Point value=0.0334444
+   Number of degrees of freedom21799
+   Point value0.0334444
 @endcode
 
 
@@ -183,44 +183,44 @@ program compute these quantities, simply replace the two occurrences of
 <code>PointXDerivativeEvaluation</code>, and let the program run:
 @code
 Refinement cycle: 0
-   Number of degrees of freedom=72
-   Point x-derivative=-0.0719397
-   Estimated error=-0.0126173
+   Number of degrees of freedom72
+   Point x-derivative-0.0719397
+   Estimated error-0.0126173
 Refinement cycle: 1
-   Number of degrees of freedom=61
-   Point x-derivative=-0.0707956
-   Estimated error=-0.00774316
+   Number of degrees of freedom61
+   Point x-derivative-0.0707956
+   Estimated error-0.00774316
 Refinement cycle: 2
-   Number of degrees of freedom=131
-   Point x-derivative=-0.0568671
-   Estimated error=-0.00313426
+   Number of degrees of freedom131
+   Point x-derivative-0.0568671
+   Estimated error-0.00313426
 Refinement cycle: 3
-   Number of degrees of freedom=247
-   Point x-derivative=-0.053033
-   Estimated error=-0.00136114
+   Number of degrees of freedom247
+   Point x-derivative-0.053033
+   Estimated error-0.00136114
 Refinement cycle: 4
-   Number of degrees of freedom=532
-   Point x-derivative=-0.0526429
-   Estimated error=-0.000558868
+   Number of degrees of freedom532
+   Point x-derivative-0.0526429
+   Estimated error-0.000558868
 Refinement cycle: 5
-   Number of degrees of freedom=1267
-   Point x-derivative=-0.0526955
-   Estimated error=-0.000220116
+   Number of degrees of freedom1267
+   Point x-derivative-0.0526955
+   Estimated error-0.000220116
 Refinement cycle: 6
-   Number of degrees of freedom=2864
-   Point x-derivative=-0.0527495
-   Estimated error=-9.46731e-05
+   Number of degrees of freedom2864
+   Point x-derivative-0.0527495
+   Estimated error-9.46731e-05
 Refinement cycle: 7
-   Number of degrees of freedom=6409
-   Point x-derivative=-0.052785
-   Estimated error=-4.21543e-05
+   Number of degrees of freedom6409
+   Point x-derivative-0.052785
+   Estimated error-4.21543e-05
 Refinement cycle: 8
-   Number of degrees of freedom=14183
-   Point x-derivative=-0.0528028
-   Estimated error=-2.04241e-05
+   Number of degrees of freedom14183
+   Point x-derivative-0.0528028
+   Estimated error-2.04241e-05
 Refinement cycle: 9
-   Number of degrees of freedom=29902
-   Point x-derivative=-0.052814
+   Number of degrees of freedom29902
+   Point x-derivative-0.052814
 @endcode
 
 
index 5693f758d35d5047f927f209bc1a12d82f4d5f1e..6dd5e54a51d62b5c3c2870009427898f99bd89a2 100644 (file)
@@ -145,7 +145,7 @@ namespace Step14
       AssertThrow(evaluation_point_found,
                   ExcEvaluationPointNotFound(evaluation_point));
 
-      std::cout << "   Point value=" << point_value << std::endl;
+      std::cout << "   Point value" << point_value << std::endl;
     }
 
 
@@ -2238,7 +2238,7 @@ namespace Step14
             }
           ++present_cell;
         }
-      std::cout << "   Estimated error="
+      std::cout << "   Estimated error"
                 << std::accumulate(error_indicators.begin(),
                                    error_indicators.end(),
                                    0.)
@@ -2778,7 +2778,7 @@ namespace Step14
         solver->solve_problem();
         solver->output_solution();
 
-        std::cout << "   Number of degrees of freedom=" << solver->n_dofs()
+        std::cout << "   Number of degrees of freedom" << solver->n_dofs()
                   << std::endl;
 
         for (const auto &evaluator : descriptor.evaluator_list)
index 488d7d12ce060a3063a4c5c466b0f6b801de8ce5..d556b31d114d555010b9bdb73dd7053470c4d7df 100644 (file)
@@ -6,9 +6,10 @@ Number of active cells: 1024
 Number of degrees of freedom: 1089
 DEAL:cg::Starting value 0.121094
 DEAL:cg::Convergence step 36 value 7.07761e-08
+Output written to solution.vtk
 @endcode
 
-The first two lines is what we wrote to <code>std::cout</code>. The last
+The first two lines is what we wrote to <code>std::cout</code>. The next
 two lines were generated by the CG solver because we called
 `deallog.depth_console(2);` in the `main()` function -- see
 the lengthy discussion there. These two lines prefixed by `DEAL:cg:` state
@@ -21,7 +22,8 @@ norm of the right hand side vector; the starting value is (here) this
 norm of the right hand side vector, and there is indeed more than a
 factor of $10^{-6}$ between the two values shown.
 
-Apart from the output shown above, the program generated the file
+The last line is the output we generated at the bottom of the
+`output_results()` function. The program also generated the file
 <code>solution.vtk</code>, which is in the VTK format that is widely
 used by many visualization programs today -- including the two
 heavy-weights <a href="https://www.llnl.gov/visit">VisIt</a> and
index 7f8a7d68dcbc01dcbc6242aac8a49cccc4539acb..35a21f2ac224abb2388a283ead52f2eedb0d7cc1 100644 (file)
@@ -594,8 +594,10 @@ void Step3::output_results() const
   // functions in the DataOut class we are using here that can write the
   // data in postscript, AVS, GMV, Gnuplot, or some other file
   // formats):
-  std::ofstream output("solution.vtk");
+  const std::string filename = "solution.vtk";
+  std::ofstream     output(filename);
   data_out.write_vtk(output);
+  std::cout << "Output written to " << filename << std::endl;
 }
 
 
index eb9ecb52480de8f90615a213d2dbfdccb4d92fd4..27a06b2227ec82cdcc951692078c6b603b5ecf9f 100644 (file)
@@ -828,9 +828,11 @@ namespace Step9
   void AdvectionProblem<dim>::output_results(const unsigned int cycle) const
   {
     {
-      GridOut       grid_out;
-      std::ofstream output("grid-" + std::to_string(cycle) + ".vtu");
+      GridOut           grid_out;
+      const std::string filename = "grid-" + std::to_string(cycle) + ".vtu";
+      std::ofstream     output(filename);
       grid_out.write_vtu(triangulation, output);
+      std::cout << "Grid written to " << filename << std::endl;
     }
 
     {
@@ -846,8 +848,10 @@ namespace Step9
       vtk_flags.compression_level = DataOutBase::CompressionLevel::best_speed;
       data_out.set_flags(vtk_flags);
 
-      std::ofstream output("solution-" + std::to_string(cycle) + ".vtu");
+      const std::string filename = "solution-" + std::to_string(cycle) + ".vtu";
+      std::ofstream     output(filename);
       data_out.write_vtu(output);
+      std::cout << "Solution written to " << filename << std::endl;
     }
   }
 

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.