From: hartmann Date: Tue, 18 Feb 2003 10:46:29 +0000 (+0000) Subject: Add initialize function. decompose function is deprecated. Step towards unification... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afbd3c7bc5d5425f3b6b4db9353ad8e0a4dad955;p=dealii-svn.git Add initialize function. decompose function is deprecated. Step towards unification of preconditioners. git-svn-id: https://svn.dealii.org/trunk@7143 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/sparse_ilu.h b/deal.II/lac/include/lac/sparse_ilu.h index 9ff2647f9a..1fb8c8430a 100644 --- a/deal.II/lac/include/lac/sparse_ilu.h +++ b/deal.II/lac/include/lac/sparse_ilu.h @@ -79,6 +79,8 @@ class SparseILU : public SparseLUDecomposition * argument. */ SparseILU (const SparsityPattern &sparsity); + + typedef SparseLUDecomposition::AdditionalData AdditionalData; /** * Perform the incomplete LU @@ -96,7 +98,8 @@ class SparseILU : public SparseLUDecomposition * decomposed. Fill-in is thus * allowed. * - * If @p{strengthen_diagonal} + * If the + * @p{AdditionalData::strengthen_diagonal} * parameter is greater than * zero, this method invokes * @p{get_strengthen_diagonal_impl @@ -108,6 +111,16 @@ class SparseILU : public SparseLUDecomposition * management. */ template + void initialize (const SparseMatrix &matrix, + const AdditionalData parameters); + + /** + * Same as @p{initialize}. This method + * is deprecated, and left for + * backward compability. It may + * be removed in later versions. + */ + template void decompose (const SparseMatrix &matrix, const double strengthen_diagonal=0.); @@ -116,7 +129,6 @@ class SparseILU : public SparseLUDecomposition * is deprecated, and left for * backward compability. It may * be removed in later versions. - * */ template void apply_decomposition (Vector &dst, @@ -175,4 +187,16 @@ SparseILU::apply_decomposition (Vector &dst, vmult (dst, src); } + + +template +template +inline +void SparseILU::decompose (const SparseMatrix &matrix, + const double strengthen_diagonal) +{ + initialize(matrix, AdditionalData(strengthen_diagonal)); +} + + #endif // __deal2__sparse_ilu_h diff --git a/deal.II/lac/include/lac/sparse_ilu.templates.h b/deal.II/lac/include/lac/sparse_ilu.templates.h index 90072d8f93..6728c4dba5 100644 --- a/deal.II/lac/include/lac/sparse_ilu.templates.h +++ b/deal.II/lac/include/lac/sparse_ilu.templates.h @@ -36,19 +36,20 @@ SparseILU::SparseILU (const SparsityPattern &sparsity) : template template -void SparseILU::decompose (const SparseMatrix &matrix, - const double strengthen_diagonal) +void SparseILU::initialize (const SparseMatrix &matrix, + const AdditionalData data) { - SparseLUDecomposition::decompose (matrix, strengthen_diagonal); + SparseLUDecomposition::decompose (matrix, data.strengthen_diagonal); Assert (matrix.m()==matrix.n(), ExcMatrixNotSquare ()); Assert (this->m()==this->n(), ExcMatrixNotSquare ()); Assert (matrix.m()==this->m(), ExcSizeMismatch(matrix.m(), this->m())); - Assert (strengthen_diagonal>=0, ExcInvalidStrengthening (strengthen_diagonal)); + Assert (data.strengthen_diagonal>=0, + ExcInvalidStrengthening (data.strengthen_diagonal)); this->copy_from (matrix); - if (strengthen_diagonal>0) + if (data.strengthen_diagonal>0) this->strengthen_diagonal_impl(); const SparsityPattern &sparsity = this->get_sparsity_pattern();