From b0d04a84e46632e8f383006cbb5f17be1e2d3d31 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 16 Apr 2004 22:30:20 +0000 Subject: [PATCH] Replace one problematic part by a better solution. git-svn-id: https://svn.dealii.org/trunk@9034 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-17/step-17.cc | 54 ++++++++--------------------- 1 file changed, 14 insertions(+), 40 deletions(-) diff --git a/deal.II/examples/step-17/step-17.cc b/deal.II/examples/step-17/step-17.cc index aac7365654..61b632ca90 100644 --- a/deal.II/examples/step-17/step-17.cc +++ b/deal.II/examples/step-17/step-17.cc @@ -809,45 +809,19 @@ unsigned int ElasticProblem::solve () // nodes: hanging_node_constraints.distribute (localized_solution); - // The next step is a little more - // convoluted: we need to get the result - // back into the global, distributed - // vector. The problematic part is that on - // each process, we can only efficiently - // write to the elements we own ourselves, - // despite the fact that all processors - // have just computed the complete solution - // vector locally. If we write to elements - // that we do not own, this may be - // expensive since they will have to be - // communicated to the other processors - // later on. So what we do is to ask the - // library to which subdomain each degree - // of freedom belongs (or, in other words: - // which process has them stored locally, - // since we identify subdomains with - // processes), and only write to these. For - // this, let us first get the subdomain for - // each DoF: - std::vector subdomain_association (dof_handler.n_dofs()); - DoFTools::get_subdomain_association (dof_handler, - subdomain_association); - - // Then loop over all degrees of freedom - // and transfer the newly computed value - // for a constrained degree of freedom into - // the global solution if a) this is really - // a constrained DoF, all other vector - // entries should not have been changed - // anyway, and b) we are the owner of this - // degree of freedom, i.e. the subdomain - // the DoF belongs to equals the present - // process's number. - for (unsigned int i=0; i::run () if (this_mpi_process == 0) std::cout << " Solver converged in " << n_iterations << " iterations." << std::endl; - + output_results (cycle); } } -- 2.39.5