From: Wolfgang Bangerth Date: Tue, 4 May 2021 03:49:43 +0000 (-0600) Subject: Avoid a duplicate call to distribute(). X-Git-Tag: v9.3.0-rc1~146^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12129%2Fhead;p=dealii.git Avoid a duplicate call to distribute(). --- diff --git a/examples/step-15/step-15.cc b/examples/step-15/step-15.cc index 766488b9bd..6959010bc2 100644 --- a/examples/step-15/step-15.cc +++ b/examples/step-15/step-15.cc @@ -409,20 +409,21 @@ namespace Step15 solution_transfer.interpolate(current_solution, tmp); current_solution = tmp; - // On the new mesh, there are different hanging nodes, which we have to - // compute again. To ensure there are no hanging nodes of the old mesh in - // the object, it's first cleared. To be on the safe side, we then also - // make sure that the current solution's vector entries satisfy the - // hanging node constraints (see the discussion in the documentation of - // the SolutionTransfer class for why this is necessary): + // On the new mesh, there are different hanging nodes, for which we have to + // compute constraints again, after throwing away previous content of the + // object. To be on the safe side, we should then also make sure that the + // current solution's vector entries satisfy the hanging node constraints + // (see the discussion in the documentation of the SolutionTransfer class + // for why this is necessary). We could do this by calling + // `hanging_node_constraints.distribute(current_solution)` explicitly; we + // omit this step because this will happen at the end of the call to + // `set_boundary_values()` below, and it is not necessary to do it twice. hanging_node_constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, hanging_node_constraints); hanging_node_constraints.close(); - hanging_node_constraints.distribute(current_solution); - // Once we have the interpolated solution and all information about // hanging nodes, we have to make sure that the $u^n$ we now have // actually has the correct boundary values. As explained at the end of