Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ug::LU< TAlgebra > Class Template Reference

#include <lu.h>

+ Inheritance diagram for ug::LU< TAlgebra >:

Public Types

typedef TAlgebra algebra_type
 Algebra type.
 
typedef IMatrixOperatorInverse< matrix_type, vector_typebase_type
 Base type.
 
typedef TAlgebra::matrix_type matrix_type
 Matrix type.
 
typedef TAlgebra::vector_type vector_type
 Vector type.
 
- Public Types inherited from ug::IMatrixOperatorInverse< TAlgebra::matrix_type, TAlgebra::vector_type >
typedef TAlgebra::vector_type codomain_function_type
 Range space.
 
typedef TAlgebra::vector_type domain_function_type
 Domain space.
 
typedef TAlgebra::matrix_type matrix_type
 Matrix type.
 
- Public Types inherited from ug::ILinearOperatorInverse< X, Y >
typedef Y codomain_function_type
 Range space.
 
typedef X domain_function_type
 Domain space.
 
- Public Types inherited from ug::ILinearIterator< X, Y >
typedef Y codomain_function_type
 Range space.
 
typedef X domain_function_type
 Domain space.
 

Public Member Functions

virtual bool apply (vector_type &u, const vector_type &f)
 Compute u = L^{-1} * f.
 
bool apply_lu (vector_type &x, const vector_type &b)
 
virtual bool apply_return_defect (vector_type &u, vector_type &f)
 Compute u = L^{-1} * f AND return defect f := f - L*u.
 
virtual std::string config_string () const
 returns information about configuration parameters
 
virtual bool init (SmartPtr< ILinearOperator< Y, X > > A)
 initializes this inverse operator for a linear operator
 
virtual bool init (SmartPtr< ILinearOperator< Y, X > > A, const Y &u)
 initializes this inverse operator for a linear operator
 
virtual bool init (SmartPtr< MatrixOperator< M, Y, X > > A)=0
 initializes this inverse operator for a matrix-based operator
 
virtual bool init (SmartPtr< MatrixOperator< matrix_type, vector_type > > Op)
 set operator L, that will be inverted
 
bool init_lu (const matrix_type *pA)
 initializes the solver for a matrix A
 
 LU ()
 constructor
 
virtual const char * name () const
 returns the name of the operator inverse
 
void set_info (bool b)
 
void set_minimum_for_sparse (size_t N)
 
void set_show_progress (bool b)
 
void set_sort_sparse (bool b)
 
virtual bool supports_parallel () const
 returns if parallel solving is supported
 
virtual ~LU ()
 Destructor.
 
- Public Member Functions inherited from ug::IMatrixOperatorInverse< TAlgebra::matrix_type, TAlgebra::vector_type >
virtual bool init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > A)
 initializes this inverse operator for a linear operator
 
virtual bool init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > A, const TAlgebra::vector_type &u)
 initializes this inverse operator for a linear operator
 
virtual bool init (SmartPtr< MatrixOperator< TAlgebra::matrix_type, TAlgebra::vector_type, TAlgebra::vector_type > > A)=0
 initializes this inverse operator for a matrix-based operator
 
virtual ~IMatrixOperatorInverse ()
 virtual destructor
 
- Public Member Functions inherited from ug::ILinearOperatorInverse< X, Y >
virtual bool apply (Y &u, const X &f)=0
 applies inverse operator, i.e. returns u = A^{-1} f
 
virtual bool apply_return_defect (Y &u, X &f)=0
 applies inverse operator, i.e. returns u = A^{-1} f and returns defect d := f - A*u
 
virtual bool apply_update_defect (Y &u, X &f)
 compute new correction c = B*d and update defect d := d - A*c
 
virtual SmartPtr< ILinearIterator< X, Y > > clone ()
 clone
 
SmartPtr< IConvergenceCheck< X > > convergence_check ()
 returns the convergence check
 
ConstSmartPtr< IConvergenceCheck< X > > convergence_check () const
 returns the convergence check
 
number defect () const
 returns the current defect
 
 ILinearOperatorInverse ()
 constructor setting convergence check to (100, 1e-12, 1e-12, true)
 
 ILinearOperatorInverse (SmartPtr< IConvergenceCheck< X > > spConvCheck)
 Default constructor.
 
SmartPtr< ILinearOperator< Y, X > > linear_operator ()
 returns the current Operator this Inverse Operator is initialized for
 
number reduction () const
 returns the current relative reduction
 
void set_convergence_check (SmartPtr< IConvergenceCheck< X > > spConvCheck)
 set the convergence check
 
virtual int standard_offset () const
 returns the standard offset for output
 
int step () const
 returns the current number of steps
 
virtual ~ILinearOperatorInverse ()
 virtual destructor
 
