Reference documentation for deal.II version Git 0183d66 2014-10-17 10:54:07 +0200
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
SparseMIC< number > Class Template Reference

#include <deal.II/lac/sparse_mic.h>

Inheritance diagram for SparseMIC< number >:
[legend]

Public Types

typedef types::global_dof_index size_type
 
typedef SparseLUDecomposition
< number >::AdditionalData 
AdditionalData
 
- Public Types inherited from SparseLUDecomposition< number >
typedef types::global_dof_index size_type
 

Public Member Functions

 SparseMIC ()
 
 SparseMIC (const SparsityPattern &sparsity) DEAL_II_DEPRECATED
 
virtual ~SparseMIC ()
 
virtual void clear ()
 
void reinit (const SparsityPattern &sparsity) DEAL_II_DEPRECATED
 
template<typename somenumber >
void initialize (const SparseMatrix< somenumber > &matrix, const AdditionalData &parameters=AdditionalData())
 
template<typename somenumber >
void decompose (const SparseMatrix< somenumber > &matrix, const double strengthen_diagonal=0.) DEAL_II_DEPRECATED
 
template<typename somenumber >
void vmult (Vector< somenumber > &dst, const Vector< somenumber > &src) const
 
std::size_t memory_consumption () const
 
 DeclException0 (ExcStrengthenDiagonalTooSmall)
 
 DeclException1 (ExcInvalidStrengthening, double,<< "The strengthening parameter "<< arg1<< " is not greater or equal than zero!")
 
 DeclException2 (ExcDecompositionNotStable, int, double,<< "The diagonal element ("<< arg1<<","<< arg1<<") is "<< arg2<<", but must be positive")
 
- Public Member Functions inherited from SparseLUDecomposition< number >
virtual ~SparseLUDecomposition ()=0
 
template<typename somenumber >
void initialize (const SparseMatrix< somenumber > &matrix, const AdditionalData parameters)
 
template<typename somenumber >
void decompose (const SparseMatrix< somenumber > &matrix, const double strengthen_diagonal=0.) DEAL_II_DEPRECATED
 
virtual bool is_decomposed () const DEAL_II_DEPRECATED
 
bool empty () const
 
 DeclException1 (ExcInvalidStrengthening, double,<< "The strengthening parameter "<< arg1<< " is not greater or equal than zero!")
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Member Functions

number get_rowsum (const size_type row) const
 

Private Attributes

std::vector< number > diag
 
std::vector< number > inv_diag
 
std::vector< number > inner_sums
 

Additional Inherited Members

- Protected Types inherited from SparseMatrix< number >
typedef types::global_dof_index size_type
 
typedef number value_type
 
typedef numbers::NumberTraits
< number >::real_type 
real_type
 
typedef
SparseMatrixIterators::Iterator
< number, true > 
const_iterator
 
typedef
SparseMatrixIterators::Iterator
< number, false > 
iterator
 
- Protected Member Functions inherited from SparseLUDecomposition< number >
 SparseLUDecomposition ()
 
 SparseLUDecomposition (const SparsityPattern &sparsity) DEAL_II_DEPRECATED
 
template<typename somenumber >
void copy_from (const SparseMatrix< somenumber > &matrix)
 
virtual void strengthen_diagonal_impl ()
 
virtual number get_strengthen_diagonal (const number rowsum, const size_type row) const
 
- Protected Member Functions inherited from SparseMatrix< number >
void prepare_add ()
 
void prepare_set ()
 
 DeclException2 (ExcInvalidIndex, int, int,<< "The entry with index <"<< arg1<< ','<< arg2<< "> does not exist.")
 
 DeclException1 (ExcInvalidIndex1, int,<< "The index "<< arg1<< " is not in the allowed range.")
 
 DeclException0 (ExcDifferentSparsityPatterns)
 
 DeclException2 (ExcIteratorRange, int, int,<< "The iterators denote a range of "<< arg1<< " elements, but the given number of rows was "<< arg2)
 
 DeclException0 (ExcSourceEqualsDestination)
 
 SparseMatrix ()
 
 SparseMatrix (const SparseMatrix &)
 
 SparseMatrix (const SparsityPattern &sparsity)
 
 SparseMatrix (const SparsityPattern &sparsity, const IdentityMatrix &id)
 
