From b00957fb83f408ed0bce489839b9798ce1c497f2 Mon Sep 17 00:00:00 2001 From: wolf Date: Sun, 4 Apr 2004 23:31:00 +0000 Subject: [PATCH] Fix some things. Mesh refinement now also parallel. git-svn-id: https://svn.dealii.org/trunk@8962 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-17/step-17.cc | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/deal.II/examples/step-17/step-17.cc b/deal.II/examples/step-17/step-17.cc index 8171dc531b..1e9007538b 100644 --- a/deal.II/examples/step-17/step-17.cc +++ b/deal.II/examples/step-17/step-17.cc @@ -410,15 +410,40 @@ void ElasticProblem::refine_grid () // XXX { PETScWrappers::Vector localized_solution (solution); + Vector local_error_per_cell (triangulation.n_active_cells()); typename FunctionMap::type neumann_boundary; KellyErrorEstimator::estimate (dof_handler, QGauss2(), neumann_boundary, localized_solution, - estimated_error_per_cell); + local_error_per_cell, + std::vector(), + 0, + multithread_info.n_default_threads, + this_partition); + + const unsigned int local_cells + = (n_partitions == 1 ? + triangulation.n_active_cells() : + (this_partition != n_partitions-1 ? + triangulation.n_active_cells() / n_partitions : + triangulation.n_active_cells() - triangulation.n_active_cells() / n_partitions * (n_partitions-1))); + PETScWrappers::MPI::Vector + global_error_per_cell (mpi_communicator, + triangulation.n_active_cells(), + local_cells); + + + for (unsigned int i=0; i