From ca3a757d34a5e757cf5069554e63e112fa6a740c Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 1 Sep 2004 17:04:56 +0000 Subject: [PATCH] Wolfgang's changes reverted; were not helpful and need further iscussion git-svn-id: https://svn.dealii.org/trunk@9604 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/multigrid/mg_dof_tools.h | 5 ++-- .../deal.II/source/multigrid/mg_dof_tools.cc | 25 +++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/deal.II/deal.II/include/multigrid/mg_dof_tools.h b/deal.II/deal.II/include/multigrid/mg_dof_tools.h index 7c2a46105a..5b1271df7c 100644 --- a/deal.II/deal.II/include/multigrid/mg_dof_tools.h +++ b/deal.II/deal.II/include/multigrid/mg_dof_tools.h @@ -185,7 +185,6 @@ class MGTools const std::vector& selected = std::vector(), const std::vector& target_component = std::vector()); - /** * Adjust vectors on all levels * to correct size. Count the @@ -208,7 +207,7 @@ class MGTools * * The argument * @p target_component allows to - * re-sort and group components + * re-sort and groupt components * as in * DoFRenumbering::component_wise. */ @@ -218,7 +217,7 @@ class MGTools MGLevelObject > &v, const std::vector &selected, const std::vector &target_component, - const std::vector >& cached_sizes + std::vector >& cached_sizes = std::vector >()); }; diff --git a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc index 2ce07b5122..268613979e 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -465,7 +464,7 @@ MGTools::reinit_vector (const MGDoFHandler &mg_dof, MGLevelObject > &v, const std::vector &selected, const std::vector &target_component, - const std::vector >& cached_dofs) + std::vector >& ndofs) { Assert (selected.size() == target_component.size(), ExcDimensionMismatch(selected.size(), target_component.size())); @@ -483,19 +482,19 @@ MGTools::reinit_vector (const MGDoFHandler &mg_dof, while (!selected[selected_block]) ++selected_block; - std::vector > - n_dofs(mg_dof.get_tria().n_levels(), - std::vector(target_component.size())); - - if (cached_dofs.size() == 0) - count_dofs_per_component (mg_dof, n_dofs, target_component); - else - n_dofs = cached_dofs; + if (ndofs.size() == 0) + { + std::vector > + new_dofs(mg_dof.get_tria().n_levels(), + std::vector(target_component.size())); + std::swap(ndofs, new_dofs); + count_dofs_per_component (mg_dof, ndofs, target_component); + } for (unsigned int level=v.get_minlevel(); level<=v.get_maxlevel();++level) { - v[level].reinit(n_dofs[level][selected_block]); + v[level].reinit(ndofs[level][selected_block]); } } @@ -617,13 +616,13 @@ template void MGTools::reinit_vector ( MGLevelObject >&, const std::vector&, const std::vector&, - const std::vector >&); + std::vector >&); template void MGTools::reinit_vector ( const MGDoFHandler&, MGLevelObject >&, const std::vector&, const std::vector&, - const std::vector >&); + std::vector >&); template void MGTools::count_dofs_per_component ( -- 2.39.5