- Public Member Functions inherited from ug::ILinearIterator< X, Y >
SmartPtr< IDamping< X, Y > > damping ()
 returns the scaling
 
 ILinearIterator ()
 constructor
 
 ILinearIterator (const ILinearIterator< X, Y > &parent)
 copy constructor
 
void set_damp (number factor)
 sets the damping to a constant factor
 
void set_damp (SmartPtr< IDamping< X, Y > > spScaling)
 sets a scaling for the correction
 
virtual ~ILinearIterator ()
 virtual destructor
 

Protected Attributes

SmartPtr< ILUTScalarPreconditioner< algebra_type > > ilut_scalar
 
CPUAlgebra::vector_type m_b
 
bool m_bDense
 
bool m_bInfo
 
bool m_bShowProgress
 
bool m_bSortSparse
 
size_t m_iMinimumForSparse
 
DenseMatrixInverse< DenseMatrix< VariableArray2< double > > > m_mat
 inverse
 
const matrix_typem_pMatrix
 matrix to invert
 
size_t m_size
 
SmartPtr< MatrixOperator< matrix_type, vector_type > > m_spOperator
 Operator to invert.
 
DenseVector< VariableArray1< double > > m_tmp
 
CPUAlgebra::vector_type m_u
 
- Protected Attributes inherited from ug::ILinearOperatorInverse< X, Y >
SmartPtr< IConvergenceCheck< X > > m_spConvCheck
 smart pointer holding the convergence check
 
SmartPtr< ILinearOperator< Y, X > > m_spLinearOperator
 Operator that is inverted by this Inverse Operator.
 
- Protected Attributes inherited from ug::ILinearIterator< X, Y >
SmartPtr< IDamping< X, Y > > m_spDamping
 the scaling
 

Private Member Functions

bool init_dense (const matrix_type &A)
 returns name of solver
 
bool init_sparse (const matrix_type &A)
 
void init_var (const matrix_type &A)
 
void print_info (const matrix_type &A)
 
bool solve_dense (vector_type &x, const vector_type &b)
 
bool solve_sparse (vector_type &x, const vector_type &b)
 

Member Typedef Documentation

◆ algebra_type

template<typename TAlgebra >
typedef TAlgebra ug::LU< TAlgebra >::algebra_type

Algebra type.

◆ base_type

template<typename TAlgebra >
typedef IMatrixOperatorInverse<matrix_type,vector_type> ug::LU< TAlgebra >::base_type

Base type.

◆ matrix_type

template<typename TAlgebra >
typedef TAlgebra::matrix_type ug::LU< TAlgebra >::matrix_type

Matrix type.

◆ vector_type

template<typename TAlgebra >
typedef TAlgebra::vector_type ug::LU< TAlgebra >::vector_type

Vector type.

Constructor & Destructor Documentation

◆ LU()

template<typename TAlgebra >
ug::LU< TAlgebra >::LU ( )
inline

constructor

References ug::LU< TAlgebra >::m_iMinimumForSparse.

◆ ~LU()

template<typename TAlgebra >
virtual ug::LU< TAlgebra >::~LU ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ apply()

◆ apply_lu()

◆ apply_return_defect()

template<typename TAlgebra >
virtual bool ug::LU< TAlgebra >::apply_return_defect ( vector_type u,
vector_type f 
)
inlinevirtual

◆ config_string()

template<typename TAlgebra >
virtual std::string ug::LU< TAlgebra >::config_string ( ) const
inlinevirtual

returns information about configuration parameters

this should return necessary information about parameters and possibly calling config_string of subcomponents.

Returns
std::string necessary information about configuration parameters

Reimplemented from ug::ILinearOperatorInverse< X, Y >.

References ug::LU< TAlgebra >::m_iMinimumForSparse.

◆ init() [1/4]

template<typename TAlgebra >
virtual bool ug::IMatrixOperatorInverse< M, X, Y >::init ( SmartPtr< ILinearOperator< Y, X > >  A)
inlinevirtual

initializes this inverse operator for a linear operator

This method implements the ILinearOperatorInverse interface method. Basically, the request is forwarded to the matrix-based init method, if the the operator is matrix-based. If the operator is not matrix-based this inverse can not be used and false is returned

Parameters
[in]Alinear matrix-based operator to invert
Returns
bool success flag

Reimplemented from ug::ILinearOperatorInverse< X, Y >.

◆ init() [2/4]

template<typename TAlgebra >
virtual bool ug::IMatrixOperatorInverse< M, X, Y >::init ( SmartPtr< ILinearOperator< Y, X > >  A,
const Y &  u 
)
inlinevirtual

initializes this inverse operator for a linear operator

This method implements the ILinearOperatorInverse interface method. Basically, the request is forwarded to the matrix-based init method, if the the operator is matrix-based. If the operator is not matrix-based this inverse can not be used and false is returned

