From 5fd735767a90933165d392ab30357b3fdc3c74a2 Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 7 Jul 1999 18:18:15 +0000 Subject: [PATCH] Vanka ok for Stokes git-svn-id: https://svn.dealii.org/trunk@1551 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/sparse_vanka.h | 23 ++++++++++--------- .../lac/include/lac/sparse_vanka.templates.h | 16 +++++++------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/deal.II/lac/include/lac/sparse_vanka.h b/deal.II/lac/include/lac/sparse_vanka.h index 9b3537280e..5162ad8673 100644 --- a/deal.II/lac/include/lac/sparse_vanka.h +++ b/deal.II/lac/include/lac/sparse_vanka.h @@ -7,7 +7,7 @@ #include #include -#include +#include /** * 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& M, - const vector& 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& indices; + const bit_vector& selected; }; template diff --git a/deal.II/lac/include/lac/sparse_vanka.templates.h b/deal.II/lac/include/lac/sparse_vanka.templates.h index be64dbd955..fcf03faafd 100644 --- a/deal.II/lac/include/lac/sparse_vanka.templates.h +++ b/deal.II/lac/include/lac/sparse_vanka.templates.h @@ -8,9 +8,9 @@ template SparseVanka::SparseVanka(const SparseMatrix& M, - const vector& indices) + const bit_vector& selected) : - matrix(&M), indices(indices) + matrix(&M), selected(selected) {} template @@ -19,15 +19,17 @@ void SparseVanka::forward(Vector& dst, const Vector& src) const { - for (unsigned int global_i=0; global_im() ; ++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 A(n); - Vector b(n); - Vector x(n); + FullMatrix A(n); + Vector b(n); + Vector x(n); map local_index; -- 2.39.5