00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __deal2__sparse_mic_h
00012 #define __deal2__sparse_mic_h
00013
00014 #include <deal.II/lac/sparse_matrix.h>
00015 #include <deal.II/lac/sparse_decomposition.h>
00016
00017 DEAL_II_NAMESPACE_OPEN
00018
00040 template <typename number>
00041 class SparseMIC : public SparseLUDecomposition<number>
00042 {
00043 public:
00049 SparseMIC ();
00050
00057 SparseMIC (const SparsityPattern &sparsity);
00058
00062 virtual ~SparseMIC();
00063
00070 virtual void clear();
00071
00078 typedef
00079 typename SparseLUDecomposition<number>::AdditionalData
00080 AdditionalData;
00081
00088 void reinit (const SparsityPattern &sparsity);
00089
00093 template <typename somenumber>
00094 void initialize (const SparseMatrix<somenumber> &matrix,
00095 const AdditionalData parameters);
00096
00103 template <typename somenumber>
00104 void decompose (const SparseMatrix<somenumber> &matrix,
00105 const double strengthen_diagonal=0.);
00106
00115 template <typename somenumber>
00116 void vmult (Vector<somenumber> &dst,
00117 const Vector<somenumber> &src) const;
00118
00124 std::size_t memory_consumption () const;
00125
00132 DeclException0 (ExcStrengthenDiagonalTooSmall);
00136 DeclException1 (ExcInvalidStrengthening,
00137 double,
00138 << "The strengthening parameter " << arg1
00139 << " is not greater or equal than zero!");
00143 DeclException2(ExcDecompositionNotStable, int, double,
00144 << "The diagonal element (" <<arg1<<","<<arg1<<") is "
00145 << arg2 <<", but must be positive");
00146
00148 private:
00153 std::vector<number> diag;
00154
00159 std::vector<number> inv_diag;
00160
00167 std::vector<number> inner_sums;
00168
00173 number get_rowsum (const unsigned int row) const;
00174 };
00175
00178 DEAL_II_NAMESPACE_CLOSE
00179
00180 #endif // __deal2__
00181