From: hartmann Date: Fri, 23 Apr 2004 07:44:26 +0000 (+0000) Subject: Unify interface of reinit_vector functions: all vector arguments are called by const... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66e1ca029b16aeb421b0f5c5ac6b76f27e960f91;p=dealii-svn.git 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 --- 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&,