]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Jacobi added for simple vector
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Jul 2004 14:22:26 +0000 (14:22 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Jul 2004 14:22:26 +0000 (14:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@9493 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_sparse_matrix.h

index 5abf9e557553bb2b6e1047f8eea51774ddee1cb2..a4d9869d8bdfe6ddbb1604072ae4786959034670 100644 (file)
@@ -224,6 +224,18 @@ class BlockSparseMatrix : public BlockMatrixBase<SparseMatrix<number> >
     template <class BlockVectorType>
     void precondition_Jacobi (BlockVectorType       &dst,
                              const BlockVectorType &src,
+                             const number           omega = 1.) const;
+
+                                    /**
+                                     * Apply the Jacobi
+                                     * preconditioner to a simple vector.
+                                     *
+                                     * The matrix must be a single
+                                     * square block for this.
+                                   */
+    template <typename number2>
+    void precondition_Jacobi (Vector<number2>       &dst,
+                             const Vector<number2> &src,
                              const number           omega = 1.) const;
 
                                     /**
@@ -346,4 +358,19 @@ precondition_Jacobi (BlockVectorType       &dst,
 }
 
 
+template <typename number>
+template <typename number2>
+void
+BlockSparseMatrix<number>::
+precondition_Jacobi (Vector<number2>       &dst,
+                    const Vector<number2> &src,
+                    const number           omega) const
+{
+//TODO: Insert assertions
+                                   // do a diagonal preconditioning. uses only
+                                   // the diagonal blocks of the matrix
+  this->block(0,0).precondition_Jacobi (dst, src, omega);
+}
+
+
 #endif    // __deal2__block_sparse_matrix_h

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.