ug4
|
describes a linear iterator More...
#include <linear_iterator.h>
Public Types | |
typedef Y | codomain_function_type |
Range space. More... | |
typedef X | domain_function_type |
Domain space. More... | |
Public Member Functions | |
virtual bool | apply (Y &c, const X &d)=0 |
compute new correction c = B*d More... | |
virtual bool | apply_update_defect (Y &c, X &d)=0 |
compute new correction c = B*d and update defect d := d - A*c More... | |
virtual SmartPtr< ILinearIterator< X, Y > > | clone ()=0 |
clone More... | |
virtual std::string | config_string () const |
SmartPtr< IDamping< X, Y > > | damping () |
returns the scaling More... | |
ILinearIterator () | |
constructor More... | |
ILinearIterator (const ILinearIterator< X, Y > &parent) | |
copy constructor More... | |
virtual bool | init (SmartPtr< ILinearOperator< Y, X > > J, const Y &u)=0 |
initialize for operator J(u) and linearization point u More... | |
virtual bool | init (SmartPtr< ILinearOperator< Y, X > > L)=0 |
initialize for linear operator L More... | |
virtual const char * | name () const =0 |
returns the name of iterator More... | |
void | set_damp (number factor) |
sets the damping to a constant factor More... | |
void | set_damp (SmartPtr< IDamping< X, Y > > spScaling) |
sets a scaling for the correction More... | |
virtual bool | supports_parallel () const =0 |
returns if parallel solving is supported More... | |
virtual | ~ILinearIterator () |
virtual destructor More... | |
Protected Attributes | |
SmartPtr< IDamping< X, Y > > | m_spDamping |
the scaling More... | |
describes a linear iterator
This class is the base class for all linear iterators. Iterators (also called preconditioners) are used in iterative schemes when solving a linear system. Usually, a linear problem like L*u = f is intended to be solved. This is done in an iterative way by performing an iteration of
start: compute d := f - L*u iterate: - c := B*d (compute correction)
This iterator class describes the application of B in the scheme above. The application has been split up into two parts.
This splitting has been made, since initialization may be computationally expensive. Thus, the user of this class has the choice when to call this initialization. E.g. when the operator is applied several times the init of the iterator is only needed once.
X | Domain space function |
Y | Range space function |
typedef Y ug::ILinearIterator< X, Y >::codomain_function_type |
Range space.
typedef X ug::ILinearIterator< X, Y >::domain_function_type |
Domain space.
|
inlinevirtual |
virtual destructor
|
inline |
constructor
References ug::ILinearIterator< X, Y >::set_damp().
|
inline |
copy constructor
References ug::ILinearIterator< X, Y >::m_spDamping, and ug::ILinearIterator< X, Y >::set_damp().
|
pure virtual |
compute new correction c = B*d
This method applies the iterator operator, i.e. c = B*d. The domain function d remains unchanged. Note, that this method can always be implemented by creating a copy of d and calling apply_update_defect with this copy.
[in] | d | defect |
[out] | c | correction |
Implemented in ug::CombinedLinearIterator< X, Y >, ug::LinearIteratorSum< X, Y >, ug::LinearIteratorProduct< X, Y >, ug::IPreconditionedLinearOperatorInverse< X >, ug::ILinearOperatorInverse< X, X >, ug::AgglomeratingBase< ILinearIterator< TAlgebra::vector_type >, TAlgebra >, ug::AgglomeratingBase< IPreconditioner< TAlgebra >, TAlgebra >, ug::ITransformingIteration< TAlgebra, TDerived >, ug::ITransformingIteration< TAlgebra, AssembledTransformingSmoother< TDomain, TAlgebra > >, ug::IProjGaussSeidel< TDomain, TAlgebra >, ug::OperatorInverseIterator< TAlgebra >, ug::Jacobi< TAlgebra >, ug::DebugIterator< TAlgebra >, and ug::IPreconditioner< TAlgebra >.
|
pure virtual |
compute new correction c = B*d and update defect d := d - A*c
This method applies the inverse operator, i.e. c = B*d. The domain function d is changed in the way, that the defect d := d - A*c is returned in the function. This is always useful, when the iterating algorithm can (or must) update the defect during computation (this is e.g. the case for the geometric multigrid method). Note, that this method can always be implemented by calling apply and then computing d := d - A*c.
[in,out] | d | defect |
[out] | u | correction |
Implemented in ug::CombinedLinearIterator< X, Y >, ug::LinearIteratorSum< X, Y >, ug::LinearIteratorProduct< X, Y >, ug::ILinearOperatorInverse< X, X >, ug::AgglomeratingBase< ILinearIterator< TAlgebra::vector_type >, TAlgebra >, ug::AgglomeratingBase< IPreconditioner< TAlgebra >, TAlgebra >, ug::ITransformingIteration< TAlgebra, TDerived >, ug::ITransformingIteration< TAlgebra, AssembledTransformingSmoother< TDomain, TAlgebra > >, ug::IProjGaussSeidel< TDomain, TAlgebra >, ug::OperatorInverseIterator< TAlgebra >, ug::DebugIterator< TAlgebra >, and ug::IPreconditioner< TAlgebra >.
|
pure virtual |
clone
Implemented in ug::CombinedLinearIterator< X, Y >, ug::LineVanka< TDomain, TAlgebra >, ug::LineGaussSeidel< TDomain, TAlgebra >, ug::UzawaBase< TDomain, TAlgebra >, ug::SequentialSubspaceCorrection< TDomain, TAlgebra >, ug::AssembledMultiGridCycle< TDomain, TAlgebra >, ug::ElementGaussSeidel< TDomain, TAlgebra >, ug::ComponentGaussSeidel< TDomain, TAlgebra >, ug::DiagVanka< TAlgebra >, ug::Vanka< TAlgebra >, ug::AssembledTransformingSmoother< TDomain, TAlgebra >, ug::SchurPrecond< TAlgebra >, ug::ProjSymmetricGaussSeidel< TDomain, TAlgebra >, ug::ProjBackwardGaussSeidel< TDomain, TAlgebra >, ug::ProjGaussSeidel< TDomain, TAlgebra >, ug::PILUTPreconditioner< TAlgebra >, ug::OperatorInverseIterator< TAlgebra >, ug::Jacobi< TAlgebra >, ug::LinearIteratorSum< X, Y >, ug::LinearIteratorProduct< X, Y >, ug::ILUTScalarPreconditioner< TAlgebra >, ug::ILUTPreconditioner< TAlgebra >, ug::ILU< TAlgebra >, ug::SymmetricGaussSeidel< TAlgebra >, ug::BackwardGaussSeidel< TAlgebra >, ug::GaussSeidel< TAlgebra >, ug::SparseBlockGaussSeidel2< TAlgebra, backward, forward >, ug::SparseBlockGaussSeidel< TAlgebra, backward, forward >, ug::BlockGaussSeidelIterative< TAlgebra, backward, forward >, ug::BlockGaussSeidel< TAlgebra, backward, forward >, ug::IExternalSolver< TAlgebra >, ug::DebugIterator< TAlgebra >, ug::AgglomeratingPreconditioner< TAlgebra >, ug::AgglomeratingIterator< TAlgebra >, ug::ILinearOperatorInverse< X, Y >, ug::ILinearOperatorInverse< TAlgebra::vector_type, TAlgebra::vector_type >, ug::ILinearOperatorInverse< X, X >, ug::CRILUTPreconditioner< class >, ug::PCRILUTPreconditioner< class >, and ug::Electromagnetism::TimeHarmonicNedelecHybridSmoother< class, class >.
|
inlinevirtual |
Reimplemented in ug::AssembledMultiGridCycle< TDomain, TAlgebra >, ug::SchurPrecond< TAlgebra >, ug::ILUTScalarPreconditioner< TAlgebra >, ug::ILUTPreconditioner< TAlgebra >, ug::SparseBlockGaussSeidel2< TAlgebra, backward, forward >, ug::SparseBlockGaussSeidel< TAlgebra, backward, forward >, ug::BlockGaussSeidelIterative< TAlgebra, backward, forward >, ug::BlockGaussSeidel< TAlgebra, backward, forward >, ug::LU< TAlgebra >, ug::GMRES< TVector >, ug::BiCGStab< TVector >, ug::AnalyzingSolver< M, X, Y >, ug::AgglomeratingPreconditioner< TAlgebra >, ug::AgglomeratingIterator< TAlgebra >, ug::AgglomeratingSolver< TAlgebra >, ug::IPreconditionedLinearOperatorInverse< X >, ug::IPreconditionedLinearOperatorInverse< TVector >, ug::ILinearOperatorInverse< X, Y >, ug::ILinearOperatorInverse< TAlgebra::vector_type, TAlgebra::vector_type >, and ug::ILinearOperatorInverse< X, X >.
References ug::ILinearIterator< X, Y >::m_spDamping, and ug::ILinearIterator< X, Y >::name().
|
inline |
returns the scaling
References ug::ILinearIterator< X, Y >::m_spDamping.
|
pure virtual |
initialize for operator J(u) and linearization point u
This method passes the linear operator J(u) that should be used as underlying by this iterator. As second argument the linearization point is passed. This is needed e.g. for the geometric multigrid method.
[in] | J | linearized operator to use as underlying |
[in] | u | linearization point |
Implemented in ug::CombinedLinearIterator< X, Y >, ug::LinearIteratorSum< X, Y >, ug::LinearIteratorProduct< X, Y >, ug::IPreconditionedLinearOperatorInverse< X >, and ug::ILinearOperatorInverse< X, X >.
|
pure virtual |
initialize for linear operator L
This method passes the operator L that used as underlying by this operator. In addition some preparation step can be made.
[in] | L | linear operator to use as underlying |
Implemented in ug::CombinedLinearIterator< X, Y >, ug::LinearIteratorSum< X, Y >, ug::LinearIteratorProduct< X, Y >, ug::IPreconditionedLinearOperatorInverse< X >, and ug::ILinearOperatorInverse< X, X >.
|
pure virtual |
returns the name of iterator
This method returns the name of the iterator operator. This function is typically needed, when the iterator operator is used inside of another operator and some debug output should be printed
Implemented in ug::ILinearOperatorInverse< TAlgebra::vector_type, TAlgebra::vector_type >, ug::ILinearOperatorInverse< X, X >, ug::IProjGaussSeidel< TDomain, TAlgebra >, ug::CombinedLinearIterator< X, Y >, ug::GaussSeidelBase< TAlgebra >, ug::IPreconditioner< TAlgebra >, ug::ILinearOperatorInverse< X, Y >, ug::LineVanka< TDomain, TAlgebra >, ug::LineGaussSeidel< TDomain, TAlgebra >, ug::UzawaBase< TDomain, TAlgebra >, ug::SequentialSubspaceCorrection< TDomain, TAlgebra >, ug::AssembledMultiGridCycle< TDomain, TAlgebra >, ug::ElementGaussSeidel< TDomain, TAlgebra >, ug::ComponentGaussSeidel< TDomain, TAlgebra >, ug::DiagVanka< TAlgebra >, ug::Vanka< TAlgebra >, ug::AssembledTransformingSmoother< TDomain, TAlgebra >, ug::SchurPrecond< TAlgebra >, ug::ProjSymmetricGaussSeidel< TDomain, TAlgebra >, ug::ProjBackwardGaussSeidel< TDomain, TAlgebra >, ug::ProjGaussSeidel< TDomain, TAlgebra >, ug::PILUTPreconditioner< TAlgebra >, ug::OperatorInverseIterator< TAlgebra >, ug::Jacobi< TAlgebra >, ug::LinearIteratorSum< X, Y >, ug::LinearIteratorProduct< X, Y >, ug::ILUTScalarPreconditioner< TAlgebra >, ug::ILUTPreconditioner< TAlgebra >, ug::ILU< TAlgebra >, ug::SymmetricGaussSeidel< TAlgebra >, ug::BackwardGaussSeidel< TAlgebra >, ug::GaussSeidel< TAlgebra >, ug::SparseBlockGaussSeidel2< TAlgebra, backward, forward >, ug::SparseBlockGaussSeidel< TAlgebra, backward, forward >, ug::BlockGaussSeidelIterative< TAlgebra, backward, forward >, ug::BlockGaussSeidel< TAlgebra, backward, forward >, ug::LU< TAlgebra >, ug::LinearSolver< TVector >, ug::LinearSolver< ug::ParallelVector >, ug::GMRES< TVector >, ug::FETISolver< TAlgebra >, ug::PrimalSubassembledMatrixInverse< TAlgebra >, ug::PrimalSubassembledMatrixInverse< algebra_type >, ug::IExternalSolver< TAlgebra >, ug::DebugIterator< TAlgebra >, ug::CG< TVector >, ug::BiCGStab< TVector >, ug::AutoLinearSolver< TVector >, ug::AnalyzingSolver< M, X, Y >, ug::AgglomeratingPreconditioner< TAlgebra >, ug::AgglomeratingIterator< TAlgebra >, ug::AgglomeratingSolver< TAlgebra >, ug::CRILUTPreconditioner< class >, ug::PCRILUTPreconditioner< class >, and ug::Electromagnetism::TimeHarmonicNedelecHybridSmoother< class, class >.
Referenced by ug::ILinearIterator< X, Y >::config_string().
|
inline |
sets the damping to a constant factor
References ug::ILinearIterator< X, Y >::m_spDamping, and make_sp().
|
inline |
sets a scaling for the correction
Sets a scaling for the correction, i.e., once the correction has been computed, c = B*d, the correction is scaled by a factor, c := s*c, where s is provided by the passed scaling class. Note, that the scaling factor may depend on the defect and correction. The internal update of the defect as done in apply_update_defect must be performed with respect to the scaled correction.
References ug::ILinearIterator< X, Y >::m_spDamping.
Referenced by ug::ILinearIterator< X, Y >::ILinearIterator().
|
pure virtual |
returns if parallel solving is supported
Implemented in ug::ILinearOperatorInverse< TAlgebra::vector_type, TAlgebra::vector_type >, ug::ILinearOperatorInverse< X, X >, ug::ILinearOperatorInverse< X, Y >, ug::LineVanka< TDomain, TAlgebra >, ug::LineGaussSeidel< TDomain, TAlgebra >, ug::UzawaBase< TDomain, TAlgebra >, ug::SequentialSubspaceCorrection< TDomain, TAlgebra >, ug::AssembledMultiGridCycle< TDomain, TAlgebra >, ug::ElementGaussSeidel< TDomain, TAlgebra >, ug::ComponentGaussSeidel< TDomain, TAlgebra >, ug::DiagVanka< TAlgebra >, ug::Vanka< TAlgebra >, ug::AssembledTransformingSmoother< TDomain, TAlgebra >, ug::SchurPrecond< TAlgebra >, ug::OperatorInverseIterator< TAlgebra >, ug::Jacobi< TAlgebra >, ug::CombinedLinearIterator< X, Y >, ug::ILUTScalarPreconditioner< TAlgebra >, ug::ILUTPreconditioner< TAlgebra >, ug::ILU< TAlgebra >, ug::GaussSeidelBase< TAlgebra >, ug::SparseBlockGaussSeidel2< TAlgebra, backward, forward >, ug::SparseBlockGaussSeidel< TAlgebra, backward, forward >, ug::BlockGaussSeidelIterative< TAlgebra, backward, forward >, ug::BlockGaussSeidel< TAlgebra, backward, forward >, ug::IBlockJacobiPreconditioner< TAlgebra >, ug::LU< TAlgebra >, ug::LinearSolver< TVector >, ug::LinearSolver< ug::ParallelVector >, ug::GMRES< TVector >, ug::FETISolver< TAlgebra >, ug::PrimalSubassembledMatrixInverse< TAlgebra >, ug::PrimalSubassembledMatrixInverse< algebra_type >, ug::IExternalSolver< TAlgebra >, ug::DebugIterator< TAlgebra >, ug::CG< TVector >, ug::BiCGStab< TVector >, ug::AutoLinearSolver< TVector >, ug::AnalyzingSolver< M, X, Y >, ug::AgglomeratingPreconditioner< TAlgebra >, ug::AgglomeratingIterator< TAlgebra >, ug::AgglomeratingSolver< TAlgebra >, ug::CRILUTPreconditioner< class >, ug::PCRILUTPreconditioner< class >, and ug::Electromagnetism::TimeHarmonicNedelecHybridSmoother< class, class >.
|
protected |