]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
make_cell_pathes with offset and selection of certain dofs
authorjanssen <janssen@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 6 Nov 2011 15:44:11 +0000 (15:44 +0000)
committerjanssen <janssen@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 6 Nov 2011 15:44:11 +0000 (15:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@24730 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/dofs/dof_tools.h
deal.II/source/dofs/dof_tools.cc
deal.II/source/dofs/dof_tools.inst.in

index ff900bc669bae959d7b2c2ca7a774424b39579ce..bc9870f6c1a597b6af9f2ac80a3c0ccc5a51d512 100644 (file)
@@ -1488,7 +1488,9 @@ namespace DoFTools
   template <class DH, class Sparsity>
   void make_cell_patches(Sparsity& block_list,
                         const DH& dof_handler,
-                        const unsigned int level);
+                        const unsigned int level, 
+                         const std::vector<bool>& selected_dofs = std::vector<bool>(), 
+                         unsigned int offset = 0);
   
                                    /**
                                     * Create a sparsity pattern which
index e503a985b209e5adce713000ced1236153e2384b..560e752a660ef0672d3181cc90ece1d1cc264e67 100644 (file)
@@ -5861,7 +5861,12 @@ namespace DoFTools
   }
 
   template <class DH, class Sparsity>
-  void make_cell_patches(Sparsity& block_list, const DH& dof_handler, const unsigned int level)
+  void make_cell_patches(
+      Sparsity& block_list, 
+      const DH& dof_handler, 
+      const unsigned int level, 
+      const std::vector<bool>& selected_dofs, 
+      unsigned int offset)
   {
     typename DH::cell_iterator cell;
     typename DH::cell_iterator endc = dof_handler.end(level);
@@ -5872,8 +5877,20 @@ namespace DoFTools
       {
        indices.resize(cell->get_fe().dofs_per_cell);
        cell->get_mg_dof_indices(indices);
-       for (unsigned int j=0;j<indices.size();++j)
-         block_list.add(i,indices[j]);
+
+        if(selected_dofs.size()!=0)
+          AssertDimension(indices.size(), selected_dofs.size());
+       
+        for (unsigned int j=0;j<indices.size();++j)
+        {
+          if(selected_dofs.size() == 0)
+            block_list.add(i,indices[j]-offset);
+          else
+          {
+            if(selected_dofs[j])
+              block_list.add(i,indices[j]-offset);
+          }
+        }
       }
   }
   
index 89208ce335df26a8bc43c372ee59b78df18a403b..866832b649cea8ee89e904468fe6001c77177a1b 100644 (file)
@@ -116,7 +116,7 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
 
     template void
       DoFTools::make_cell_patches<MGDoFHandler<deal_II_dimension>,SP>
-      (SP&, const MGDoFHandler<deal_II_dimension>&, unsigned int);
+      (SP&, const MGDoFHandler<deal_II_dimension>&, unsigned int, const std::vector<bool>&, unsigned int);
 
 #if deal_II_dimension > 1
 

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.