From c75002f021f7fda2aa1f9b5afda1722b9eb3190a Mon Sep 17 00:00:00 2001 From: richter Date: Tue, 25 Jan 2000 18:20:40 +0000 Subject: [PATCH] fix serious bug in interpolate: previously, distribute_local_to_global was used, which added up its contributions over all cells. It would be necessary to rescale the sums afterwards by the number of summands in each dof, but this was not done. That led to a factor of four amplification at regular nodes (2d) and 2 at hanging nodes, of course, so we modified that. git-svn-id: https://svn.dealii.org/trunk@2257 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/numerics/vectors.cc | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/deal.II/deal.II/source/numerics/vectors.cc b/deal.II/deal.II/source/numerics/vectors.cc index d5e75e68bb..90caa4f8ee 100644 --- a/deal.II/deal.II/source/numerics/vectors.cc +++ b/deal.II/deal.II/source/numerics/vectors.cc @@ -284,6 +284,9 @@ VectorTools::interpolate (const DoFHandler &high_dof, { Vector cell_high(high_dof.get_fe().dofs_per_cell); Vector cell_low(low_dof.get_fe().dofs_per_cell); + + vector touch_count (low_dof.n_dofs(), 0); + vector local_dof_indices (low_dof.get_fe().dofs_per_cell); DoFHandler::active_cell_iterator h = high_dof.begin_active(); DoFHandler::active_cell_iterator l = low_dof.begin_active(); @@ -293,8 +296,32 @@ VectorTools::interpolate (const DoFHandler &high_dof, { h->get_dof_values(high, cell_high); transfer.vmult(cell_low, cell_high); - l->distribute_local_to_global(cell_low, low); - } + + l->get_dof_indices (local_dof_indices); + + // distribute cell vector + for (unsigned int j=0; j