]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
works now with offset and certain dofs can be selected
authorjanssen <janssen@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 6 Nov 2011 14:08:19 +0000 (14:08 +0000)
committerjanssen <janssen@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 6 Nov 2011 14:08:19 +0000 (14:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@24725 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/block_list.h

index e738b22243f325f122f9a9680838bc1c418e21a8..0fadbb43b5fcf3dc1c149954f549c4a99b29be9a 100644 (file)
@@ -85,7 +85,8 @@ class BlockList :
                                      */
     void add(unsigned int block,
             const std::vector<unsigned int>& indices,
-            const std::vector<bool>& selected_indices);
+            const std::vector<bool>& selected_indices,
+             unsigned int offset = 0);
 
                                     /**
                                      * Just set up the correct size
@@ -327,7 +328,8 @@ void
 BlockList::add(
   const unsigned int block,
   const std::vector<unsigned int>& indices,
-  const std::vector<bool>& selected)
+  const std::vector<bool>& selected,
+  unsigned int offset)
 {
   AssertIndexRange(block, index_sets.size());
   AssertDimension(indices.size(), selected.size());
@@ -337,9 +339,9 @@ BlockList::add(
       const unsigned int k = indices[i];
       if (k==numbers::invalid_unsigned_int)
        continue;
-      if (selected[i] && std::find(index_sets[block].begin(), index_sets[block].end(), k)
+      if (selected[i] && std::find(index_sets[block].begin(), index_sets[block].end(), k-offset)
          == index_sets[block].end())
-       index_sets[block].push_back(k);
+       index_sets[block].push_back(k-offset);
     }
 }
 
@@ -429,7 +431,7 @@ BlockList::initialize_mg(
       AssertDimension(selected_dofs.size(), cell->get_fe().dofs_per_cell);
 
       cell->get_mg_dof_indices(indices);
-      add(k, indices, selected_dofs);
+      add(k, indices, selected_dofs, offset);
     }
 }
 

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.