ug4
|
Debugging iterator. More...
#include <debug_iterator.h>
Public Types | |
typedef TAlgebra | algebra_type |
typedef ILinearIterator< typename TAlgebra::vector_type > | base_type |
typedef TAlgebra::matrix_type | matrix_type |
typedef IPreconditionedLinearOperatorInverse< vector_type > | solver_type |
typedef TAlgebra::vector_type | vector_type |
Public Types inherited from ug::ILinearIterator< TAlgebra::vector_type > | |
typedef TAlgebra::vector_type | codomain_function_type |
Range space. More... | |
typedef TAlgebra::vector_type | domain_function_type |
Domain space. More... | |
Public Types inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type > | |
typedef TAlgebra::vector_type | vector_type |
type of vector More... | |
Public Member Functions | |
virtual SmartPtr< ILinearIterator< vector_type > > | clone () |
Clone. More... | |
DebugIterator () | |
Constructor. More... | |
DebugIterator (SmartPtr< base_type > pprecond, SmartPtr< solver_type > psolver) | |
void | set_preconditioner (SmartPtr< base_type > pprecond) |
specify the real preconditioner (used for iterating) More... | |
void | set_random_bounds (double a, double b) |
specify bounds for random initial guess (optional) More... | |
void | set_solution (SmartPtr< vector_type > sol) |
void | set_solver (SmartPtr< solver_type > psolver) |
specify the solver that will be used for debugging (optional) More... | |
virtual bool | supports_parallel () const |
returns if parallel solving is supported More... | |
Public Member Functions inherited from ug::ILinearIterator< TAlgebra::vector_type > | |
virtual std::string | config_string () const |
SmartPtr< IDamping< TAlgebra::vector_type, TAlgebra::vector_type > > | damping () |
returns the scaling More... | |
ILinearIterator () | |
constructor More... | |
ILinearIterator (const ILinearIterator< TAlgebra::vector_type, TAlgebra::vector_type > &parent) | |
copy constructor More... | |
virtual bool | init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > J, const TAlgebra::vector_type &u)=0 |
initialize for operator J(u) and linearization point u More... | |
virtual bool | init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > 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< TAlgebra::vector_type, TAlgebra::vector_type > > spScaling) |
sets a scaling for the correction More... | |
virtual | ~ILinearIterator () |
virtual destructor More... | |
Public Member Functions inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type > | |
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 | |
virtual bool | apply (vector_type &c, const vector_type &d) |
forwarding call to original preconditioner More... | |
virtual bool | apply_update_defect (vector_type &c, vector_type &d) |
forwarding call to original preconditioner More... | |
bool | find_smooth_error () |
Determines algebraically smooth error. More... | |
SmartPtr< base_type > | get_preconditioner () |
get reference to 'real' preconditioner More... | |
SmartPtr< solver_type > | get_solver () |
get reference to aux. solver More... | |
virtual bool | init (SmartPtr< ILinearOperator< vector_type > > J, const vector_type &u) |
init (expensive) More... | |
virtual bool | init (SmartPtr< ILinearOperator< vector_type > > L) |
init (expensive) More... | |
bool | init (SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp) |
init (expensive, since it calls More... | |
virtual const char * | name () const |
name of preconditioner More... | |
Protected Member Functions inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type > | |
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 | |
double | from |
SmartPtr< MatrixOperator< matrix_type, vector_type > > | m_pOperator |
SmartPtr< base_type > | m_pprecond |
SmartPtr< solver_type > | m_solver |
SmartPtr< vector_type > | m_spSolVector |
double | to |
Protected Attributes inherited from ug::ILinearIterator< TAlgebra::vector_type > | |
SmartPtr< IDamping< TAlgebra::vector_type, TAlgebra::vector_type > > | m_spDamping |
the scaling More... | |
Protected Attributes inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type > | |
SmartPtr< IVectorDebugWriter< vector_type > > | m_spVectorDebugWriter |
Debug Writer. More... | |
Private Types | |
typedef VectorDebugWritingObject< typename TAlgebra::vector_type > | vdwo_type |
Debugging iterator.
This class implements an iterator that can be used for debugging:
It wraps for an ILinearIterator<typename TAlgebra::vector_type> object, which can be used as usual, i.e., all call are forwarded. Moreover, this class can determine the algebarically smooth error. In order to doso, one must specify a solver. This solver is called once during initialization.
This class is a VectorDebugWritingObject <typename TAlgebra::vector_type>. If a DebugWriter is supplied using use the set_debug routines, the smooth error is written to file.
typedef TAlgebra ug::DebugIterator< TAlgebra >::algebra_type |
typedef ILinearIterator<typename TAlgebra::vector_type> ug::DebugIterator< TAlgebra >::base_type |
typedef TAlgebra::matrix_type ug::DebugIterator< TAlgebra >::matrix_type |
typedef IPreconditionedLinearOperatorInverse<vector_type> ug::DebugIterator< TAlgebra >::solver_type |
|
private |
typedef TAlgebra::vector_type ug::DebugIterator< TAlgebra >::vector_type |
|
inline |
Constructor.
References ug::DebugIterator< TAlgebra >::m_pOperator.
|
inline |
|
inlineprotectedvirtual |
forwarding call to original preconditioner
Implements ug::ILinearIterator< TAlgebra::vector_type >.
References ug::DebugIterator< TAlgebra >::m_pprecond.
|
inlineprotectedvirtual |
forwarding call to original preconditioner
Implements ug::ILinearIterator< TAlgebra::vector_type >.
References ug::DebugIterator< TAlgebra >::m_pprecond.
|
inlinevirtual |
Clone.
Implements ug::ILinearIterator< TAlgebra::vector_type >.
References ug::ILinearIterator< TAlgebra::vector_type >::damping(), ug::DebugIterator< TAlgebra >::from, ug::DebugIterator< TAlgebra >::get_preconditioner(), ug::DebugIterator< TAlgebra >::get_solver(), ug::DebugIterator< TAlgebra >::to, and ug::VectorDebugWritingObject< TVector >::vector_debug_writer().
|
inlineprotected |
Determines algebraically smooth error.
Solves Ae=0 starting from a random initial guess.
References ug::DebugIterator< TAlgebra >::from, SmartPtr< T, FreePolicy >::invalid(), ug::DebugIterator< TAlgebra >::m_pOperator, ug::DebugIterator< TAlgebra >::m_solver, ug::DebugIterator< TAlgebra >::m_spSolVector, ug::DebugIterator< TAlgebra >::to, UG_LOG, and ug::VectorDebugWritingObject< TAlgebra::vector_type >::write_debug().
Referenced by ug::DebugIterator< TAlgebra >::init().
|
inlineprotected |
get reference to 'real' preconditioner
References ug::DebugIterator< TAlgebra >::m_pprecond.
Referenced by ug::DebugIterator< TAlgebra >::clone().
|
inlineprotected |
get reference to aux. solver
References ug::DebugIterator< TAlgebra >::m_solver.
Referenced by ug::DebugIterator< TAlgebra >::clone().
|
inlineprotectedvirtual |
init (expensive)
References SmartPtr< T, FreePolicy >::invalid(), ug::DebugIterator< TAlgebra >::name(), and UG_THROW.
Referenced by ug::DebugIterator< TAlgebra >::init().
|
inlineprotectedvirtual |
init (expensive)
References ug::DebugIterator< TAlgebra >::init(), SmartPtr< T, FreePolicy >::invalid(), ug::DebugIterator< TAlgebra >::name(), and UG_THROW.
|
inlineprotected |
init (expensive, since it calls
References ug::DebugIterator< TAlgebra >::find_smooth_error(), ug::DebugIterator< TAlgebra >::m_pOperator, and ug::DebugIterator< TAlgebra >::m_pprecond.
|
inlineprotectedvirtual |
name of preconditioner
Implements ug::ILinearIterator< TAlgebra::vector_type >.
Referenced by ug::DebugIterator< TAlgebra >::init().
|
inline |
specify the real preconditioner (used for iterating)
References ug::DebugIterator< TAlgebra >::m_pprecond.
Referenced by ug::DebugIterator< TAlgebra >::DebugIterator().
|
inline |
specify bounds for random initial guess (optional)
References ug::DebugIterator< TAlgebra >::from, and ug::DebugIterator< TAlgebra >::to.
|
inline |
References ug::DebugIterator< TAlgebra >::m_spSolVector.
|
inline |
specify the solver that will be used for debugging (optional)
References ug::DebugIterator< TAlgebra >::m_solver.
Referenced by ug::DebugIterator< TAlgebra >::DebugIterator().
|
inlinevirtual |
returns if parallel solving is supported
Implements ug::ILinearIterator< TAlgebra::vector_type >.
References ug::DebugIterator< TAlgebra >::m_pprecond.
|
protected |
|
protected |
|
protected |
Referenced by ug::DebugIterator< TAlgebra >::apply(), ug::DebugIterator< TAlgebra >::apply_update_defect(), ug::DebugIterator< TAlgebra >::get_preconditioner(), ug::DebugIterator< TAlgebra >::init(), ug::DebugIterator< TAlgebra >::set_preconditioner(), and ug::DebugIterator< TAlgebra >::supports_parallel().
|
protected |
|
protected |
|
protected |