From: Peter Munch Date: Mon, 10 May 2021 12:44:44 +0000 (+0200) Subject: Make output of tests/simplex/step-40 more robust X-Git-Tag: v9.3.0-rc1~109^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ecd67a5c8621c6d2f2d3c35e71f448340f59aa1;p=dealii.git Make output of tests/simplex/step-40 more robust --- diff --git a/tests/simplex/step-40.cc b/tests/simplex/step-40.cc index bcac86dc50..54c5fc2c2c 100644 --- a/tests/simplex/step-40.cc +++ b/tests/simplex/step-40.cc @@ -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 difference(triangulation.n_active_cells()); + +#ifdef HEX + const QGauss quadrature_formula(fe.degree + 1); +#else + const QGaussSimplex quadrature_formula(fe.degree + 1); +#endif + + VectorTools::integrate_difference(mapping, + dof_handler, + locally_relevant_solution, + Functions::ZeroFunction(), + difference, + quadrature_formula, + VectorTools::NormType::L2_norm); + + pcout << VectorTools::compute_global_error(triangulation, + difference, + VectorTools::NormType::L2_norm) + << std::endl; } template diff --git a/tests/simplex/step-40.mpirun=1.with_petsc=true.output b/tests/simplex/step-40.mpirun=1.with_petsc=true.output index 35bb2044a5..ca81c16970 100644 --- a/tests/simplex/step-40.mpirun=1.with_petsc=true.output +++ b/tests/simplex/step-40.mpirun=1.with_petsc=true.output @@ -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 diff --git a/tests/simplex/step-40.mpirun=4.with_petsc=true.output b/tests/simplex/step-40.mpirun=4.with_petsc=true.output index 41556ca6a2..d476df598c 100644 --- a/tests/simplex/step-40.mpirun=4.with_petsc=true.output +++ b/tests/simplex/step-40.mpirun=4.with_petsc=true.output @@ -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