virtual ~SparseMatrix ()
 
SparseMatrix< number > & operator= (const SparseMatrix< number > &)
 
SparseMatrix< number > & operator= (const IdentityMatrix &id)
 
SparseMatrixoperator= (const double d)
 
bool empty () const
 
size_type m () const
 
size_type n () const
 
size_type get_row_length (const size_type row) const
 
size_type n_nonzero_elements () const
 
size_type n_actually_nonzero_elements (const double threshold=0.) const
 
const SparsityPatternget_sparsity_pattern () const
 
std::size_t memory_consumption () const
 
void compress (::VectorOperation::values)
 
void set (const size_type i, const size_type j, const number value)
 
template<typename number2 >
void set (const std::vector< size_type > &indices, const FullMatrix< number2 > &full_matrix, const bool elide_zero_values=false)
 
template<typename number2 >
void set (const std::vector< size_type > &row_indices, const std::vector< size_type > &col_indices, const FullMatrix< number2 > &full_matrix, const bool elide_zero_values=false)
 
template<typename number2 >
void set (const size_type row, const std::vector< size_type > &col_indices, const std::vector< number2 > &values, const bool elide_zero_values=false)
 
template<typename number2 >
void set (const size_type row, const size_type n_cols, const size_type *col_indices, const number2 *values, const bool elide_zero_values=false)
 
void add (const size_type i, const size_type j, const number value)
 
template<typename number2 >
void add (const std::vector< size_type > &indices, const FullMatrix< number2 > &full_matrix, const bool elide_zero_values=true)
 
template<typename number2 >
void add (const std::vector< size_type > &row_indices, const std::vector< size_type > &col_indices, const FullMatrix< number2 > &full_matrix, const bool elide_zero_values=true)
 
template<typename number2 >
void add (const size_type row, const std::vector< size_type > &col_indices, const std::vector< number2 > &values, const bool elide_zero_values=true)
 
template<typename number2 >
void add (const size_type row, const size_type n_cols, const size_type *col_indices, const number2 *values, const bool elide_zero_values=true, const bool col_indices_are_sorted=false)
 
SparseMatrixoperator*= (const number factor)
 
SparseMatrixoperator/= (const number factor)
 
void symmetrize ()
 
template<typename somenumber >
SparseMatrix< number > & copy_from (const SparseMatrix< somenumber > &source)
 
template<typename ForwardIterator >
void copy_from (const ForwardIterator begin, const ForwardIterator end)
 
template<typename somenumber >
void copy_from (const FullMatrix< somenumber > &matrix)
 
SparseMatrix< number > & copy_from (const TrilinosWrappers::SparseMatrix &matrix)
 
template<typename somenumber >
void add (const number factor, const SparseMatrix< somenumber > &matrix)
 
number operator() (const size_type i, const size_type j) const
 
number el (const size_type i, const size_type j) const
 
number diag_element (const size_type i) const
 
number & diag_element (const size_type i)
 
number raw_entry (const size_type row, const size_type index) const DEAL_II_DEPRECATED
 
number global_entry (const size_type i) const DEAL_II_DEPRECATED
 
number & global_entry (const size_type i) DEAL_II_DEPRECATED
 
template<class OutVector , class InVector >
void vmult (OutVector &dst, const InVector &src) const
 
template<class OutVector , class InVector >
void Tvmult (OutVector &dst, const InVector &src) const
 
template<class OutVector , class InVector >
void vmult_add (OutVector &dst, const InVector &src) const
 
template<class OutVector , class InVector >
void Tvmult_add (OutVector &dst, const InVector &src) const
 
