From: Timo Heister Date: Thu, 6 Aug 2015 20:20:20 +0000 (-0500) Subject: distribute() after solution transfer X-Git-Tag: v8.4.0-rc2~652^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=986062e959b8ec674f74a0d9710237135c42ba8b;p=dealii.git distribute() after solution transfer several examples forgot to call ConstraintMatrix::distribute() after a SolutionTransfer, which is required to get a conforming interpolated solution. --- diff --git a/examples/step-28/step-28.cc b/examples/step-28/step-28.cc index 255c1b2ab3..df06162d05 100644 --- a/examples/step-28/step-28.cc +++ b/examples/step-28/step-28.cc @@ -1106,10 +1106,15 @@ namespace Step28 triangulation.execute_coarsening_and_refinement (); dof_handler.distribute_dofs (fe); + this->setup_linear_system (); solution.reinit (dof_handler.n_dofs()); soltrans.interpolate(solution_old, solution); + // enforce constraints to make the interpolated solution conforming on + // the new mesh: + hanging_node_constraints.distribute(solution); + solution_old.reinit (dof_handler.n_dofs()); solution_old = solution; } @@ -1644,7 +1649,12 @@ namespace Step28 std::cout << "Cycle " << cycle << ':' << std::endl; if (cycle == 0) - initialize_problem(); + { + initialize_problem(); + for (unsigned int group=0; groupsetup_linear_system (); + } + else { refine_grid (); @@ -1652,8 +1662,6 @@ namespace Step28 energy_groups[group]->solution *= k_eff; } - for (unsigned int group=0; groupsetup_linear_system (); std::cout << " Numbers of active cells: "; for (unsigned int group=0; group