]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
test: fix error estimator norm output
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 14 Dec 2013 11:06:49 +0000 (11:06 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 14 Dec 2013 11:06:49 +0000 (11:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@32003 0785d39b-7218-0410-832d-ea1e28bc413d

tests/mpi/step-39.cc

index 0d0cec272d29e6e99934209d376beb67003c4eb3..c5d15a0f58978d7671ca29291431a6b337f3035d 100644 (file)
@@ -633,10 +633,17 @@ namespace Step39
     MeshWorker::integration_loop<dim, dim> (
       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<double> (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;
 

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.