]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Unnamed temporary variables can't be bound to non-const references.
authordeal <deal@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 31 Aug 2004 22:43:39 +0000 (22:43 +0000)
committerdeal <deal@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 31 Aug 2004 22:43:39 +0000 (22:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@9601 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 5b1271df7cc6a4f271d88ccb11c5dee884a21012..bdfce7388e975fe16a4de4fbe3b6b41495b9c887 100644 (file)
@@ -217,7 +217,7 @@ class MGTools
                     MGLevelObject<Vector<number> > &v,
                     const std::vector<bool> &selected,
                     const std::vector<unsigned int> &target_component,
-                    std::vector<std::vector<unsigned int> >& cached_sizes
+                    const std::vector<std::vector<unsigned int> >& cached_sizes
                     = std::vector<std::vector<unsigned int> >());
 };
 
index 268613979e4a737b8b5ca1c1ffb997162bf4bcab..c0997f0025abfa73ce15bbf6ac31ce1764d889b5 100644 (file)
@@ -464,7 +464,7 @@ MGTools::reinit_vector (const MGDoFHandler<dim> &mg_dof,
                         MGLevelObject<Vector<number> > &v,
                         const std::vector<bool> &selected,
                        const std::vector<unsigned int> &target_component,
-                       std::vector<std::vector<unsigned int> >& ndofs)
+                       const std::vector<std::vector<unsigned int> >& cached_dofs)
 {
   Assert (selected.size() == target_component.size(),
          ExcDimensionMismatch(selected.size(), target_component.size()));
@@ -482,19 +482,19 @@ MGTools::reinit_vector (const MGDoFHandler<dim> &mg_dof,
   while (!selected[selected_block])
     ++selected_block;
 
-  if (ndofs.size() == 0)
-    {
-      std::vector<std::vector<unsigned int> >
-       new_dofs(mg_dof.get_tria().n_levels(),
-                std::vector<unsigned int>(target_component.size()));
-      std::swap(ndofs, new_dofs);
-      count_dofs_per_component (mg_dof, ndofs, target_component);
-    }
+  std::vector<std::vector<unsigned int> >
+    n_dofs(mg_dof.get_tria().n_levels(),
+          std::vector<unsigned int>(target_component.size()));
+
+  if (cached_dofs.size() == 0)
+    count_dofs_per_component (mg_dof, n_dofs, target_component);
+  else
+    n_dofs = cached_dofs;
   
   for (unsigned int level=v.get_minlevel();
        level<=v.get_maxlevel();++level)
     {
-      v[level].reinit(ndofs[level][selected_block]);
+      v[level].reinit(n_dofs[level][selected_block]);
     }
 }
 

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.