]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Unify interface of reinit_vector functions: all vector arguments are called by const...
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Fri, 23 Apr 2004 07:44:26 +0000 (07:44 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Fri, 23 Apr 2004 07:44:26 +0000 (07:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@9095 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/multigrid/mg_dof_tools.h
deal.II/deal.II/source/multigrid/mg_dof_tools.cc

index b5dc3bd5306010b7bf1fc6a96cd89d8329036e9a..0cbb82b462ebe17d216107f56246025bc312c54e 100644 (file)
@@ -180,10 +180,10 @@ class MGTools
                                      */
     template <int dim, typename number>
       static void
-      reinit_vector (const MGDoFHandler<dim>mg_dof,
-                    MGLevelObject<BlockVector<number> >v,
-                    const std::vector<bool> selected = std::vector<bool>(),
-                    const std::vector<unsigned int> target_component
+      reinit_vector (const MGDoFHandler<dim> &mg_dof,
+                    MGLevelObject<BlockVector<number> > &v,
+                    const std::vector<bool> &selected = std::vector<bool>(),
+                    const std::vector<unsigned int> &target_component
                     = std::vector<unsigned int>());
                                     /**
                                      * Adjust vectors on all levels
index b989337108d90f9f0476ac124f2f7e6e2e18d42a..53d52c834e40a6c89f70c0866243bc2c6d485797 100644 (file)
@@ -392,9 +392,11 @@ template<int dim, typename number>
 void
 MGTools::reinit_vector (const MGDoFHandler<dim>& mg_dof,
                         MGLevelObject<BlockVector<number> >& v,
-                        std::vector<bool> selected,
-                       std::vector<unsigned int> target_component)
+                        const std::vector<bool> &sel,
+                       const std::vector<unsigned int> &target_comp)
 {
+  std::vector<bool> selected=sel;
+  std::vector<unsigned int> 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<dim>& 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<dim>& mg_dof,
 
 template<int dim, typename number>
 void
-MGTools::reinit_vector (const MGDoFHandler<dim>mg_dof,
-                        MGLevelObject<Vector<number> >v,
-                        const std::vector<bool>selected,
-                       const std::vector<unsigned int>target_component)
+MGTools::reinit_vector (const MGDoFHandler<dim> &mg_dof,
+                        MGLevelObject<Vector<number> > &v,
+                        const std::vector<bool> &selected,
+                       const std::vector<unsigned int> &target_component)
 {
   Assert (selected.size() == target_component.size(),
          ExcDimensionMismatch(selected.size(), target_component.size()));
@@ -595,13 +598,13 @@ template void MGTools::reinit_vector<deal_II_dimension> (
 template void MGTools::reinit_vector<deal_II_dimension> (
   const MGDoFHandler<deal_II_dimension>&,
   MGLevelObject<BlockVector<double> >&,
-  const std::vector<bool>,
-  const std::vector<unsigned int>);
+  const std::vector<bool> &,
+  const std::vector<unsigned int> &);
 template void MGTools::reinit_vector<deal_II_dimension> (
   const MGDoFHandler<deal_II_dimension>&,
   MGLevelObject<BlockVector<float> >&,
-  const std::vector<bool>,
-  const std::vector<unsigned int>);
+  const std::vector<bool> &,
+  const std::vector<unsigned int> &);
 
 template void MGTools::reinit_vector<deal_II_dimension> (
   const MGDoFHandler<deal_II_dimension>&,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.