From: Wolfgang Bangerth Date: Fri, 20 Mar 2020 22:23:25 +0000 (-0600) Subject: Move table formatting code next to where the table is filled. X-Git-Tag: v9.2.0-rc1~394^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06533cc3eb4d95670978a23e42a33c0fb2db625d;p=dealii.git Move table formatting code next to where the table is filled. --- diff --git a/examples/step-51/step-51.cc b/examples/step-51/step-51.cc index 5f64875649..57fae64664 100644 --- a/examples/step-51/step-51.cc +++ b/examples/step-51/step-51.cc @@ -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