From: heister Date: Sat, 14 Dec 2013 11:06:49 +0000 (+0000) Subject: test: fix error estimator norm output X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e3b83e9b0ea48e082e2bd10434a200500572242;p=dealii-svn.git test: fix error estimator norm output git-svn-id: https://svn.dealii.org/trunk@32003 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/mpi/step-39.cc b/tests/mpi/step-39.cc index 0d0cec272d..c5d15a0f58 100644 --- a/tests/mpi/step-39.cc +++ b/tests/mpi/step-39.cc @@ -633,10 +633,17 @@ namespace Step39 MeshWorker::integration_loop ( begin, end, dof_info, info_box, - integrator, assembler); + integrator, assembler); // TODO: do this on all faces touching ghost cells triangulation.load_user_indices(old_user_indices); - return estimates.block(0).l2_norm(); + // estimates is a BlockVector (so serial) on each processor + // with one entry per active cell. Note that only the locally owned + // cells are !=0, so summing the contributions of l2_norm() over all + // processors is the right way to do this. + double local_norm = estimates.block(0).l2_norm(); + local_norm *= local_norm; + estimates.block(0).print(deallog); + return std::sqrt(Utilities::MPI::sum(local_norm, MPI_COMM_WORLD)); } @@ -756,8 +763,8 @@ namespace Step39 int main(int argc, char *argv[]) { dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv); - mpi_initlog(true); - + MPILogInitAll log; + using namespace dealii; using namespace Step39;