From 602962a9fc1007e1e8dd946c68203ee54b4d63ac Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Thu, 20 Apr 2000 14:42:12 +0000 Subject: [PATCH] local mg works for Q1 git-svn-id: https://svn.dealii.org/trunk@2761 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/multigrid/mg_smoother.templates.h | 1 + deal.II/deal.II/include/multigrid/multigrid.h | 2 +- .../deal.II/include/multigrid/multigrid.templates.h | 13 +++++++++---- deal.II/deal.II/source/multigrid/multigrid.cc | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/deal.II/deal.II/include/multigrid/mg_smoother.templates.h b/deal.II/deal.II/include/multigrid/mg_smoother.templates.h index cc98583b82..b786b24add 100644 --- a/deal.II/deal.II/include/multigrid/mg_smoother.templates.h +++ b/deal.II/deal.II/include/multigrid/mg_smoother.templates.h @@ -27,6 +27,7 @@ MGSmootherRelaxation::smooth (const unsigned int level, for(unsigned i=0;i > prolongation_matrices; + vector > prolongation_matrices; }; diff --git a/deal.II/deal.II/include/multigrid/multigrid.templates.h b/deal.II/deal.II/include/multigrid/multigrid.templates.h index 820d2bdc7d..77d7be4f8b 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.templates.h +++ b/deal.II/deal.II/include/multigrid/multigrid.templates.h @@ -38,15 +38,18 @@ Multigrid::copy_to_mg (const Vector&) template template void -Multigrid::copy_to_mg (const Vector& src) +Multigrid::copy_to_mg (const Vector& osrc) { + // Make src a real finite element function + Vector src = osrc; +// constraints->distribute(src); + const unsigned int dofs_per_cell = mg_dof_handler->get_fe().dofs_per_cell; const unsigned int dofs_per_face = mg_dof_handler->get_fe().dofs_per_face; // set the elements of the vectors // on all levels to zero defect.clear(); -// constraints->condense(src); vector global_dof_indices (dofs_per_cell); vector level_dof_indices (dofs_per_cell); @@ -102,14 +105,16 @@ Multigrid::copy_to_mg (const Vector& src) for (unsigned int i=0; i::faces_per_cell; ++face_n) { const MGDoFHandler::face_iterator face = level_cell->face(face_n); if (face->has_children()) { face->get_mg_dof_indices(level_face_indices); + + + // Delete values on refinement edge, + // since restriction will add them again. for (unsigned int i=0; i &mg_dof) }; prolongation_sparsities[level].compress (); - prolongation_matrices.push_back (SparseMatrix()); + prolongation_matrices.push_back (SparseMatrix()); prolongation_matrices[level].reinit (prolongation_sparsities[level]); -- 2.39.5