33 #ifndef __H__LIB_ALGEBRA__OPERATOR__INTERFACE__PRECONDITIONER__
34 #define __H__LIB_ALGEBRA__OPERATOR__INTERFACE__PRECONDITIONER__
99 template <
typename TAlgebra>
151 virtual const char*
name()
const = 0;
197 J.template cast_dynamic<MatrixOperator<matrix_type, vector_type> >();
202 "not based on matrix. This Preconditioner can only "
203 "handle matrix-based operators.");
227 L.template cast_dynamic<MatrixOperator<matrix_type, vector_type> >();
232 "not based on matrix. This Preconditioner can only "
233 "handle matrix-based operators.");
258 UG_THROW(
name() <<
"::init': Passed Operator is invalid.");
263 UG_LOG(
"ERROR in '"<<
name()<<
"::init': Preprocess failed.\n");
289 UG_LOG(
"ERROR in '"<<
name()<<
"::apply': Iterator not initialized.\n");
297 "storage format. Defect must be additive.");
307 UG_LOG(
"ERROR in '"<<
name()<<
"::apply': Step Routine failed.\n");
321 "parallel storage type of correction to consistent.");
341 if(!
apply(c, d))
return false;
356 UG_THROW(
"ERROR in '"<<
name()<<
"::init': Preprocess failed.\n");
Definition: smart_pointer.h:108
bool invalid() const
returns true if the pointer is invalid, false if not.
Definition: smart_pointer.h:212
Definition: debug_writer.h:354
TAlgebra::vector_type vector_type
type of vector
Definition: debug_writer.h:360
base class for all debug writer
Definition: debug_writer.h:244
describes a linear iterator
Definition: linear_iterator.h:81
SmartPtr< IDamping< TAlgebra::vector_type, TAlgebra::vector_type > > damping()
returns the scaling
Definition: linear_iterator.h:173
describes a linear mapping X->Y
Definition: linear_operator.h:80
describes a linear iterator that is based on a matrix operator
Definition: preconditioner.h:103
TAlgebra algebra_type
Algebra type.
Definition: preconditioner.h:106
virtual ~IPreconditioner()
virtual destructor
Definition: preconditioner.h:363
bool m_bInit
init flag indicating if init has been called
Definition: preconditioner.h:385
SmartPtr< ILinearOperator< vector_type > > m_spDefectOperator
underlying matrix based operator for calculation of defect
Definition: preconditioner.h:379
TAlgebra::matrix_type matrix_type
Matrix type.
Definition: preconditioner.h:112
virtual bool apply(vector_type &c, const vector_type &d)
compute new correction c = B*d
Definition: preconditioner.h:284
IPreconditioner(const IPreconditioner< TAlgebra > &parent)
clone constructor
Definition: preconditioner.h:136
bool m_bOtherApproxOperator
Definition: preconditioner.h:387
IPreconditioner(SmartPtr< IDebugWriter< algebra_type > > spDebugWriter)
constructor setting debug writer
Definition: preconditioner.h:130
virtual bool postprocess()=0
cleans the operator
MatrixOperator< matrix_type, vector_type > matrix_operator_type
Matrix Operator type.
Definition: preconditioner.h:115
SmartPtr< MatrixOperator< matrix_type, vector_type > > approx_operator()
underlying matrix based operator used for the preconditioner
Definition: preconditioner.h:372
virtual const char * name() const =0
returns the name of iterator
SmartPtr< MatrixOperator< matrix_type, vector_type > > m_spApproxOperator
underlying matrix based operator used for the preconditioner
Definition: preconditioner.h:381
bool init(SmartPtr< MatrixOperator< matrix_type, vector_type > > Op)
initializes the preconditioner for a matrix based operator
Definition: preconditioner.h:250
virtual bool apply_update_defect(vector_type &c, vector_type &d)
compute new correction c = B*d and update defect d:= d - L*c
Definition: preconditioner.h:338
virtual bool preprocess(SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp)=0
initializes the preconditioner
virtual void set_approximation(SmartPtr< MatrixOperator< matrix_type, vector_type > > approx)
Definition: preconditioner.h:350
virtual bool init(SmartPtr< ILinearOperator< vector_type > > J, const vector_type &u)
implements the ILinearIterator-interface for matrix based preconditioner
Definition: preconditioner.h:192
SmartPtr< MatrixOperator< matrix_type, vector_type > > defect_operator()
underlying matrix based operator for calculation of defect
Definition: preconditioner.h:366
virtual bool step(SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp, vector_type &c, const vector_type &d)=0
computes a new correction c = B*d
bool init(SmartPtr< ILinearOperator< vector_type > > L)
implements the ILinearIterator-interface for matrix based preconditioner
Definition: preconditioner.h:219
TAlgebra::vector_type vector_type
Vector type.
Definition: preconditioner.h:109
IPreconditioner()
default constructor
Definition: preconditioner.h:125
Definition: matrix_operator.h:49
@ PST_CONSISTENT
Definition: parallel_storage_type.h:68
@ PST_ADDITIVE
Definition: parallel_storage_type.h:69
#define THROW_IF_NOT_EQUAL_4(s1, s2, s3, s4)
Definition: error.h:183
#define UG_THROW(msg)
Definition: error.h:57
#define UG_LOG(msg)
Definition: log.h:367
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
double number
Definition: types.h:124