From 06533cc3eb4d95670978a23e42a33c0fb2db625d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 20 Mar 2020 16:23:25 -0600 Subject: [PATCH] Move table formatting code next to where the table is filled. --- examples/step-51/step-51.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 -- 2.39.5