|
ug4
|
linear solver using abstract preconditioner interface More...
#include <auto_linear_solver.h>
Inheritance diagram for ug::AutoLinearSolver< TVector >:Public Types | |
| typedef IPreconditionedLinearOperatorInverse< vector_type > | base_type |
| Base type. | |
| typedef TVector | vector_type |
| Vector type. | |
Public Types inherited from ug::IPreconditionedLinearOperatorInverse< TVector > | |
| typedef ILinearOperatorInverse< TVector, TVector > | base_type |
| Base class. | |
| typedef TVector | codomain_function_type |
| Range space. | |
| typedef TVector | domain_function_type |
| Domain space. | |
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 Types inherited from ug::VectorDebugWritingObject< TVector > | |
| typedef TVector | vector_type |
| type of vector | |
Public Member Functions | |
| virtual bool | apply (vector_type &x, const vector_type &b) |
| virtual bool | apply_return_defect (vector_type &x, vector_type &b) |
| solves the system and returns the last defect | |
| AutoLinearSolver () | |
| AutoLinearSolver (double desiredDefect, double desiredReduction) | |
| bool | compute_correction (vector_type &c, vector_type &d) |
| virtual bool | init (SmartPtr< ILinearOperator< vector_type, vector_type > > J) |
| initializes the solver for an operator | |
| virtual bool | init (SmartPtr< ILinearOperator< vector_type, vector_type > > J, const vector_type &u) |
| initializes the solver for an operator | |
| bool | init_op (SmartPtr< ILinearOperator< vector_type, vector_type > > J) |
| virtual const char * | name () const |
| returns the name of the solver | |
| void | print_information () |
| bool | reinit () |
| void | set_reduction_always_accept (double d) |
| void | set_reinit_when_worse_then_average (double d) |
| virtual bool | supports_parallel () const |
| returns if parallel solving is supported | |
Public Member Functions inherited from ug::IPreconditionedLinearOperatorInverse< TVector > | |
| virtual std::string | config_string () const |
| returns information about configuration parameters | |
| std::string | config_string_preconditioner_convergence_check () const |
| returns config information of convergence check and preconditioner | |
| IPreconditionedLinearOperatorInverse () | |
| Empty constructor. | |
| IPreconditionedLinearOperatorInverse (SmartPtr< ILinearIterator< TVector, TVector > > spPrecond) | |
| constructor setting the preconditioner | |
| IPreconditionedLinearOperatorInverse (SmartPtr< ILinearIterator< TVector, TVector > > spPrecond, SmartPtr< IConvergenceCheck< TVector > > spConvCheck) | |
| constructor setting the preconditioner | |
| void | set_compute_fresh_defect_when_finished (bool bRecompute) |
| for debug: computes norm again after whole calculation of apply | |
| void | set_preconditioner (SmartPtr< ILinearIterator< TVector, TVector > > spPrecond) |
| sets the preconditioner | |
| 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 | |
| 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. | |
| virtual bool | init (SmartPtr< ILinearOperator< Y, X > > J, const Y &u) |
| initializes for the inverse for a linearized operator at linearization point u | |
| virtual bool | init (SmartPtr< ILinearOperator< Y, X > > L) |
| initializes for the inverse for a linear operator | |
| 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 | |
Public Member Functions inherited from ug::VectorDebugWritingObject< TVector > | |
| virtual void | set_debug (SmartPtr< IVectorDebugWriter< vector_type > > spDebugWriter) |
| set debug writer | |
| SmartPtr< IVectorDebugWriter< vector_type > > | vector_debug_writer () |
| returns the debug writer | |
| ConstSmartPtr< IVectorDebugWriter< vector_type > > | vector_debug_writer () const |
| bool | vector_debug_writer_valid () const |
| returns true if the debug writer is set | |
| 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) | |
| virtual | ~VectorDebugWritingObject () |
| virtual destructor | |
Protected Member Functions | |
| void | prepare_conv_check () |
| prepares the convergence check output | |
Protected Member Functions inherited from ug::VectorDebugWritingObject< TVector > | |
| void | enter_vector_debug_writer_section (const char *secDir) |
| enters a debugging section | |
| void | enter_vector_debug_writer_section (std::string secDir) |
| enters a debugging section | |
| void | leave_vector_debug_writer_section () |
| leaves a debugging section | |
| void | print_debugger_message (const char *msg) |
| prints a debugger message (listing all the sections) | |
| void | print_debugger_message (std::string msg) |
| prints a debugger message (listing all the sections) | |
| virtual void | write_debug (const vector_type &vec, std::string name) |
| writing debug output for a vector (if debug writer set) | |
Private Attributes | |
| double | m_avgReduction |
| int | m_bInited |
| double | m_desiredDefect |
| double | m_desiredReduction |
| size_t | m_initCalled |
| size_t | m_initsDone |
| double | m_lastCallReduction |
| double | m_lastCallTime |
| double | m_lastInitTime |
| double | m_reductionAlwaysAccept |
| double | m_reductionPerTime |
| double | m_savedTime |
| vector_type | m_u |
| double | m_worseThenAverage |
| SmartPtr< ILinearOperator< vector_type, vector_type > > | pJ |
Additional Inherited Members | |
Protected Attributes inherited from ug::IPreconditionedLinearOperatorInverse< TVector > | |
| bool | m_bRecompute |
| flag if fresh defect should be computed when finish for debug purpose | |
| SmartPtr< ILinearIterator< TVector, TVector > > | m_spPrecond |
| Iterator used in the iterative scheme to compute the correction and update the defect. | |
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 | |
Protected Attributes inherited from ug::VectorDebugWritingObject< TVector > | |
| SmartPtr< IVectorDebugWriter< vector_type > > | m_spVectorDebugWriter |
| Debug Writer. | |
linear solver using abstract preconditioner interface
This class is a linear iterating scheme, that uses any implementation of the ILinearIterator interface to precondition the iteration.
| TAlgebra | algebra type |
| typedef IPreconditionedLinearOperatorInverse<vector_type> ug::AutoLinearSolver< TVector >::base_type |
Base type.
| typedef TVector ug::AutoLinearSolver< TVector >::vector_type |
Vector type.
|
inline |
References ug::AutoLinearSolver< TVector >::m_bInited, ug::AutoLinearSolver< TVector >::m_desiredDefect, ug::AutoLinearSolver< TVector >::m_desiredReduction, ug::AutoLinearSolver< TVector >::m_initCalled, ug::AutoLinearSolver< TVector >::m_initsDone, and ug::AutoLinearSolver< TVector >::m_savedTime.
|
inline |
References ug::AutoLinearSolver< TVector >::m_bInited, ug::AutoLinearSolver< TVector >::m_initCalled, ug::AutoLinearSolver< TVector >::m_initsDone, ug::AutoLinearSolver< TVector >::m_reductionAlwaysAccept, ug::AutoLinearSolver< TVector >::m_savedTime, and ug::AutoLinearSolver< TVector >::m_worseThenAverage.
|
inlinevirtual |
Reimplemented from ug::IPreconditionedLinearOperatorInverse< TVector >.
References ug::AutoLinearSolver< TVector >::apply_return_defect().
Referenced by ug::AutoLinearSolver< TVector >::compute_correction().
|
inlinevirtual |
solves the system and returns the last defect
References ug::AutoLinearSolver< TVector >::compute_correction(), ug::ILinearOperatorInverse< X, Y >::convergence_check(), ug::ILinearOperatorInverse< X, Y >::defect(), ug::get_clock_s(), ug::ILinearOperatorInverse< X, Y >::linear_operator(), LS_PROFILE_BEGIN, LS_PROFILE_END, ug::AutoLinearSolver< TVector >::m_avgReduction, ug::AutoLinearSolver< TVector >::m_bInited, ug::AutoLinearSolver< TVector >::m_desiredDefect, ug::AutoLinearSolver< TVector >::m_desiredReduction, ug::AutoLinearSolver< TVector >::m_initCalled, ug::AutoLinearSolver< TVector >::m_initsDone, ug::AutoLinearSolver< TVector >::m_lastCallReduction, ug::AutoLinearSolver< TVector >::m_lastCallTime, ug::AutoLinearSolver< TVector >::m_lastInitTime, ug::AutoLinearSolver< TVector >::m_reductionPerTime, ug::AutoLinearSolver< TVector >::m_savedTime, ug::AutoLinearSolver< TVector >::name(), ug::AutoLinearSolver< TVector >::prepare_conv_check(), ug::PST_ADDITIVE, ug::PST_CONSISTENT, ug::ILinearOperatorInverse< X, Y >::reduction(), ug::AutoLinearSolver< TVector >::reinit(), ug::reset_floats(), UG_LOG, UG_THROW, and ug::VectorDebugWritingObject< TVector >::write_debug().
Referenced by ug::AutoLinearSolver< TVector >::apply().
|
inline |
|
inlinevirtual |
initializes the solver for an operator
Reimplemented from ug::IPreconditionedLinearOperatorInverse< TVector >.
References ug::AutoLinearSolver< TVector >::init_op(), and ug::AutoLinearSolver< TVector >::m_u.
|
inlinevirtual |
initializes the solver for an operator
Reimplemented from ug::IPreconditionedLinearOperatorInverse< TVector >.
References ug::AutoLinearSolver< TVector >::init_op(), and ug::AutoLinearSolver< TVector >::m_u.
|
inline |
References ug::ILinearOperatorInverse< X, Y >::init(), ug::AutoLinearSolver< TVector >::m_bInited, ug::AutoLinearSolver< TVector >::m_initCalled, ug::AutoLinearSolver< TVector >::pJ, and ug::AutoLinearSolver< TVector >::reinit().
Referenced by ug::AutoLinearSolver< TVector >::init(), and ug::AutoLinearSolver< TVector >::init().
|
inlinevirtual |
returns the name of the solver
Implements ug::ILinearOperatorInverse< X, Y >.
Referenced by ug::AutoLinearSolver< TVector >::apply_return_defect(), and ug::AutoLinearSolver< TVector >::prepare_conv_check().
|
inlineprotected |
prepares the convergence check output
References ug::ILinearOperatorInverse< X, Y >::convergence_check(), ug::AutoLinearSolver< TVector >::name(), ug::IPreconditionedLinearOperatorInverse< TVector >::preconditioner(), and s.
Referenced by ug::AutoLinearSolver< TVector >::apply_return_defect().
|
inline |
References ug::AutoLinearSolver< TVector >::m_avgReduction, ug::AutoLinearSolver< TVector >::m_initCalled, ug::AutoLinearSolver< TVector >::m_initsDone, ug::AutoLinearSolver< TVector >::m_lastInitTime, ug::AutoLinearSolver< TVector >::m_reductionPerTime, ug::AutoLinearSolver< TVector >::m_savedTime, ug::reset_floats(), and UG_LOG.
|
inline |
References ug::get_clock_s(), ug::IPreconditionedLinearOperatorInverse< vector_type >::init(), ug::AutoLinearSolver< TVector >::m_bInited, ug::AutoLinearSolver< TVector >::m_initsDone, ug::AutoLinearSolver< TVector >::m_lastInitTime, ug::AutoLinearSolver< TVector >::m_u, ug::AutoLinearSolver< TVector >::pJ, and SmartPtr< T, FreePolicy >::valid().
Referenced by ug::AutoLinearSolver< TVector >::apply_return_defect(), and ug::AutoLinearSolver< TVector >::init_op().
|
inline |
|
inline |
|
inlinevirtual |
returns if parallel solving is supported
Implements ug::ILinearOperatorInverse< X, Y >.
References ug::IPreconditionedLinearOperatorInverse< TVector >::preconditioner().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by ug::AutoLinearSolver< TVector >::apply_return_defect().
|
private |
Referenced by ug::AutoLinearSolver< TVector >::apply_return_defect().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by ug::AutoLinearSolver< TVector >::init_op(), and ug::AutoLinearSolver< TVector >::reinit().