]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Vanka ok for Stokes
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 7 Jul 1999 18:18:15 +0000 (18:18 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 7 Jul 1999 18:18:15 +0000 (18:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@1551 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparse_vanka.h
deal.II/lac/include/lac/sparse_vanka.templates.h

index 9b3537280eeb66e8de989c73b3ddd1ee1cf30042..5162ad8673d6b902cdadb91b861569c5a1b0bf06 100644 (file)
@@ -7,7 +7,7 @@
 #include <base/smartpointer.h>
 #include <lac/forward-declarations.h>
 
-#include <vector>
+#include <bvector.h>
 
 /**
  * Point-wise Vanka preconditioning.
@@ -37,17 +37,18 @@ class SparseVanka
 {
   public:
                                     /**
-                                     * Constructor.
-                                     * Take a vector of the indices
-                                     * of the Lagrange multiplier as
-                                     * argument. A reference to this
-                                     * vector will be stored, so it
-                                     * must persist longer than the
-                                     * Vanka object. The same is true
-                                     * for the matrix.
+                                     * Constructor. Gets the matrix
+                                     * for preconditioning and a bit
+                                     * vector with entries #true# for
+                                     * all rows to be updated. A
+                                     * reference to this vector will
+                                     * be stored, so it must persist
+                                     * longer than the Vanka
+                                     * object. The same is true for
+                                     * the matrix.
                                      */
     SparseVanka(const SparseMatrix<number>& M,
-               const vector<int>& indices);
+               const bit_vector& selected);
                                     /**
                                      * Do the preconditioning. This
                                      * function contains a dispatch
@@ -89,7 +90,7 @@ class SparseVanka
                                      * Indices of Lagrange
                                      * multipliers.
                                      */
-    const vector<int>& indices;
+    const bit_vector& selected;
 };
 
 template<typename number>
index be64dbd95560615144caaad1cf477271dccb923f..fcf03faafda0a4bf8e1e229d6436affe4e010428 100644 (file)
@@ -8,9 +8,9 @@
 
 template<typename number>
 SparseVanka<number>::SparseVanka(const SparseMatrix<number>& M,
-                                const vector<int>& indices)
+                                const bit_vector& selected)
                :
-               matrix(&M), indices(indices)
+               matrix(&M), selected(selected)
 {}
 
 template<typename number>
@@ -19,15 +19,17 @@ void
 SparseVanka<number>::forward(Vector<number2>& dst,
                           const Vector<number2>& src) const
 {
-  for (unsigned int global_i=0; global_i<indices.size() ; ++global_i)
+  for (unsigned int row=0; row< matrix->m() ; ++row)
     {
-      unsigned int row = indices[global_i];
+      if (!selected[row])
+       continue;
+      
       const SparseMatrixStruct& structure = matrix->get_sparsity_pattern();
       unsigned int n = structure.row_length(row);
       
-      FullMatrix<number> A(n);
-      Vector<number> b(n);
-      Vector<number> x(n);
+      FullMatrix<float> A(n);
+      Vector<float> b(n);
+      Vector<float> x(n);
       
       map<unsigned int, unsigned int> local_index;
 

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.