33 #ifndef __H__UG__LIB_DISC__OPERATOR__LINEAR_OPERATOR__LINEAR_SOLVER__
34 #define __H__UG__LIB_DISC__OPERATOR__LINEAR_OPERATOR__LINEAR_SOLVER__
54 template <
typename TVector>
82 virtual const char*
name()
const {
return "Iterative Linear Solver";}
105 UG_LOG(
"ERROR in 'LinearSolver': Could not apply preconditioner. Aborting.\n");
121 UG_THROW(
"LinearSolver::apply: Inadequate parallel storage format of Vectors: "
122 << b.get_storage_type() <<
" for b (expected " <<
PST_ADDITIVE <<
"), "
123 << x.get_storage_type() <<
" for x (expected " <<
PST_CONSISTENT <<
")");
186 UG_LOG(
"ERROR in 'LinearSolver::apply': post-convergence-check "
187 "signaled failure. Aborting.\n");
222 s =
" (No Preconditioner) ";
231 char ext[20]; snprintf(ext,
sizeof(ext),
"_iter%03d", loopCnt);
232 write_debug(d, std::string(
"LS_Defect") + ext +
".vec");
233 if(bWriteC)
write_debug(c, std::string(
"LS_Correction") + ext +
".vec");
234 write_debug(x, std::string(
"LS_Solution") + ext +
".vec");
241 char ext[20]; snprintf(ext,
sizeof(ext),
"_iter%03d", loopCnt);
Definition: smart_pointer.h:108
Definition: convergence_check.h:72
describes a linear iterator
Definition: linear_iterator.h:81
ConstSmartPtr< IConvergenceCheck< X > > convergence_check() const
returns the convergence check
Definition: linear_operator_inverse.h:202
SmartPtr< ILinearOperator< Y, X > > linear_operator()
returns the current Operator this Inverse Operator is initialized for
Definition: linear_operator_inverse.h:227
virtual bool apply_update_defect(Y &u, X &f)
Definition: linear_operator_inverse.h:190
interface for pre- and postprocess functions
Definition: pprocess.h:59
describes an inverse linear mapping X->X
Definition: preconditioned_linear_operator_inverse.h:63
SmartPtr< ILinearIterator< X, X > > preconditioner()
Definition: preconditioned_linear_operator_inverse.h:118
linear solver using abstract preconditioner interface
Definition: linear_solver.h:57
TVector vector_type
Vector type.
Definition: linear_solver.h:60
bool compute_correction(vector_type &c, vector_type &d)
Definition: linear_solver.h:98
virtual const char * name() const
returns the name of the solver
Definition: linear_solver.h:82
void write_debugXCD(vector_type &x, vector_type &c, vector_type &d, int loopCnt, bool bWriteC)
debugger output: solution, correction, defect
Definition: linear_solver.h:228
IPreconditionedLinearOperatorInverse< vector_type > base_type
Base type.
Definition: linear_solver.h:63
LinearSolver(SmartPtr< ILinearIterator< vector_type, vector_type > > spPrecond)
Definition: linear_solver.h:68
virtual bool supports_parallel() const
returns if parallel solving is supported
Definition: linear_solver.h:85
LinearSolver(SmartPtr< ILinearIterator< vector_type, vector_type > > spPrecond, SmartPtr< IConvergenceCheck< vector_type > > spConvCheck)
Definition: linear_solver.h:71
virtual bool apply_return_defect(vector_type &x, vector_type &b)
solves the system and returns the last defect
Definition: linear_solver.h:114
SmartPtr< ILinearIterator< X, X > > preconditioner()
Definition: preconditioned_linear_operator_inverse.h:118
void add_postprocess_corr(SmartPtr< IPProcessVector< vector_type > > p)
adds a post-process for the iterates
Definition: linear_solver.h:199
PProcessChain< vector_type > m_corr_post_process
postprocessor for the correction in the iterations
Definition: linear_solver.h:247
void enter_precond_debug_section(int loopCnt)
debugger section for the preconditioner
Definition: linear_solver.h:238
void remove_postprocess_corr(SmartPtr< IPProcessVector< vector_type > > p)
removes a post-process for the iterates
Definition: linear_solver.h:205
LinearSolver()
constructors
Definition: linear_solver.h:66
void prepare_conv_check()
prepares the convergence check output
Definition: linear_solver.h:212
void add(SmartPtr< p_process_type > p)
adds an operation at the end of the chain
Definition: pprocess.h:96
void apply(vector_type &v)
performs all the operations
Definition: pprocess.h:86
void remove(SmartPtr< p_process_type > p)
removes an operation from the chain
Definition: pprocess.h:108
bool vector_debug_writer_valid() const
returns true if the debug writer is set
Definition: debug_writer.h:290
void enter_vector_debug_writer_section(std::string secDir)
enters a debugging section
Definition: debug_writer.h:331
void leave_vector_debug_writer_section()
leaves a debugging section
Definition: debug_writer.h:342
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
TVector vector_type
type of vector
Definition: debug_writer.h:269
@ PST_CONSISTENT
Definition: parallel_storage_type.h:68
@ PST_ADDITIVE
Definition: parallel_storage_type.h:69
#define UG_THROW(msg)
Definition: error.h:57
#define UG_LOG(msg)
Definition: log.h:367
#define LS_PROFILE_BEGIN(name)
Definition: linear_solver_profiling.h:40
#define LS_PROFILE_END(name)
Definition: linear_solver_profiling.h:41