]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Wolfgang's changes reverted; were not helpful and need further iscussion
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 1 Sep 2004 17:04:56 +0000 (17:04 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 1 Sep 2004 17:04:56 +0000 (17:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@9604 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 7c2a46105a47d5e038d9625c4a078a41527ff228..5b1271df7cc6a4f271d88ccb11c5dee884a21012 100644 (file)
@@ -185,7 +185,6 @@ class MGTools
                     const std::vector<bool>& selected = std::vector<bool>(),
                     const std::vector<unsigned int>& target_component
                     = std::vector<unsigned int>());
-
                                     /**
                                      * 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<Vector<number> > &v,
                     const std::vector<bool> &selected,
                     const std::vector<unsigned int> &target_component,
-                    const std::vector<std::vector<unsigned int> >& cached_sizes
+                    std::vector<std::vector<unsigned int> >& cached_sizes
                     = std::vector<std::vector<unsigned int> >());
 };
 
index 2ce07b5122452aa0e8900e26bd8520ca6ead07e3..268613979e4a737b8b5ca1c1ffb997162bf4bcab 100644 (file)
@@ -20,7 +20,6 @@
 #include <lac/compressed_sparsity_pattern.h>
 #include <lac/sparsity_pattern.h>
 #include <lac/block_vector.h>
-#include <lac/vector.h>
 #include <grid/tria.h>
 #include <grid/tria_iterator.h>
 #include <multigrid/mg_dof_handler.h>
@@ -465,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,
-                       const std::vector<std::vector<unsigned int> >& cached_dofs)
+                       std::vector<std::vector<unsigned int> >& ndofs)
 {
   Assert (selected.size() == target_component.size(),
          ExcDimensionMismatch(selected.size(), target_component.size()));
@@ -483,19 +482,19 @@ MGTools::reinit_vector (const MGDoFHandler<dim> &mg_dof,
   while (!selected[selected_block])
     ++selected_block;
 
-  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;
+  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);
+    }
   
   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<deal_II_dimension> (
   MGLevelObject<Vector<double> >&,
   const std::vector<bool>&,
   const std::vector<unsigned int>&,
-  const std::vector<std::vector<unsigned int> >&);
+  std::vector<std::vector<unsigned int> >&);
 template void MGTools::reinit_vector<deal_II_dimension> (
   const MGDoFHandler<deal_II_dimension>&,
   MGLevelObject<Vector<float> >&,
   const std::vector<bool>&,
   const std::vector<unsigned int>&,
-  const std::vector<std::vector<unsigned int> >&);
+  std::vector<std::vector<unsigned int> >&);
 
 
 template void MGTools::count_dofs_per_component<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.