include/deal.II/lac/sparse_mic.h

00001 //---------------------------------------------------------------------------
00002 //    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
00003 //    by the deal.II authors and Stephen "Cheffo" Kolaroff
00004 //
00005 //    This file is subject to QPL and may not be  distributed
00006 //    without copyright and license information. Please refer
00007 //    to the file deal.II/doc/license.html for the  text  and
00008 //    further information on this license.
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 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Wed May 23 2012 06:07:40 by doxygen 1.7.3