ug4
ug::DebugIterator< TAlgebra > Class Template Reference

Debugging iterator. More...

#include <debug_iterator.h>

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

Public Types

typedef TAlgebra algebra_type
 
typedef ILinearIterator< typename TAlgebra::vector_typebase_type
 
typedef TAlgebra::matrix_type matrix_type
 
typedef IPreconditionedLinearOperatorInverse< vector_typesolver_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_typeget_preconditioner ()
 get reference to 'real' preconditioner More...
 
SmartPtr< solver_typeget_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_typem_pprecond
 
SmartPtr< solver_typem_solver
 
SmartPtr< vector_typem_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_typevdwo_type
 

Detailed Description

template<typename TAlgebra>
class ug::DebugIterator< TAlgebra >

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.

Member Typedef Documentation

◆ algebra_type

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

◆ base_type

template<typename TAlgebra >
typedef ILinearIterator<typename TAlgebra::vector_type> ug::DebugIterator< TAlgebra >::base_type

◆ matrix_type

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

◆ solver_type

template<typename TAlgebra >
typedef IPreconditionedLinearOperatorInverse<vector_type> ug::DebugIterator< TAlgebra >::solver_type

◆ vdwo_type

template<typename TAlgebra >
typedef VectorDebugWritingObject<typename TAlgebra::vector_type> ug::DebugIterator< TAlgebra >::vdwo_type
private

◆ vector_type

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

Constructor & Destructor Documentation

◆ DebugIterator() [1/2]

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

◆ DebugIterator() [2/2]

Member Function Documentation

◆ apply()

template<typename TAlgebra >
virtual bool ug::DebugIterator< TAlgebra >::apply ( vector_type c,
const vector_type d 
)
inlineprotectedvirtual

forwarding call to original preconditioner

Implements ug::ILinearIterator< TAlgebra::vector_type >.

References ug::DebugIterator< TAlgebra >::m_pprecond.

◆ apply_update_defect()

template<typename TAlgebra >
virtual bool ug::DebugIterator< TAlgebra >::apply_update_defect ( vector_type c,
vector_type d 
)
inlineprotectedvirtual

forwarding call to original preconditioner

Implements ug::ILinearIterator< TAlgebra::vector_type >.

References ug::DebugIterator< TAlgebra >::m_pprecond.

◆ clone()

◆ find_smooth_error()

template<typename TAlgebra >
bool ug::DebugIterator< TAlgebra >::find_smooth_error ( )
inlineprotected

◆ get_preconditioner()

template<typename TAlgebra >
SmartPtr<base_type> ug::DebugIterator< TAlgebra >::get_preconditioner ( )
inlineprotected

get reference to 'real' preconditioner

References ug::DebugIterator< TAlgebra >::m_pprecond.

Referenced by ug::DebugIterator< TAlgebra >::clone().

◆ get_solver()

template<typename TAlgebra >
SmartPtr<solver_type> ug::DebugIterator< TAlgebra >::get_solver ( )
inlineprotected

get reference to aux. solver

References ug::DebugIterator< TAlgebra >::m_solver.

Referenced by ug::DebugIterator< TAlgebra >::clone().

◆ init() [1/3]

template<typename TAlgebra >
virtual bool ug::DebugIterator< TAlgebra >::init ( SmartPtr< ILinearOperator< vector_type > >  J,
const vector_type u 
)
inlineprotectedvirtual

◆ init() [2/3]

template<typename TAlgebra >
virtual bool ug::DebugIterator< TAlgebra >::init ( SmartPtr< ILinearOperator< vector_type > >  L)
inlineprotectedvirtual

◆ init() [3/3]

template<typename TAlgebra >
bool ug::DebugIterator< TAlgebra >::init ( SmartPtr< MatrixOperator< matrix_type, vector_type > >  pOp)
inlineprotected

◆ name()

template<typename TAlgebra >
virtual const char* ug::DebugIterator< TAlgebra >::name ( ) const
inlineprotectedvirtual

◆ set_preconditioner()

template<typename TAlgebra >
void ug::DebugIterator< TAlgebra >::set_preconditioner ( SmartPtr< base_type pprecond)
inline

specify the real preconditioner (used for iterating)

References ug::DebugIterator< TAlgebra >::m_pprecond.

Referenced by ug::DebugIterator< TAlgebra >::DebugIterator().

◆ set_random_bounds()

template<typename TAlgebra >
void ug::DebugIterator< TAlgebra >::set_random_bounds ( double  a,
double  b 
)
inline

specify bounds for random initial guess (optional)

References ug::DebugIterator< TAlgebra >::from, and ug::DebugIterator< TAlgebra >::to.

◆ set_solution()

template<typename TAlgebra >
void ug::DebugIterator< TAlgebra >::set_solution ( SmartPtr< vector_type sol)
inline

◆ set_solver()

template<typename TAlgebra >
void ug::DebugIterator< TAlgebra >::set_solver ( SmartPtr< solver_type psolver)
inline

specify the solver that will be used for debugging (optional)

References ug::DebugIterator< TAlgebra >::m_solver.

Referenced by ug::DebugIterator< TAlgebra >::DebugIterator().

◆ supports_parallel()

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

returns if parallel solving is supported

Implements ug::ILinearIterator< TAlgebra::vector_type >.

References ug::DebugIterator< TAlgebra >::m_pprecond.

Member Data Documentation

◆ from

◆ m_pOperator

◆ m_pprecond

◆ m_solver

◆ m_spSolVector

template<typename TAlgebra >
SmartPtr<vector_type> ug::DebugIterator< TAlgebra >::m_spSolVector
protected

◆ to


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