ug4
|
the BiCGStab method as a solver for linear operators More...
#include <bicgstab.h>
Public Types | |
typedef IPreconditionedLinearOperatorInverse< vector_type > | base_type |
Base type. More... | |
typedef TVector | vector_type |
Vector type. More... | |
Public Types inherited from ug::IPreconditionedLinearOperatorInverse< TVector > | |
typedef ILinearOperatorInverse< TVector, TVector > | base_type |
Base class. More... | |
typedef TVector | codomain_function_type |
Range space. More... | |
typedef TVector | domain_function_type |
Domain space. More... | |
Public Types inherited from ug::ILinearOperatorInverse< X, Y > | |
typedef Y | codomain_function_type |
Range space. More... | |
typedef X | domain_function_type |
Domain space. More... | |
Public Types inherited from ug::ILinearIterator< X, X > | |
typedef X | codomain_function_type |
Range space. More... | |
typedef X | domain_function_type |
Domain space. More... | |
Public Types inherited from ug::VectorDebugWritingObject< TVector > | |
typedef TVector | vector_type |
type of vector More... | |
Public Member Functions | |
void | add_postprocess_corr (SmartPtr< IPProcessVector< vector_type > > p) |
adds a post-process for the iterates More... | |
virtual bool | apply_return_defect (vector_type &x, vector_type &b) |
BiCGStab () | |
constructors More... | |
BiCGStab (SmartPtr< ILinearIterator< vector_type > > spPrecond, SmartPtr< IConvergenceCheck< vector_type > > spConvCheck) | |
BiCGStab (SmartPtr< ILinearIterator< vector_type, vector_type > > spPrecond) | |
virtual std::string | config_string () const |
returns information about configuration parameters More... | |
virtual const char * | name () const |
name of solver More... | |
void | remove_postprocess_corr (SmartPtr< IPProcessVector< vector_type > > p) |
removes a post-process for the iterates More... | |
void | set_min_orthogonality (number minOrtho) |
sets to restart if given orthogonality missed More... | |
void | set_restart (int numRestarts) |
sets to restart at given number of iteration steps More... | |
virtual bool | supports_parallel () const |
returns if parallel solving is supported More... | |
Public Member Functions inherited from ug::IPreconditionedLinearOperatorInverse< TVector > | |
virtual bool | apply (TVector &x, const TVector &b) |
compute new correction c = B*d More... | |
std::string | config_string_preconditioner_convergence_check () const |
returns config information of convergence check and preconditioner More... | |
virtual bool | init (SmartPtr< ILinearOperator< TVector, TVector > > J, const TVector &u) |
initializes the solver for an operator More... | |
virtual bool | init (SmartPtr< ILinearOperator< TVector, TVector > > L) |
initializes the solver for an operator More... | |
IPreconditionedLinearOperatorInverse () | |
Empty constructor. More... | |
IPreconditionedLinearOperatorInverse (SmartPtr< ILinearIterator< TVector, TVector > > spPrecond) | |
constructor setting the preconditioner More... | |
IPreconditionedLinearOperatorInverse (SmartPtr< ILinearIterator< TVector, TVector > > spPrecond, SmartPtr< IConvergenceCheck< TVector > > spConvCheck) | |
constructor setting the preconditioner More... | |
void | set_compute_fresh_defect_when_finished (bool bRecompute) |
for debug: computes norm again after whole calculation of apply More... | |
void | set_preconditioner (SmartPtr< ILinearIterator< TVector, TVector > > spPrecond) |
sets the preconditioner More... | |
SmartPtr< ILinearIterator< TVector, TVector > > | preconditioner () |
ConstSmartPtr< ILinearIterator< TVector, TVector > > | preconditioner () const |
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 More... | |
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 More... | |
virtual bool | apply_update_defect (Y &u, X &f) |
virtual SmartPtr< ILinearIterator< X, Y > > | clone () |
clone More... | |
SmartPtr< IConvergenceCheck< X > > | convergence_check () |
returns the convergence check More... | |
ConstSmartPtr< IConvergenceCheck< X > > | convergence_check () const |
returns the convergence check More... | |
number | defect () const |
returns the current defect More... | |
ILinearOperatorInverse () | |
constructor setting convergence check to (100, 1e-12, 1e-12, true) More... | |
ILinearOperatorInverse (SmartPtr< IConvergenceCheck< X > > spConvCheck) | |
Default constructor. More... | |
virtual bool | init (SmartPtr< ILinearOperator< Y, X > > J, const Y &u) |
initializes for the inverse for a linearized operator at linearization point u More... | |
virtual bool | init (SmartPtr< ILinearOperator< Y, X > > L) |
initializes for the inverse for a linear operator More... | |
SmartPtr< ILinearOperator< Y, X > > | linear_operator () |
returns the current Operator this Inverse Operator is initialized for More... | |
number | reduction () const |
returns the current relative reduction More... | |
void | set_convergence_check (SmartPtr< IConvergenceCheck< X > > spConvCheck) |
set the convergence check More... | |
virtual int | standard_offset () const |
returns the standard offset for output More... | |
int | step () const |
returns the current number of steps More... | |
virtual | ~ILinearOperatorInverse () |
virtual destructor More... | |
Public Member Functions inherited from ug::ILinearIterator< X, X > | |
virtual bool | apply (X &c, const X &d)=0 |
compute new correction c = B*d More... | |
virtual bool | apply_update_defect (X &c, X &d)=0 |
compute new correction c = B*d and update defect d := d - A*c More... | |
SmartPtr< IDamping< X, X > > | damping () |
returns the scaling More... | |
ILinearIterator () | |
constructor More... | |
ILinearIterator (const ILinearIterator< X, X > &parent) | |
copy constructor More... | |
virtual bool | init (SmartPtr< ILinearOperator< X, X > > J, const X &u)=0 |
initialize for operator J(u) and linearization point u More... | |
virtual bool | init (SmartPtr< ILinearOperator< X, X > > L)=0 |
initialize for linear operator L More... | |
void | set_damp (number factor) |
sets the damping to a constant factor More... | |
void | set_damp (SmartPtr< IDamping< X, X > > spScaling) |
sets a scaling for the correction More... | |
virtual | ~ILinearIterator () |
virtual destructor More... | |
Public Member Functions inherited from ug::VectorDebugWritingObject< TVector > | |
virtual void | set_debug (SmartPtr< IVectorDebugWriter< vector_type > > spDebugWriter) |
set debug writer More... | |
SmartPtr< IVectorDebugWriter< vector_type > > | vector_debug_writer () |
returns the debug writer More... | |
ConstSmartPtr< IVectorDebugWriter< vector_type > > | vector_debug_writer () const |
bool | vector_debug_writer_valid () const |
returns true if the debug writer is set More... | |
VectorDebugWritingObject () | |
VectorDebugWritingObject (SmartPtr< IVectorDebugWriter< vector_type > > spDebugWriter) | |
void | write_debug (const vector_type &vec, const char *filename) |
writing debug output for a vector (if debug writer set) More... | |
virtual | ~VectorDebugWritingObject () |
virtual destructor More... | |
Protected Member Functions | |
void | enter_precond_debug_section (int loopCnt, char phase) |
debugger section for the preconditioner More... | |
SmartPtr< ILinearIterator< X, X > > | preconditioner () |
ConstSmartPtr< ILinearIterator< X, X > > | preconditioner () const |
void | prepare_conv_check () |
prepares the output of the convergence check More... | |
void | write_debugXR (vector_type &x, vector_type &r, int loopCnt, char phase) |
debugger output: solution and residual More... | |
Protected Member Functions inherited from ug::VectorDebugWritingObject< TVector > | |
void | enter_vector_debug_writer_section (const char *secDir) |
enters a debugging section More... | |
void | enter_vector_debug_writer_section (std::string secDir) |
enters a debugging section More... | |
void | leave_vector_debug_writer_section () |
leaves a debugging section More... | |
void | print_debugger_message (const char *msg) |
prints a debugger message (listing all the sections) More... | |
void | print_debugger_message (std::string msg) |
prints a debugger message (listing all the sections) More... | |
virtual void | write_debug (const vector_type &vec, std::string name) |
writing debug output for a vector (if debug writer set) More... | |
Protected Attributes | |
PProcessChain< vector_type > | m_corr_post_process |
postprocessor for the correction in the iterations More... | |
number | m_minOrtho |
minimal value in (0,1) accepted for Orthoginality before restart More... | |
int | m_numRestarts |
restarts at every numRestarts steps (numRestarts <= 0 --> never) More... | |
Protected Attributes inherited from ug::IPreconditionedLinearOperatorInverse< TVector > | |
bool | m_bRecompute |
flag if fresh defect should be computed when finish for debug purpose More... | |
SmartPtr< ILinearIterator< TVector, TVector > > | m_spPrecond |
Iterator used in the iterative scheme to compute the correction and update the defect. More... | |
Protected Attributes inherited from ug::ILinearOperatorInverse< X, Y > | |
SmartPtr< IConvergenceCheck< X > > | m_spConvCheck |
smart pointer holding the convergence check More... | |
SmartPtr< ILinearOperator< Y, X > > | m_spLinearOperator |
Operator that is inverted by this Inverse Operator. More... | |
Protected Attributes inherited from ug::ILinearIterator< X, X > | |
SmartPtr< IDamping< X, X > > | m_spDamping |
the scaling More... | |
Protected Attributes inherited from ug::VectorDebugWritingObject< TVector > | |
SmartPtr< IVectorDebugWriter< vector_type > > | m_spVectorDebugWriter |
Debug Writer. More... | |
the BiCGStab method as a solver for linear operators
This class implements the BiCGStab - method for the solution of linear operator problems like A*x = b, where the solution x = A^{-1} b is computed.
For detailed description of the algorithm, please refer to:
TVector | vector type |
typedef IPreconditionedLinearOperatorInverse<vector_type> ug::BiCGStab< TVector >::base_type |
Base type.
typedef TVector ug::BiCGStab< TVector >::vector_type |
Vector type.
|
inline |
constructors
|
inline |
|
inline |
|
inline |
adds a post-process for the iterates
References ug::PProcessChain< TVector >::add(), ug::BiCGStab< TVector >::m_corr_post_process, and p.
|
inlinevirtual |
References alpha, ug::IPreconditionedLinearOperatorInverse< TVector >::apply(), ug::PProcessChain< TVector >::apply(), ug::ILinearOperatorInverse< X, Y >::convergence_check(), ug::BiCGStab< TVector >::enter_precond_debug_section(), ug::VectorDebugWritingObject< TVector >::leave_vector_debug_writer_section(), ug::ILinearOperatorInverse< X, Y >::linear_operator(), LS_PROFILE_BEGIN, ug::BiCGStab< TVector >::m_corr_post_process, ug::BiCGStab< TVector >::m_minOrtho, ug::BiCGStab< TVector >::m_numRestarts, omega, p, ug::BiCGStab< TVector >::preconditioner(), ug::BiCGStab< TVector >::prepare_conv_check(), ug::PST_ADDITIVE, ug::PST_CONSISTENT, ug::PST_UNIQUE, s, ug::ILinearOperatorInverse< X, Y >::step(), UG_LOG, UG_THROW, ug::VecProd(), ug::VecScaleAdd(), and ug::BiCGStab< TVector >::write_debugXR().
|
inlinevirtual |
returns information about configuration parameters
Reimplemented from ug::IPreconditionedLinearOperatorInverse< TVector >.
References ug::IPreconditionedLinearOperatorInverse< X >::config_string_preconditioner_convergence_check(), ug::BiCGStab< TVector >::m_minOrtho, and ug::BiCGStab< TVector >::m_numRestarts.
|
inlineprotected |
debugger section for the preconditioner
References ug::VectorDebugWritingObject< TVector >::enter_vector_debug_writer_section(), ug::GetStringPrintf(), and ug::VectorDebugWritingObject< TVector >::vector_debug_writer_valid().
Referenced by ug::BiCGStab< TVector >::apply_return_defect().
|
inlinevirtual |
name of solver
Implements ug::ILinearOperatorInverse< X, Y >.
Referenced by ug::BiCGStab< TVector >::prepare_conv_check().
|
inlineprotected |
returns the preconditioner
Referenced by ug::BiCGStab< TVector >::apply_return_defect(), ug::BiCGStab< TVector >::prepare_conv_check(), and ug::BiCGStab< TVector >::supports_parallel().
|
inlineprotected |
|
inlineprotected |
prepares the output of the convergence check
References ug::ILinearOperatorInverse< X, Y >::convergence_check(), ug::BiCGStab< TVector >::name(), ug::BiCGStab< TVector >::preconditioner(), and s.
Referenced by ug::BiCGStab< TVector >::apply_return_defect().
|
inline |
removes a post-process for the iterates
References ug::BiCGStab< TVector >::m_corr_post_process, p, and ug::PProcessChain< TVector >::remove().
|
inline |
sets to restart if given orthogonality missed
References ug::BiCGStab< TVector >::m_minOrtho.
|
inline |
sets to restart at given number of iteration steps
References ug::BiCGStab< TVector >::m_numRestarts.
|
inlinevirtual |
returns if parallel solving is supported
Implements ug::ILinearOperatorInverse< X, Y >.
References ug::BiCGStab< TVector >::preconditioner().
|
inlineprotected |
debugger output: solution and residual
References ug::GetStringPrintf(), ug::VectorDebugWritingObject< TVector >::vector_debug_writer_valid(), and ug::VectorDebugWritingObject< TVector >::write_debug().
Referenced by ug::BiCGStab< TVector >::apply_return_defect().
|
protected |
postprocessor for the correction in the iterations
These postprocess operations are applied to the preconditioned defect before the orthogonalization. The goal is to prevent the useless kernel parts to prevail in the (floating point) arithmetics.
Referenced by ug::BiCGStab< TVector >::add_postprocess_corr(), ug::BiCGStab< TVector >::apply_return_defect(), and ug::BiCGStab< TVector >::remove_postprocess_corr().
|
protected |
minimal value in (0,1) accepted for Orthoginality before restart
Referenced by ug::BiCGStab< TVector >::apply_return_defect(), ug::BiCGStab< TVector >::config_string(), and ug::BiCGStab< TVector >::set_min_orthogonality().
|
protected |
restarts at every numRestarts steps (numRestarts <= 0 --> never)
Referenced by ug::BiCGStab< TVector >::apply_return_defect(), ug::BiCGStab< TVector >::config_string(), and ug::BiCGStab< TVector >::set_restart().