From 66e1ca029b16aeb421b0f5c5ac6b76f27e960f91 Mon Sep 17 00:00:00 2001 From: hartmann Date: Fri, 23 Apr 2004 07:44:26 +0000 Subject: [PATCH] Unify interface of reinit_vector functions: all vector arguments are called by const reference. Copy vector within function where necessary. git-svn-id: https://svn.dealii.org/trunk@9095 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/multigrid/mg_dof_tools.h | 8 +++--- .../deal.II/source/multigrid/mg_dof_tools.cc | 27 ++++++++++--------- 2 files changed, 19 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 b5dc3bd530..0cbb82b462 100644 --- a/deal.II/deal.II/include/multigrid/mg_dof_tools.h +++ b/deal.II/deal.II/include/multigrid/mg_dof_tools.h @@ -180,10 +180,10 @@ class MGTools */ template static void - reinit_vector (const MGDoFHandler& mg_dof, - MGLevelObject >& v, - const std::vector selected = std::vector(), - const std::vector target_component + reinit_vector (const MGDoFHandler &mg_dof, + MGLevelObject > &v, + const std::vector &selected = std::vector(), + const std::vector &target_component = std::vector()); /** * Adjust vectors on all levels 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 b989337108..53d52c834e 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc @@ -392,9 +392,11 @@ template void MGTools::reinit_vector (const MGDoFHandler& mg_dof, MGLevelObject >& v, - std::vector selected, - std::vector target_component) + const std::vector &sel, + const std::vector &target_comp) { + std::vector selected=sel; + std::vector target_component=target_comp; const unsigned int ncomp = mg_dof.get_fe().n_components(); // If the selected and @@ -403,8 +405,9 @@ MGTools::reinit_vector (const MGDoFHandler& mg_dof, // values. // // Since we already made copies - // when this function was called, - // we use the arguments directly. + // directly after this function was + // called, we use the arguments + // directly. if (target_component.size() == 0) { target_component.resize(ncomp); @@ -456,10 +459,10 @@ MGTools::reinit_vector (const MGDoFHandler& mg_dof, template void -MGTools::reinit_vector (const MGDoFHandler& mg_dof, - MGLevelObject >& v, - const std::vector& selected, - const std::vector& target_component) +MGTools::reinit_vector (const MGDoFHandler &mg_dof, + MGLevelObject > &v, + const std::vector &selected, + const std::vector &target_component) { Assert (selected.size() == target_component.size(), ExcDimensionMismatch(selected.size(), target_component.size())); @@ -595,13 +598,13 @@ template void MGTools::reinit_vector ( template void MGTools::reinit_vector ( const MGDoFHandler&, MGLevelObject >&, - const std::vector, - const std::vector); + const std::vector &, + const std::vector &); template void MGTools::reinit_vector ( const MGDoFHandler&, MGLevelObject >&, - const std::vector, - const std::vector); + const std::vector &, + const std::vector &); template void MGTools::reinit_vector ( const MGDoFHandler&, -- 2.39.5