template<typename somenumber >
somenumber matrix_norm_square (const Vector< somenumber > &v) const
 
template<typename somenumber >
somenumber matrix_scalar_product (const Vector< somenumber > &u, const Vector< somenumber > &v) const
 
template<typename somenumber >
somenumber residual (Vector< somenumber > &dst, const Vector< somenumber > &x, const Vector< somenumber > &b) const
 
template<typename numberB , typename numberC >
void mmult (SparseMatrix< numberC > &C, const SparseMatrix< numberB > &B, const Vector< number > &V=Vector< number >(), const bool rebuild_sparsity_pattern=true) const
 
template<typename numberB , typename numberC >
void Tmmult (SparseMatrix< numberC > &C, const SparseMatrix< numberB > &B, const Vector< number > &V=Vector< number >(), const bool rebuild_sparsity_pattern=true) const
 
real_type l1_norm () const
 
real_type linfty_norm () const
 
real_type frobenius_norm () const
 
template<typename somenumber >
void precondition_Jacobi (Vector< somenumber > &dst, const Vector< somenumber > &src, const number omega=1.) const
 
template<typename somenumber >
void precondition_SSOR (Vector< somenumber > &dst, const Vector< somenumber > &src, const number omega=1., const std::vector< std::size_t > &pos_right_of_diagonal=std::vector< std::size_t >()) const
 
template<typename somenumber >
void precondition_SOR (Vector< somenumber > &dst, const Vector< somenumber > &src, const number om=1.) const
 
template<typename somenumber >
void precondition_TSOR (Vector< somenumber > &dst, const Vector< somenumber > &src, const number om=1.) const
 
template<typename somenumber >
void SSOR (Vector< somenumber > &v, const number omega=1.) const
 
template<typename somenumber >
void SOR (Vector< somenumber > &v, const number om=1.) const
 
template<typename somenumber >
void TSOR (Vector< somenumber > &v, const number om=1.) const
 
template<typename somenumber >
void PSOR (Vector< somenumber > &v, const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation, const number om=1.) const
 
template<typename somenumber >
void TPSOR (Vector< somenumber > &v, const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation, const number om=1.) const
 
template<typename somenumber >
void Jacobi_step (Vector< somenumber > &v, const Vector< somenumber > &b, const number om=1.) const
 
template<typename somenumber >
void SOR_step (Vector< somenumber > &v, const Vector< somenumber > &b, const number om=1.) const
 
template<typename somenumber >
void TSOR_step (Vector< somenumber > &v, const Vector< somenumber > &b, const number om=1.) const
 
template<typename somenumber >
void SSOR_step (Vector< somenumber > &v, const Vector< somenumber > &b, const number om=1.) const
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin (const size_type r) const
 
const_iterator end (const size_type r) const
 
iterator begin (const size_type r)
 
iterator end (const size_type r)
 
template<class STREAM >
void print (STREAM &out, const bool across=false, const bool diagonal_first=true) const
 
void print_formatted (std::ostream &out, const unsigned int precision=3, const bool scientific=true, const unsigned int width=0, const char *zero_string=" ", const double denominator=1.) const
 
void print_pattern (std::ostream &out, const double threshold=0.) const
 
void block_write (std::ostream &out) const
 
void block_read (std::istream &in)
 
- Protected Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
- Protected Attributes inherited from SparseLUDecomposition< number >
bool decomposed
 
double strengthen_diagonal
 
std::vector< const size_type * > prebuilt_lower_bound
 

Detailed Description

template<typename number>
class SparseMIC< number >

Modified incomplete Cholesky (MIC(0)) preconditioner. This class conforms to the state and usage specification in SparseLUDecomposition.

The decomposition

Let a sparse matrix \(A\) be in the form \(A = - L - U + D\), where \(-L\) and \(-U\) are strictly lower and upper triangular matrices. The MIC(0) decomposition of the matrix \(A\) is defined by \(B = (X-L)X^(-1)(X-U)\), where \(X\) is a diagonal matrix, defined by the condition \(\text{rowsum}(A) = \text{rowsum}(B)\).

