From 3811d59a04f8e08de0172a9dbfc57902d1d1ff9c Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 25 Aug 2009 11:00:37 +0000 Subject: [PATCH] The method Jacobi_step now uses vmult and other pre-defined functions instead of implementing the sweep by itselfs. This makes sure that the function gets parallelized by threads. git-svn-id: https://svn.dealii.org/trunk@19336 0785d39b-7218-0410-832d-ea1e28bc413d --- .../lac/include/lac/sparse_matrix.templates.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/deal.II/lac/include/lac/sparse_matrix.templates.h b/deal.II/lac/include/lac/sparse_matrix.templates.h index 439aee252f..374f9173ee 100644 --- a/deal.II/lac/include/lac/sparse_matrix.templates.h +++ b/deal.II/lac/include/lac/sparse_matrix.templates.h @@ -1580,18 +1580,16 @@ SparseMatrix::Jacobi_step (Vector &v, GrowingVectorMemory > mem; typename VectorMemory >::Pointer w(mem); w->reinit(v); - - for (unsigned int row=0; rowrowstart[row]; jrowstart[row+1]; ++j) - { - s -= val[j] * v(cols->colnums[j]); - } - (*w)(row) = v(row) + s * om / val[cols->rowstart[row]]; + vmult (*w, v); + *w -= b; } - for (unsigned int row=0; rowequ (-1.,b); + precondition_Jacobi (*w, *w, om); + v -= *w; } -- 2.39.5