Parameters
[in]Alinear matrix-based operator to invert
[in]ulinearization point
Returns
bool success flag

Reimplemented from ug::ILinearOperatorInverse< X, Y >.

◆ init() [3/4]

template<typename TAlgebra >
virtual bool ug::IMatrixOperatorInverse< M, X, Y >::init ( SmartPtr< MatrixOperator< M, Y, X > >  A)

initializes this inverse operator for a matrix-based operator

This method passes the operator A that is inverted by this operator. In addition some preparation step can be made.

Parameters
[in]Alinear matrix-basewd operator to invert
Returns
bool success flag

◆ init() [4/4]

template<typename TAlgebra >
virtual bool ug::LU< TAlgebra >::init ( SmartPtr< MatrixOperator< matrix_type, vector_type > >  Op)
inlinevirtual

◆ init_dense()

◆ init_lu()

◆ init_sparse()

◆ init_var()

template<typename TAlgebra >
void ug::LU< TAlgebra >::init_var ( const matrix_type A)
inlineprivate

References UG_ASSERT.

Referenced by ug::LU< TAlgebra >::init_lu().

◆ name()

template<typename TAlgebra >
virtual const char * ug::LU< TAlgebra >::name ( ) const
inlinevirtual

returns the name of the operator inverse

This method returns the name of the inverse operator. This function is typically needed, when the inverse operator is used inside of another and some debug output should be printed

Returns
const char* name of inverse operator

Implements ug::ILinearOperatorInverse< X, Y >.

◆ print_info()

template<typename TAlgebra >
void ug::LU< TAlgebra >::print_info ( const matrix_type A)
inlineprivate

◆ set_info()

template<typename TAlgebra >
void ug::LU< TAlgebra >::set_info ( bool  b)
inline

◆ set_minimum_for_sparse()

template<typename TAlgebra >
void ug::LU< TAlgebra >::set_minimum_for_sparse ( size_t  N)
inline

◆ set_show_progress()

template<typename TAlgebra >
void ug::LU< TAlgebra >::set_show_progress ( bool  b)
inline

◆ set_sort_sparse()

template<typename TAlgebra >
void ug::LU< TAlgebra >::set_sort_sparse ( bool  b)
inline

◆ solve_dense()

template<typename TAlgebra >
bool ug::LU< TAlgebra >::solve_dense ( vector_type x,
const vector_type b 
)
inlineprivate

◆ solve_sparse()

template<typename TAlgebra >
bool ug::LU< TAlgebra >::solve_sparse ( vector_type x,
const vector_type b 
)
inlineprivate

◆ supports_parallel()

template<typename TAlgebra >
virtual bool ug::LU< TAlgebra >::supports_parallel ( ) const
inlinevirtual

returns if parallel solving is supported

Implements ug::ILinearOperatorInverse< X, Y >.

Member Data Documentation

◆ ilut_scalar

template<typename TAlgebra >
SmartPtr<ILUTScalarPreconditioner<algebra_type> > ug::LU< TAlgebra >::ilut_scalar
protected

◆ m_b

template<typename TAlgebra >
CPUAlgebra::vector_type ug::LU< TAlgebra >::m_b
protected

◆ m_bDense

template<typename TAlgebra >
bool ug::LU< TAlgebra >::m_bDense
protected

◆ m_bInfo

template<typename TAlgebra >
bool ug::LU< TAlgebra >::m_bInfo
protected

◆ m_bShowProgress

template<typename TAlgebra >
bool ug::LU< TAlgebra >::m_bShowProgress
protected

◆ m_bSortSparse

template<typename TAlgebra >
bool ug::LU< TAlgebra >::m_bSortSparse
protected

◆ m_iMinimumForSparse

template<typename TAlgebra >
size_t ug::LU< TAlgebra >::m_iMinimumForSparse
protected

◆ m_mat

template<typename TAlgebra >
DenseMatrixInverse<DenseMatrix<VariableArray2<double> > > ug::LU< TAlgebra >::m_mat
protected

◆ m_pMatrix

template<typename TAlgebra >
const matrix_type* ug::LU< TAlgebra >::m_pMatrix
protected

◆ m_size

template<typename TAlgebra >
size_t ug::LU< TAlgebra >::m_size
protected

◆ m_spOperator

template<typename TAlgebra >
SmartPtr<MatrixOperator<matrix_type, vector_type> > ug::LU< TAlgebra >::m_spOperator
protected

Operator to invert.

Referenced by ug::LU< TAlgebra >::init().

◆ m_tmp

template<typename TAlgebra >
DenseVector<VariableArray1<double> > ug::LU< TAlgebra >::m_tmp
protected

◆ m_u

template<typename TAlgebra >
CPUAlgebra::vector_type ug::LU< TAlgebra >::m_u
protected

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