Author
Stephen "Cheffo" Kolaroff, 2002, unified interface: Ralf Hartmann 2003.

Definition at line 46 of file sparse_mic.h.

Member Typedef Documentation

template<typename number >
typedef types::global_dof_index SparseMIC< number >::size_type

Declare type for container size.

Definition at line 52 of file sparse_mic.h.

template<typename number >
typedef SparseLUDecomposition<number>::AdditionalData SparseMIC< number >::AdditionalData

Make the AdditionalData type in the base class accessible to this class as well.

Definition at line 90 of file sparse_mic.h.

Constructor & Destructor Documentation

template<typename number >
SparseMIC< number >::SparseMIC ( )

Constructor. Does nothing, so you have to call decompose sometimes afterwards.

template<typename number >
SparseMIC< number >::SparseMIC ( const SparsityPattern sparsity)
Deprecated:
This method is deprecated, and left for backward compatibility. It will be removed in later versions. Instead, pass the sparsity pattern that you want used for the decomposition in the AdditionalData structure.
template<typename number >
virtual SparseMIC< number >::~SparseMIC ( )
virtual

Destructor.

Member Function Documentation

template<typename number >
virtual void SparseMIC< number >::clear ( )
virtual

Deletes all member variables. Leaves the class in the state that it had directly after calling the constructor

Reimplemented from SparseLUDecomposition< number >.

template<typename number >
void SparseMIC< number >::reinit ( const SparsityPattern sparsity)
virtual
Deprecated:
This method is deprecated, and left for backward compatibility. It will be removed in later versions.

Reimplemented from SparseLUDecomposition< number >.

template<typename number >
template<typename somenumber >
void SparseMIC< number >::initialize ( const SparseMatrix< somenumber > &  matrix,
const AdditionalData parameters = AdditionalData() 
)

Perform the incomplete LU factorization of the given matrix.

This function needs to be called before an object of this class is used as preconditioner.

For more details about possible parameters, see the class documentation of SparseLUDecomposition and the documentation of the SparseLUDecomposition::AdditionalData class.

According to the parameters, this function creates a new SparsityPattern or keeps the previous sparsity or takes the sparsity given by the user to data. Then, this function performs the MIC decomposition.

After this function is called the preconditioner is ready to be used.

template<typename number >
template<typename somenumber >
void SparseMIC< number >::decompose ( const SparseMatrix< somenumber > &  matrix,
const double  strengthen_diagonal = 0. 
)
Deprecated:
This method is deprecated, and left for backward compability. It will be removed in later versions. Use initialize() instead.
template<typename number >
template<typename somenumber >
void SparseMIC< number >::vmult ( Vector< somenumber > &  dst,
const Vector< somenumber > &  src 
) const

Apply the incomplete decomposition, i.e. do one forward-backward step \(dst=(LU)^{-1}src\).

Call initialize before calling this function.

template<typename number >
std::size_t SparseMIC< number >::memory_consumption ( ) const
virtual

Determine an estimate for the memory consumption (in bytes) of this object.

Reimplemented from SparseLUDecomposition< number >.

template<typename number >
number SparseMIC< number >::get_rowsum ( const size_type  row) const
private

Compute the row-th "inner sum".

Member Data Documentation

template<typename number >
std::vector<number> SparseMIC< number >::diag
private

Values of the computed diagonal.

Definition at line 190 of file sparse_mic.h.

template<typename number >
std::vector<number> SparseMIC< number >::inv_diag
private

Inverses of the the diagonal: precomputed for faster vmult.

Definition at line 196 of file sparse_mic.h.

template<typename number >
std::vector<number> SparseMIC< number >::inner_sums
private

Values of the computed "inner sums", i.e. per-row sums of the elements laying on the right side of the diagonal.

Definition at line 204 of file sparse_mic.h.


The documentation for this class was generated from the following file: