]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move table formatting code next to where the table is filled. 9699/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 20 Mar 2020 22:23:25 +0000 (16:23 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 20 Mar 2020 22:23:25 +0000 (16:23 -0600)
examples/step-51/step-51.cc

index 5f64875649e8b2880a749dde424a44109fbda931..57fae64664b5fccb99fa6c28499e7e723e004399 100644 (file)
@@ -1081,9 +1081,18 @@ namespace Step51
 
     convergence_table.add_value("cells", triangulation.n_active_cells());
     convergence_table.add_value("dofs", dof_handler.n_dofs());
+
     convergence_table.add_value("val L2", L2_error);
+    convergence_table.set_scientific("val L2", true);
+    convergence_table.set_precision("val L2", 3);
+
     convergence_table.add_value("grad L2", grad_error);
+    convergence_table.set_scientific("grad L2", true);
+    convergence_table.set_precision("grad L2", 3);
+
     convergence_table.add_value("val L2-post", post_error);
+    convergence_table.set_scientific("val L2-post", true);
+    convergence_table.set_precision("val L2-post", 3);
   }
 
 
@@ -1358,15 +1367,6 @@ namespace Step51
         output_results(cycle);
       }
 
-
-
-    convergence_table.set_precision("val L2", 3);
-    convergence_table.set_scientific("val L2", true);
-    convergence_table.set_precision("grad L2", 3);
-    convergence_table.set_scientific("grad L2", true);
-    convergence_table.set_precision("val L2-post", 3);
-    convergence_table.set_scientific("val L2-post", true);
-
     // There is one minor change for the convergence table compared to step-7:
     // Since we did not refine our mesh by a factor two in each cycle (but
     // rather used the sequence 2, 3, 4, 6, 8, 12, ...), we need to tell the

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.