]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Only compute error indicators locally.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 8 Sep 2009 03:24:04 +0000 (03:24 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 8 Sep 2009 03:24:04 +0000 (03:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@19410 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-32/step-32.cc

index da51074471ee9bc5053de015daa08f52abdb983e..e99f883c71c16ac1b33fd06ff7ec10e4c024516a 100644 (file)
@@ -2967,13 +2967,24 @@ template <int dim>
 void BoussinesqFlowProblem<dim>::refine_mesh (const unsigned int max_grid_level)
 {
   computing_timer.enter_section ("Refine mesh structure, part 1");
-  Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
+  Vector<float> local_estimated_error_per_cell (triangulation.n_active_cells());
 
   KellyErrorEstimator<dim>::estimate (temperature_dof_handler,
                                      QGauss<dim-1>(temperature_degree+1),
                                      typename FunctionMap<dim>::type(),
                                      temperature_solution,
-                                     estimated_error_per_cell);
+                                     local_estimated_error_per_cell,
+                                     std::vector<bool>(),
+                                     0,
+                                     0,
+                                     Utilities::Trilinos::get_this_mpi_process(trilinos_communicator));
+
+  Vector<double> x_local_estimated_error_per_cell (triangulation.n_active_cells());
+  x_local_estimated_error_per_cell = local_estimated_error_per_cell;
+  Vector<double> estimated_error_per_cell (triangulation.n_active_cells());
+  trilinos_communicator.MaxAll (&x_local_estimated_error_per_cell(0),
+                               &estimated_error_per_cell(0),
+                               triangulation.n_active_cells());
 
   GridRefinement::refine_and_coarsen_fixed_fraction (triangulation,
                                                     estimated_error_per_cell,

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.