]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make output of tests/simplex/step-40 more robust 12168/head
authorPeter Munch <peterrmuench@gmail.com>
Mon, 10 May 2021 12:44:44 +0000 (14:44 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 10 May 2021 12:44:44 +0000 (14:44 +0200)
tests/simplex/step-40.cc
tests/simplex/step-40.mpirun=1.with_petsc=true.output
tests/simplex/step-40.mpirun=4.with_petsc=true.output

index bcac86dc5080de6f2de6e92e61a64a0c2eec9424..54c5fc2c2c8962f815b4691a43b857e8f9f64ad4 100644 (file)
@@ -292,12 +292,30 @@ namespace Step40
                  system_rhs,
                  preconditioner);
 
-    pcout << "   Solved in " << solver_control.last_step() << " iterations."
-          << std::endl;
-
     constraints.distribute(completely_distributed_solution);
 
     locally_relevant_solution = completely_distributed_solution;
+
+    Vector<double> difference(triangulation.n_active_cells());
+
+#ifdef HEX
+    const QGauss<dim> quadrature_formula(fe.degree + 1);
+#else
+    const QGaussSimplex<dim> quadrature_formula(fe.degree + 1);
+#endif
+
+    VectorTools::integrate_difference(mapping,
+                                      dof_handler,
+                                      locally_relevant_solution,
+                                      Functions::ZeroFunction<dim>(),
+                                      difference,
+                                      quadrature_formula,
+                                      VectorTools::NormType::L2_norm);
+
+    pcout << VectorTools::compute_global_error(triangulation,
+                                               difference,
+                                               VectorTools::NormType::L2_norm)
+          << std::endl;
   }
 
   template <int dim>
index 35bb2044a56aece8dafff2845c9a61dfb49e1a40..ca81c169705fa2e0fcde21761064ce37492eb31a 100644 (file)
@@ -1,4 +1,4 @@
 Running with PETSc on 1 MPI rank(s)...
    Number of active cells:       512
    Number of degrees of freedom: 1089
-   Solved in 7 iterations.
+0.0124965
index 41556ca6a2883634869da748b5a30a2dd2f9f4d7..d476df598c1fad6f81da11cfbf3a112a386414c3 100644 (file)
@@ -1,4 +1,4 @@
 Running with PETSc on 4 MPI rank(s)...
    Number of active cells:       512
    Number of degrees of freedom: 1089
-   Solved in 7 iterations.
+0.0124965

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.