33 #ifndef __H__LIB_ALGEBRA__OPERATOR__INTERFACE__PRECONDITIONED_LINEAR_OPERATOR_INVERSE__
34 #define __H__LIB_ALGEBRA__OPERATOR__INTERFACE__PRECONDITIONED_LINEAR_OPERATOR_INVERSE__
130 UG_THROW(
name() <<
"::init: Cannot init Preconditioner "
131 "Operator for Operator J.");
145 UG_THROW(
name() <<
"::prepare: Cannot init Preconditioner "
146 "Operator for Operator L.");
152 virtual bool apply(X& x,
const X& b)
169 number norm = bTmp.norm();
172 UG_LOG(
"%%%% DEBUG "<<
name()<<
": (Re)computed defect has norm: "
184 myError.set_random(-1.0, 1.0);
202 std::stringstream ss;
203 ss <<
" Convergence Check: ";
205 else ss <<
" NOT SET!\n";
206 ss <<
" Preconditioner: ";
208 else ss <<
" NOT SET!\n";
215 std::stringstream ss;
234 void set_debug_amg(
int b) {m_amgDebug = b;}
Definition: smart_pointer.h:296
Definition: smart_pointer.h:108
Definition: convergence_check.h:72
describes an inverse linear mapping X->Y
Definition: linear_operator_inverse.h:80
SmartPtr< ILinearOperator< X, X > > linear_operator()
returns the current Operator this Inverse Operator is initialized for
Definition: linear_operator_inverse.h:227
virtual bool apply_return_defect(X &u, X &f)=0
applies inverse operator, i.e. returns u = A^{-1} f and returns defect d := f - A*u
virtual bool init(SmartPtr< ILinearOperator< X, X > > L)
initializes for the inverse for a linear operator
Definition: linear_operator_inverse.h:135
SmartPtr< IConvergenceCheck< X > > m_spConvCheck
smart pointer holding the convergence check
Definition: linear_operator_inverse.h:241
virtual const char * name() const=0
returns the name of the operator inverse
describes an inverse linear mapping X->X
Definition: preconditioned_linear_operator_inverse.h:63
SmartPtr< ILinearIterator< X, X > > m_spPrecond
Iterator used in the iterative scheme to compute the correction and update the defect.
Definition: preconditioned_linear_operator_inverse.h:230
virtual bool init(SmartPtr< ILinearOperator< X, X > > L)
initializes the solver for an operator
Definition: preconditioned_linear_operator_inverse.h:138
ConstSmartPtr< ILinearIterator< X, X > > preconditioner() const
Definition: preconditioned_linear_operator_inverse.h:119
void set_compute_fresh_defect_when_finished(bool bRecompute)
for debug: computes norm again after whole calculation of apply
Definition: preconditioned_linear_operator_inverse.h:221
IPreconditionedLinearOperatorInverse(SmartPtr< ILinearIterator< X, X > > spPrecond, SmartPtr< IConvergenceCheck< X > > spConvCheck)
constructor setting the preconditioner
Definition: preconditioned_linear_operator_inverse.h:101
IPreconditionedLinearOperatorInverse()
Empty constructor.
Definition: preconditioned_linear_operator_inverse.h:85
virtual bool init(SmartPtr< ILinearOperator< X, X > > J, const X &u)
initializes the solver for an operator
Definition: preconditioned_linear_operator_inverse.h:123
X domain_function_type
Domain space.
Definition: preconditioned_linear_operator_inverse.h:66
ILinearOperatorInverse< X, X > base_type
Base class.
Definition: preconditioned_linear_operator_inverse.h:72
bool m_bRecompute
flag if fresh defect should be computed when finish for debug purpose
Definition: preconditioned_linear_operator_inverse.h:228
virtual bool apply(X &x, const X &b)
compute new correction c = B*d
Definition: preconditioned_linear_operator_inverse.h:152
void set_preconditioner(SmartPtr< ILinearIterator< X, X > > spPrecond)
sets the preconditioner
Definition: preconditioned_linear_operator_inverse.h:111
SmartPtr< ILinearIterator< X, X > > preconditioner()
Definition: preconditioned_linear_operator_inverse.h:118
IPreconditionedLinearOperatorInverse(SmartPtr< ILinearIterator< X, X > > spPrecond)
constructor setting the preconditioner
Definition: preconditioned_linear_operator_inverse.h:93
virtual std::string config_string() const
returns information about configuration parameters
Definition: preconditioned_linear_operator_inverse.h:213
X codomain_function_type
Range space.
Definition: preconditioned_linear_operator_inverse.h:69
std::string config_string_preconditioner_convergence_check() const
returns config information of convergence check and preconditioner
Definition: preconditioned_linear_operator_inverse.h:200
Definition: debug_writer.h:266
void write_debug(const vector_type &vec, const char *filename)
writing debug output for a vector (if debug writer set)
Definition: debug_writer.h:293
#define UG_THROW(msg)
Definition: error.h:57
#define UG_LOG(msg)
Definition: log.h:367
double number
Definition: types.h:124
#define LS_PROFILE_BEGIN(name)
Definition: linear_solver_profiling.h:40
#define LS_PROFILE_END(name)
Definition: linear_solver_profiling.h:41
string ConfigShift(string s)
Definition: string_util.cpp:457