From c02597649e6d24f09355dafda74b56a37c2d5946 Mon Sep 17 00:00:00 2001 From: hartmann Date: Thu, 13 Jun 2002 15:20:44 +0000 Subject: [PATCH] Make use of the interpolation_difference function. Adapt the comments. git-svn-id: https://svn.dealii.org/trunk@6106 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-14/step-14.cc | 71 +++++++++-------------------- 1 file changed, 22 insertions(+), 49 deletions(-) diff --git a/deal.II/examples/step-14/step-14.cc b/deal.II/examples/step-14/step-14.cc index 7882a62887..c4b337b3a3 100644 --- a/deal.II/examples/step-14/step-14.cc +++ b/deal.II/examples/step-14/step-14.cc @@ -2854,12 +2854,14 @@ namespace LaplaceSolver DoFTools::make_hanging_node_constraints (PrimalSolver::dof_handler, primal_hanging_node_constraints); primal_hanging_node_constraints.close(); - Vector tmp (PrimalSolver::dof_handler.n_dofs()); - FETools::interpolate (DualSolver::dof_handler, - DualSolver::solution, - PrimalSolver::dof_handler, - primal_hanging_node_constraints, - tmp); + Vector dual_weights (DualSolver::dof_handler.n_dofs()); + FETools::interpolation_difference (DualSolver::dof_handler, + dual_hanging_node_constraints, + DualSolver::solution, + PrimalSolver::dof_handler, + primal_hanging_node_constraints, + dual_weights); + // Note that this could probably // have been more efficient since // those constraints have been @@ -2870,50 +2872,21 @@ namespace LaplaceSolver // dual solution. We leave the // optimization of the program in // this respect as an exercise. - - // Once we have the - // down-interpolated field, - // interpolate it back up to the - // dual finite element space, - // just as for the primal - // solution above. This way, we - // again have all information on - // one level, and can work with - // it more simply than - // otherwise. Note that (as in - // the primal case), since the - // solution on the smaller finite - // element space was continuous - // also at hanging nodes (we - // explicitly made it - // continuous), it is also - // conforming in the dual finite - // element space, which must be - // larger. There is thus no need - // for more special actions. - Vector i_h_dual_solution (DualSolver::dof_handler.n_dofs()); - FETools::interpolate (PrimalSolver::dof_handler, - tmp, - DualSolver::dof_handler, - dual_hanging_node_constraints, - i_h_dual_solution); - - // With all this in place, - // compute z-zh: - Vector dual_weights (DualSolver::dof_handler.n_dofs()); - dual_weights = DualSolver::solution; - dual_weights -= i_h_dual_solution; - // Then we set up a map between - // face iterators and their jump - // term contributions of faces to - // the error estimator. The - // reason is that we compute the - // jump terms only once, from one - // side of the face, and want to - // collect them only afterwards - // when looping over all cells a - // second time. + // Having computed the dual + // weights we now proceed with + // computing the cell and face + // residuals of the primal + // solution. First we set up a + // map between face iterators and + // their jump term contributions + // of faces to the error + // estimator. The reason is that + // we compute the jump terms only + // once, from one side of the + // face, and want to collect them + // only afterwards when looping + // over all cells a second time. // // We initialize this map already // with a value of -1e20 for all -- 2.39.5