FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Solver::PSD< Matrix_, Filter_ > Class Template Referenceabstract

(Preconditioned) Steepest-Descent solver implementation More...

#include <psd.hpp>

Inheritance diagram for FEAT::Solver::PSD< Matrix_, Filter_ >:
FEAT::Solver::PreconditionedIterativeSolver< Matrix_::VectorTypeR > FEAT::Solver::IterativeSolver< Vector_ > FEAT::Solver::SolverBase< Vector_ >

Public Types

typedef PreconditionedIterativeSolver< VectorType > BaseClass
 
typedef MatrixType::DataType DataType
 
typedef Filter_ FilterType
 
typedef Matrix_ MatrixType
 
typedef SolverBase< VectorType > PrecondType
 
typedef MatrixType::VectorTypeR VectorType
 

Public Member Functions

 PSD (const MatrixType &matrix, const FilterType &filter, std::shared_ptr< PrecondType > precond=nullptr)
 Constructor. More...
 
 PSD (const String &section_name, const PropertyMap *section, const MatrixType &matrix, const FilterType &filter, std::shared_ptr< PrecondType > precond=nullptr)
 Constructor using a PropertyMap. More...
 
virtual Status apply (Vector_ &vec_cor, const Vector_ &vec_def)=0
 Solver application method. More...
 
virtual Status apply (VectorType &vec_cor, const VectorType &vec_def) override
 
DataType calc_convergence_rate () const
 Computes the overall convergence rate: (defect_final / defect_initial) ^ (1 / number of iterations) More...
 
DataType calc_defect_reduction () const
 Computes the overall defect reduction factor: (defect_final / defect_inital) More...
 
virtual Status correct (VectorType &vec_sol, const VectorType &vec_rhs) override
 
virtual Status correct (VectorType &vec_sol, const VectorType &vec_rhs)=0
 Solver correction method. More...
 
virtual void done ()
 Finalization method. More...
 
virtual void done_numeric () override
 
virtual void done_symbolic () override
 Symbolic finalization method. More...
 
virtual void force_defect_norm_calc (bool force)
 Forces the calculation of defect norms in every iteration. More...
 
DataType get_def_final () const
 Returns the final defect. More...
 
DataType get_def_initial () const
 Returns the initial defect. More...
 
DataType get_div_abs () const
 Returns the absolute divergence. More...
 
DataType get_div_rel () const
 Returns the relative divergence. More...
 
Index get_max_iter () const
 Returns the maximum number of iterations. More...
 
Index get_min_iter () const
 Returns the minimal number of iterations. More...
 
Index get_min_stag_iter () const
 Returns the minimum stagnation iteration count. More...
 
Index get_num_iter () const
 Returns number of performed iterations. More...
 
String get_plot_name () const
 Returns the plot name of the solver. More...
 
DataType get_stag_rate () const
 Returns the stagnation rate. More...
 
Status get_status () const
 Returns the status. More...
 
virtual String get_summary () const
 Returns a summary string. More...
 
DataType get_tol_abs () const
 Returns the absolute tolerance. More...
 
DataType get_tol_abs_low () const
 Returns the lower absolute tolerance. More...
 
DataType get_tol_rel () const
 Returns the relative tolerance. More...
 
virtual void init ()
 Initialization method. More...
 
virtual void init_numeric () override
 
virtual void init_symbolic () override
 Symbolic initialization method. More...
 
bool is_converged () const
 checks for convergence More...
 
bool is_converged (const DataType def_cur) const
 checks for convergence More...
 
bool is_diverged () const
 checks for divergence More...
 
bool is_diverged (const DataType def_cur) const
 checks for divergence More...
 
virtual String name () const override
 Returns a descriptive string. More...
 
virtual void plot_summary () const
 Plot a summary of the last solver run. More...
 
void set_div_abs (DataType div_abs)
 Sets the absolute divergence for the solver. More...
 
void set_div_rel (DataType div_rel)
 Sets the relative divergence for the solver. More...
 
void set_max_iter (Index max_iter)
 Sets the maximum iteration count for the solver. More...
 
void set_min_iter (Index min_iter)
 Sets the minimum iteration count for the solver. More...
 
void set_min_stag_iter (Index min_iter)
 Sets the minimum stagnate iteration count for the solver. More...
 
void set_plot_interval (const Index plot_interval)
 Sets the interval between two plot outputs, if any. More...
 
void set_plot_mode (const PlotMode plot_mode)
 Sets the plot mode of the solver. More...
 
void set_plot_name (const String &plot_name)
 Sets the plot name of the solver. More...
 
void set_stag_rate (DataType rate)
 Sets the stagnation rate for the solver. More...
 
void set_tol_abs (DataType tol_abs)
 Sets the absolute tolerance for the solver. More...
 
void set_tol_abs_low (DataType tol_abs_low)
 Sets the lower absolute tolerance for the solver. More...
 
void set_tol_rel (DataType tol_rel)
 Sets the relative tolerance for the solver. More...
 

Protected Member Functions

virtual Status _analyze_defect (Index num_iter, DataType def_cur, DataType def_prev, bool check_stag)
 Internal function: analyze the current defect. More...
 
virtual Status _apply_intern (VectorType &vec_sol)
 
bool _apply_precond (VectorType &vec_cor, const VectorType &vec_def, const Filter_ &filter)
 Applies the preconditioner onto a defect vector. More...
 
virtual DataType _calc_def_norm (const VectorType &vec_def, const VectorType &vec_sol)
 Computes the defect norm. More...
 
bool _plot_iter (Status st=Status::progress) const
 Plot the current iteration? More...
 
virtual void _plot_iter_line (Index num_iter, DataType def_cur, DataType def_prev)
 Plots an iteration line. More...
 
bool _plot_summary () const
 Plot summary? More...
 
void _print_line (const String &line) const
 Prints a line. More...
 
bool _progress () const
 Progress iteration? More...
 
void _set_comm (const Dist::Comm *comm)
 Sets the communicator for the solver directly. More...
 
template<typename Matrix_ >
void _set_comm_by_matrix (const Matrix_ &matrix)
 Sets the communicator for the solver from a matrix. More...
 
void _set_comm_by_vector (const Vector_ &vector)
 Sets the communicator for the solver from a vector. More...
 
virtual Status _set_initial_defect (const VectorType &vec_def, const VectorType &vec_sol)
 Internal function: sets the initial defect vector. More...
 
virtual Status _set_new_defect (const VectorType &vec_def, const VectorType &vec_sol)
 Internal function: sets the new (next) defect vector. More...
 
virtual Status _update_defect (const DataType def_cur_norm)
 Internal function: sets the new (next) defect norm. More...
 

Protected Attributes

const Dist::Comm_comm
 Communicator of the solver. More...
 
DataType _def_cur
 current defect More...
 
DataType _def_init
 initial defect More...
 
DataType _def_prev
 previous iteration defect More...
 
DataType _div_abs
 absolute divergence parameter More...
 
DataType _div_rel
 relative divergence parameter More...
 
bool _force_def_norm_calc
 whether skipping of defect computation is allowed or not More...
 
Index _iter_digits
 iteration count digits for plotting More...
 
Index _max_iter
 maximum number of iterations More...
 
Index _min_iter
 minimum number of iterations More...
 
Index _min_stag_iter
 minimum number of stagnation iterations More...
 
Index _num_iter
 number of performed iterations More...
 
Index _num_stag_iter
 number of consecutive stagnated iterations More...
 
Index _plot_interval
 plot output interval More...
 
PlotMode _plot_mode
 whether to plot something More...
 
String _plot_name
 name of the solver in plots More...
 
std::shared_ptr< PrecondType_precond
 the pointer to the preconditioner More...
 
DataType _stag_rate
 stagnation rate More...
 
Status _status
 current status of the solver More...
 
const FilterType & _system_filter
 the filter for the solver More...
 
const MatrixType & _system_matrix
 the matrix for the solver More...
 
DataType _tol_abs
 absolute tolerance parameter More...
 
DataType _tol_abs_low
 absolute low tolerance parameter More...
 
DataType _tol_rel
 relative tolerance parameter More...
 
VectorType _vec_q
 
VectorType _vec_r
 temporary vectors More...
 
VectorType _vec_z
 

Detailed Description

template<typename Matrix_, typename Filter_>
class FEAT::Solver::PSD< Matrix_, Filter_ >

(Preconditioned) Steepest-Descent solver implementation

This class implements a simple preconditioned steepest descent solver.

Template Parameters
Matrix_The matrix class to be used by the solver.
Filter_The filter class to be used by the solver.
See also
Chapter 5.3.1, Algorithm 5.2 in [Saad03]
Author
Peter Zajac

Definition at line 33 of file psd.hpp.

Member Typedef Documentation

◆ BaseClass

template<typename Matrix_ , typename Filter_ >
typedef PreconditionedIterativeSolver<VectorType> FEAT::Solver::PSD< Matrix_, Filter_ >::BaseClass

Definition at line 41 of file psd.hpp.

◆ DataType

template<typename Matrix_ , typename Filter_ >
typedef MatrixType::DataType FEAT::Solver::PSD< Matrix_, Filter_ >::DataType

Definition at line 40 of file psd.hpp.

◆ FilterType

template<typename Matrix_ , typename Filter_ >
typedef Filter_ FEAT::Solver::PSD< Matrix_, Filter_ >::FilterType

Definition at line 38 of file psd.hpp.

◆ MatrixType

template<typename Matrix_ , typename Filter_ >
typedef Matrix_ FEAT::Solver::PSD< Matrix_, Filter_ >::MatrixType

Definition at line 37 of file psd.hpp.

◆ PrecondType

template<typename Matrix_ , typename Filter_ >
typedef SolverBase<VectorType> FEAT::Solver::PSD< Matrix_, Filter_ >::PrecondType

Definition at line 43 of file psd.hpp.

◆ VectorType

template<typename Matrix_ , typename Filter_ >
typedef MatrixType::VectorTypeR FEAT::Solver::PSD< Matrix_, Filter_ >::VectorType

Definition at line 39 of file psd.hpp.

Constructor & Destructor Documentation

◆ PSD() [1/2]

template<typename Matrix_ , typename Filter_ >
FEAT::Solver::PSD< Matrix_, Filter_ >::PSD ( const MatrixType &  matrix,
const FilterType &  filter,
std::shared_ptr< PrecondType precond = nullptr 
)
inlineexplicit

Constructor.

Parameters
[in]matrixA reference to the system matrix.
[in]filterA reference to the system filter.
[in]precondA pointer to the preconditioner. May be nullptr.

Definition at line 66 of file psd.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_set_comm_by_matrix().

◆ PSD() [2/2]

template<typename Matrix_ , typename Filter_ >
FEAT::Solver::PSD< Matrix_, Filter_ >::PSD ( const String section_name,
const PropertyMap section,
const MatrixType &  matrix,
const FilterType &  filter,
std::shared_ptr< PrecondType precond = nullptr 
)
inlineexplicit

Constructor using a PropertyMap.

Parameters
[in]section_nameThe name of the config section, which it does not know by itself
[in]sectionA pointer to the PropertyMap section configuring this solver
[in]matrixThe system matrix.
[in]filterThe system filter.
[in]precondThe preconditioner. May be nullptr.

Definition at line 94 of file psd.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_set_comm_by_matrix().

Member Function Documentation

◆ _analyze_defect()

template<typename Vector_ >
virtual Status FEAT::Solver::IterativeSolver< Vector_ >::_analyze_defect ( Index  num_iter,
DataType  def_cur,
DataType  def_prev,
bool  check_stag 
)
inlineprotectedvirtualinherited

Internal function: analyze the current defect.

Note
This function is called by _set_new_defect() and _update_defect().
Parameters
[in]num_iterCurrent number of iterations; usually = this->_num_iter.
[in]def_curCurrent defect norm; usually = this->_def_cur.
[in]def_prevPrevious defect norm; usually = this->_def_prev.
[in]check_stagSpecifies whether to check (and update) the stagnation criterion. This is typically set to false if one wants to check anything else than the 'true' next defect norm.
Returns
The updated status code.

Definition at line 866 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_min_iter, FEAT::Solver::aborted, FEAT::Solver::diverged, FEAT::Solver::IterativeSolver< Vector_ >::is_converged(), FEAT::Solver::IterativeSolver< Vector_ >::is_diverged(), FEAT::Math::isfinite(), FEAT::Solver::max_iter, FEAT::Solver::progress, FEAT::Solver::stagnated, and FEAT::Solver::success.

Referenced by FEAT::Solver::IterativeSolver< Vector_ >::_set_new_defect(), and FEAT::Solver::IterativeSolver< Vector_ >::_update_defect().

◆ _apply_intern()

template<typename Matrix_ , typename Filter_ >
virtual Status FEAT::Solver::PSD< Matrix_, Filter_ >::_apply_intern ( VectorType &  vec_sol)
inlineprotectedvirtual

Definition at line 162 of file psd.hpp.

◆ _apply_precond()

bool FEAT::Solver::PreconditionedIterativeSolver< Matrix_::VectorTypeR >::_apply_precond ( VectorType vec_cor,
const VectorType vec_def,
const Filter_ &  filter 
)
inlineprotectedinherited

Applies the preconditioner onto a defect vector.

Note
If no preconditioner is present, this function will simply copy the input vector's contents into the output vector, therefore emulating an "identity preconditioner".
Attention
vec_cor and vec_def must not refer to the same vector object!
Parameters
[in,out]vec_corA reference to the vector that shall receive the preconditioned defect.
[in]vec_defA reference to the vector that is to be preconditioned.
[in]filterA reference to the system filter. This filter is only used if no preconditioner is present.
Returns
true, if the preconditioner application was successful, otherwise false.

Definition at line 1140 of file iterative.hpp.

◆ _calc_def_norm()

template<typename Vector_ >
virtual DataType FEAT::Solver::IterativeSolver< Vector_ >::_calc_def_norm ( const VectorType vec_def,
const VectorType vec_sol 
)
inlineprotectedvirtualinherited

Computes the defect norm.

Parameters
[in]vec_defThe current defect vector.
[in]vec_solThe current solution vector approximation.

Definition at line 706 of file iterative.hpp.

Referenced by FEAT::Solver::IterativeSolver< Vector_ >::_set_initial_defect(), FEAT::Solver::NLOptLS< Functional_, Filter_ >::_set_initial_defect(), FEAT::Solver::IterativeSolver< Vector_ >::_set_new_defect(), and FEAT::Solver::NLOptLS< Functional_, Filter_ >::_set_new_defect().

◆ _plot_iter()

◆ _plot_iter_line()

template<typename Vector_ >
virtual void FEAT::Solver::IterativeSolver< Vector_ >::_plot_iter_line ( Index  num_iter,
DataType  def_cur,
DataType  def_prev 
)
inlineprotectedvirtualinherited

Plots an iteration line.

Parameters
[in]num_iterCurrent number of iterations; usually = this->_num_iter.
[in]def_curCurrent defect norm; usually = this->_def_cur.
[in]def_prevPrevious defect norm; usually = this->_def_prev.

Definition at line 773 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_print_line(), FEAT::String::pad_front(), FEAT::stringify(), FEAT::stringify_fp_fix(), and FEAT::stringify_fp_sci().

Referenced by FEAT::Solver::RBiCGStab< Matrix_, Filter_ >::_apply_intern(), FEAT::Solver::BiCGStab< Matrix_, Filter_ >::_apply_intern(), FEAT::Solver::IterativeSolver< Vector_ >::_set_initial_defect(), FEAT::Solver::IterativeSolver< Vector_ >::_set_new_defect(), and FEAT::Solver::IterativeSolver< Vector_ >::_update_defect().

◆ _plot_summary()

template<typename Vector_ >
bool FEAT::Solver::IterativeSolver< Vector_ >::_plot_summary ( ) const
inlineprotectedinherited

◆ _print_line()

◆ _progress()

template<typename Vector_ >
bool FEAT::Solver::IterativeSolver< Vector_ >::_progress ( ) const
inlineprotectedinherited

Progress iteration?

Returns
true if the solver should process, otherwise false.

Definition at line 741 of file iterative.hpp.

References FEAT::Solver::progress.

◆ _set_comm()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::_set_comm ( const Dist::Comm comm)
inlineprotectedinherited

Sets the communicator for the solver directly.

Parameters
[in]commA pointer to the communicator that is to be used by the solver.

Definition at line 667 of file iterative.hpp.

◆ _set_comm_by_matrix()

◆ _set_comm_by_vector()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::_set_comm_by_vector ( const Vector_ &  vector)
inlineprotectedinherited

Sets the communicator for the solver from a vector.

Parameters
[in]vectorA reference to a vector. If 'Vector_' is a 'Global::Vector', then the communicator of the vector gate is taken.

Definition at line 692 of file iterative.hpp.

◆ _set_initial_defect()

template<typename Vector_ >
virtual Status FEAT::Solver::IterativeSolver< Vector_ >::_set_initial_defect ( const VectorType vec_def,
const VectorType vec_sol 
)
inlineprotectedvirtualinherited

◆ _set_new_defect()

template<typename Vector_ >
virtual Status FEAT::Solver::IterativeSolver< Vector_ >::_set_new_defect ( const VectorType vec_def,
const VectorType vec_sol 
)
inlineprotectedvirtualinherited

◆ _update_defect()

template<typename Vector_ >
virtual Status FEAT::Solver::IterativeSolver< Vector_ >::_update_defect ( const DataType  def_cur_norm)
inlineprotectedvirtualinherited

Internal function: sets the new (next) defect norm.

This function takes a pre-calculated defect vector norm, increments the iteration count, plots an output line to std::cout and checks whether any of the stopping criterions is fulfilled.

Parameters
[in]def_cur_normThe new defect norm.
Returns
The updated Status code.
Note
This function is preferred over _set_new_defect when using asynchronous mpi operations.

Definition at line 970 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_analyze_defect(), FEAT::Solver::IterativeSolver< Vector_ >::_def_cur, FEAT::Solver::IterativeSolver< Vector_ >::_num_iter, FEAT::Solver::IterativeSolver< Vector_ >::_plot_iter(), FEAT::Solver::IterativeSolver< Vector_ >::_plot_iter_line(), FEAT::Solver::IterativeSolver< Vector_ >::get_num_iter(), and FEAT::Solver::SolverBase< Vector_ >::name().

Referenced by FEAT::Solver::PipePCG< Matrix_, Filter_ >::_apply_intern(), FEAT::Solver::RBiCGStab< Matrix_, Filter_ >::_apply_intern(), and FEAT::Solver::GroppPCG< Matrix_, Filter_ >::_apply_intern().

◆ apply() [1/2]

template<typename Vector_ >
virtual Status FEAT::Solver::SolverBase< Vector_ >::apply ( Vector_ &  vec_cor,
const Vector_ &  vec_def 
)
pure virtualinherited

Solver application method.

This method applies the solver represented by this object onto a given defect vector and returns the corresponding correction vector.

Note
Solvers which derive from the IterativeSolver base class also provide a correct() method which corrects an initial solution instead of starting with the null vector.
Parameters
[out]vec_corThe vector that shall receive the solution of the linear system. It is assumed to be allocated, but its numerical contents may be undefined upon calling this method.
[in]vec_defThe vector that represents the right-hand-side of the linear system to be solved.
Attention
vec_cor and vec_def must not refer to the same vector object!
Returns
A Status code that represents the status of the solution step.

Implemented in FEAT::Solver::SchwarzPrecond< Global::Vector< LocalVector_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >, FEAT::Solver::CuSolverLU, FEAT::Solver::CuSolverQR, FEAT::Solver::ScalePrecond< Vector_, Filter_ >, FEAT::Solver::DiagonalPrecond< Vector_, Filter_ >, FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >, FEAT::Solver::NLOptPrecond< VectorType_, FilterType_ >, FEAT::Solver::AmaVanka< Matrix_, Filter_ >, FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >, FEAT::Solver::ConvertPrecond< Global::Vector< LocalVectorOuter_, MirrorOuter_ >, Global::Vector< LocalVectorInner_, MirrorInner_ > >, and FEAT::Solver::BFBT< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >.

Referenced by FEAT::Solver::solve().

◆ apply() [2/2]

template<typename Matrix_ , typename Filter_ >
virtual Status FEAT::Solver::PSD< Matrix_, Filter_ >::apply ( VectorType &  vec_cor,
const VectorType &  vec_def 
)
inlineoverridevirtual

Definition at line 127 of file psd.hpp.

◆ calc_convergence_rate()

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::calc_convergence_rate ( ) const
inlineinherited

Computes the overall convergence rate: (defect_final / defect_initial) ^ (1 / number of iterations)

Definition at line 582 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_def_cur, FEAT::Solver::IterativeSolver< Vector_ >::_def_init, FEAT::Solver::IterativeSolver< Vector_ >::_num_iter, and FEAT::Math::pow().

Referenced by FEAT::Solver::IterativeSolver< Vector_ >::get_summary().

◆ calc_defect_reduction()

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::calc_defect_reduction ( ) const
inlineinherited

Computes the overall defect reduction factor: (defect_final / defect_inital)

Definition at line 597 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_def_init, and FEAT::Math::abs().

Referenced by FEAT::Solver::IterativeSolver< Vector_ >::get_summary().

◆ correct() [1/2]

template<typename Matrix_ , typename Filter_ >
virtual Status FEAT::Solver::PSD< Matrix_, Filter_ >::correct ( VectorType &  vec_sol,
const VectorType &  vec_rhs 
)
inlineoverridevirtual

Definition at line 145 of file psd.hpp.

◆ correct() [2/2]

template<typename Vector_ >
virtual Status FEAT::Solver::IterativeSolver< Vector_ >::correct ( VectorType vec_sol,
const VectorType vec_rhs 
)
pure virtualinherited

Solver correction method.

This method applies the solver represented by this object onto a given right-hand-side vector and updates the corresponding solution vector.

In contrast to the apply() method of the SolverBase base class, this method uses the vector vec_sol as the initial solution vector for the iterative solution process instead of ignoring its contents upon entry and starting with the null vector.

Parameters
[in,out]vec_solThe vector that contains the initial solution upon entry and receives the solution of the linear system upon exit.
[in]vec_rhsThe vector that represents the right-hand-side of the linear system to be solved.
Attention
vec_sol and vec_rhs must not refer to the same vector object!
Returns
A Status code that represents the status of the solution step.

Implemented in FEAT::Solver::FixedStepLinesearch< Functional_, Filter_ >, FEAT::Solver::MQCLinesearch< Functional_, Filter_ >, FEAT::Solver::NewtonRaphsonLinesearch< Functional_, Filter_ >, FEAT::Solver::SecantLinesearch< Functional_, Filter_ >, and FEAT::Solver::QPenalty< Functional_ >.

Referenced by FEAT::Solver::solve().

◆ done()

template<typename Vector_ >
virtual void FEAT::Solver::SolverBase< Vector_ >::done ( )
inlinevirtualinherited

Finalization method.

This function performs both the symbolic and numeric finalization, i.e. it simply performs

this->done_numeric();
this->done_symbolic();

Definition at line 283 of file base.hpp.

References FEAT::Solver::SolverBase< Vector_ >::done_numeric(), and FEAT::Solver::SolverBase< Vector_ >::done_symbolic().

◆ done_numeric()

virtual void FEAT::Solver::PreconditionedIterativeSolver< Matrix_::VectorTypeR >::done_numeric ( )
inlineoverridevirtualinherited

Numeric finalization method.

This method is called to release any data allocated in the numeric initialization step.

Reimplemented from FEAT::Solver::SolverBase< Vector_ >.

Definition at line 1102 of file iterative.hpp.

◆ done_symbolic()

template<typename Matrix_ , typename Filter_ >
virtual void FEAT::Solver::PSD< Matrix_, Filter_ >::done_symbolic ( )
inlineoverridevirtual

Symbolic finalization method.

This method is called to release any data allocated in the symbolic initialization step.

Reimplemented from FEAT::Solver::PreconditionedIterativeSolver< Matrix_::VectorTypeR >.

Definition at line 119 of file psd.hpp.

References FEAT::Solver::PreconditionedIterativeSolver< Vector_ >::done_symbolic().

◆ force_defect_norm_calc()

template<typename Vector_ >
virtual void FEAT::Solver::IterativeSolver< Vector_ >::force_defect_norm_calc ( bool  force)
inlinevirtualinherited

Forces the calculation of defect norms in every iteration.

Note
Please note that allowing the skipping of defect norm calculations is merely a hint and a derived class may override this function therefore always forcing the calculation of defect norms. One possible reason is that the derived solver class may require defect norms as part of its solver algorithm and therefore skipping the computation of the defect norms may break the solver; two examples are the BiCGStab and GMRES solvers.
Parameters
[in]forceSpecifies whether defect norm computation is to be enforced in every iteration

Reimplemented in FEAT::Solver::BiCGStab< Matrix_, Filter_ >, FEAT::Solver::BiCGStabL< Matrix_, Filter_ >, FEAT::Solver::FGMRES< Matrix_, Filter_ >, FEAT::Solver::GMRES< Matrix_, Filter_ >, and FEAT::Solver::RBiCGStab< Matrix_, Filter_ >.

Definition at line 490 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_force_def_norm_calc.

◆ get_def_final()

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::get_def_final ( ) const
inlineinherited

Returns the final defect.

Definition at line 570 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_def_cur.

Referenced by FEAT::Solver::IterativeSolver< Vector_ >::get_summary().

◆ get_def_initial()

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::get_def_initial ( ) const
inlineinherited

Returns the initial defect.

Definition at line 564 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_def_init.

Referenced by FEAT::Solver::IterativeSolver< Vector_ >::get_summary().

◆ get_div_abs()

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::get_div_abs ( ) const
inlineinherited

Returns the absolute divergence.

Definition at line 419 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_div_abs.

◆ get_div_rel()

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::get_div_rel ( ) const
inlineinherited

Returns the relative divergence.

Definition at line 413 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_div_rel.

◆ get_max_iter()

template<typename Vector_ >
Index FEAT::Solver::IterativeSolver< Vector_ >::get_max_iter ( ) const
inlineinherited

Returns the maximum number of iterations.

Definition at line 474 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_max_iter.

◆ get_min_iter()

template<typename Vector_ >
Index FEAT::Solver::IterativeSolver< Vector_ >::get_min_iter ( ) const
inlineinherited

Returns the minimal number of iterations.

Definition at line 468 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_min_iter.

◆ get_min_stag_iter()

template<typename Vector_ >
Index FEAT::Solver::IterativeSolver< Vector_ >::get_min_stag_iter ( ) const
inlineinherited

Returns the minimum stagnation iteration count.

Definition at line 443 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_min_stag_iter.

◆ get_num_iter()

◆ get_plot_name()

template<typename Vector_ >
String FEAT::Solver::IterativeSolver< Vector_ >::get_plot_name ( ) const
inlineinherited

◆ get_stag_rate()

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::get_stag_rate ( ) const
inlineinherited

Returns the stagnation rate.

Definition at line 431 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_stag_rate.

◆ get_status()

template<typename Vector_ >
Status FEAT::Solver::IterativeSolver< Vector_ >::get_status ( ) const
inlineinherited

◆ get_summary()

◆ get_tol_abs()

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::get_tol_abs ( ) const
inlineinherited

Returns the absolute tolerance.

Definition at line 389 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_tol_abs.

◆ get_tol_abs_low()

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::get_tol_abs_low ( ) const
inlineinherited

Returns the lower absolute tolerance.

Definition at line 395 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_tol_abs_low.

◆ get_tol_rel()

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::get_tol_rel ( ) const
inlineinherited

Returns the relative tolerance.

Definition at line 383 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_tol_rel.

◆ init()

template<typename Vector_ >
virtual void FEAT::Solver::SolverBase< Vector_ >::init ( )
inlinevirtualinherited

Initialization method.

This function performs both the symbolic and numeric initialization, i.e. it simply performs

this->init_symbolic();
this->init_numeric();

Definition at line 268 of file base.hpp.

References FEAT::Solver::SolverBase< Vector_ >::init_numeric(), and FEAT::Solver::SolverBase< Vector_ >::init_symbolic().

◆ init_numeric()

virtual void FEAT::Solver::PreconditionedIterativeSolver< Matrix_::VectorTypeR >::init_numeric ( )
inlineoverridevirtualinherited

Numeric initialization method.

This method is called to perform numeric initialization of the solver.
Before this function can be called, the symbolic initialization must be performed.

Reimplemented from FEAT::Solver::SolverBase< Vector_ >.

Definition at line 1094 of file iterative.hpp.

◆ init_symbolic()

template<typename Matrix_ , typename Filter_ >
virtual void FEAT::Solver::PSD< Matrix_, Filter_ >::init_symbolic ( )
inlineoverridevirtual

Symbolic initialization method.

This method is called to perform symbolic initialization of the solver.

Reimplemented from FEAT::Solver::PreconditionedIterativeSolver< Matrix_::VectorTypeR >.

Definition at line 110 of file psd.hpp.

References FEAT::Solver::PSD< Matrix_, Filter_ >::_vec_r, and FEAT::Solver::PreconditionedIterativeSolver< Vector_ >::init_symbolic().

◆ is_converged() [1/2]

◆ is_converged() [2/2]

template<typename Vector_ >
bool FEAT::Solver::IterativeSolver< Vector_ >::is_converged ( const DataType  def_cur) const
inlineinherited

checks for convergence

Parameters
[in]def_curThe defect norm that is to be analyzed
Returns
true, if converged, else false

Definition at line 546 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_def_init, FEAT::Solver::IterativeSolver< Vector_ >::_tol_abs, FEAT::Solver::IterativeSolver< Vector_ >::_tol_abs_low, and FEAT::Solver::IterativeSolver< Vector_ >::_tol_rel.

◆ is_diverged() [1/2]

◆ is_diverged() [2/2]

template<typename Vector_ >
bool FEAT::Solver::IterativeSolver< Vector_ >::is_diverged ( const DataType  def_cur) const
inlineinherited

◆ name()

template<typename Matrix_ , typename Filter_ >
virtual String FEAT::Solver::PSD< Matrix_, Filter_ >::name ( ) const
inlineoverridevirtual

Returns a descriptive string.

Returns
A string describing the solver.

Implements FEAT::Solver::SolverBase< Vector_ >.

Definition at line 105 of file psd.hpp.

◆ plot_summary()

template<typename Vector_ >
virtual void FEAT::Solver::IterativeSolver< Vector_ >::plot_summary ( ) const
inlinevirtualinherited

◆ set_div_abs()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_div_abs ( DataType  div_abs)
inlineinherited

Sets the absolute divergence for the solver.

Definition at line 407 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_div_abs.

◆ set_div_rel()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_div_rel ( DataType  div_rel)
inlineinherited

Sets the relative divergence for the solver.

Definition at line 401 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_div_rel.

◆ set_max_iter()

◆ set_min_iter()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_min_iter ( Index  min_iter)
inlineinherited

Sets the minimum iteration count for the solver.

Definition at line 449 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_min_iter.

◆ set_min_stag_iter()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_min_stag_iter ( Index  min_iter)
inlineinherited

Sets the minimum stagnate iteration count for the solver.

Definition at line 437 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_min_stag_iter.

◆ set_plot_interval()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_plot_interval ( const Index  plot_interval)
inlineinherited

Sets the interval between two plot outputs, if any.

Parameters
[in]plot_intervalThe desired interval of iteration plots

Definition at line 511 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_plot_interval.

◆ set_plot_mode()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_plot_mode ( const PlotMode  plot_mode)
inlineinherited

Sets the plot mode of the solver.

Parameters
[in]plot_modeThe desired plot mode

Definition at line 501 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_plot_mode.

◆ set_plot_name()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_plot_name ( const String plot_name)
inlineinherited

◆ set_stag_rate()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_stag_rate ( DataType  rate)
inlineinherited

Sets the stagnation rate for the solver.

Definition at line 425 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_stag_rate.

◆ set_tol_abs()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_tol_abs ( DataType  tol_abs)
inlineinherited

◆ set_tol_abs_low()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_tol_abs_low ( DataType  tol_abs_low)
inlineinherited

Sets the lower absolute tolerance for the solver.

Definition at line 377 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_tol_abs_low.

◆ set_tol_rel()

template<typename Vector_ >
void FEAT::Solver::IterativeSolver< Vector_ >::set_tol_rel ( DataType  tol_rel)
inlineinherited

Sets the relative tolerance for the solver.

Definition at line 365 of file iterative.hpp.

References FEAT::Solver::IterativeSolver< Vector_ >::_tol_rel.

Member Data Documentation

◆ _comm

template<typename Vector_ >
const Dist::Comm* FEAT::Solver::IterativeSolver< Vector_ >::_comm
protectedinherited

Communicator of the solver.

Definition at line 209 of file iterative.hpp.

Referenced by FEAT::Solver::IterativeSolver< Vector_ >::_print_line().

◆ _def_cur

◆ _def_init

◆ _def_prev

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::_def_prev
protectedinherited

◆ _div_abs

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::_div_abs
protectedinherited

◆ _div_rel

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::_div_rel
protectedinherited

◆ _force_def_norm_calc

◆ _iter_digits

template<typename Vector_ >
Index FEAT::Solver::IterativeSolver< Vector_ >::_iter_digits
protectedinherited

◆ _max_iter

◆ _min_iter

◆ _min_stag_iter

◆ _num_iter

◆ _num_stag_iter

template<typename Vector_ >
Index FEAT::Solver::IterativeSolver< Vector_ >::_num_stag_iter
protectedinherited

◆ _plot_interval

template<typename Vector_ >
Index FEAT::Solver::IterativeSolver< Vector_ >::_plot_interval
protectedinherited

◆ _plot_mode

template<typename Vector_ >
PlotMode FEAT::Solver::IterativeSolver< Vector_ >::_plot_mode
protectedinherited

◆ _plot_name

◆ _precond

std::shared_ptr<PrecondType> FEAT::Solver::PreconditionedIterativeSolver< Matrix_::VectorTypeR >::_precond
protectedinherited

the pointer to the preconditioner

Definition at line 1040 of file iterative.hpp.

◆ _stag_rate

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::_stag_rate
protectedinherited

◆ _status

◆ _system_filter

template<typename Matrix_ , typename Filter_ >
const FilterType& FEAT::Solver::PSD< Matrix_, Filter_ >::_system_filter
protected

the filter for the solver

Definition at line 49 of file psd.hpp.

◆ _system_matrix

template<typename Matrix_ , typename Filter_ >
const MatrixType& FEAT::Solver::PSD< Matrix_, Filter_ >::_system_matrix
protected

the matrix for the solver

Definition at line 47 of file psd.hpp.

◆ _tol_abs

template<typename Vector_ >
DataType FEAT::Solver::IterativeSolver< Vector_ >::_tol_abs
protectedinherited

◆ _tol_abs_low

◆ _tol_rel

◆ _vec_q

template<typename Matrix_ , typename Filter_ >
VectorType FEAT::Solver::PSD< Matrix_, Filter_ >::_vec_q
protected

Definition at line 51 of file psd.hpp.

◆ _vec_r

template<typename Matrix_ , typename Filter_ >
VectorType FEAT::Solver::PSD< Matrix_, Filter_ >::_vec_r
protected

temporary vectors

Definition at line 51 of file psd.hpp.

Referenced by FEAT::Solver::PSD< Matrix_, Filter_ >::init_symbolic().

◆ _vec_z

template<typename Matrix_ , typename Filter_ >
VectorType FEAT::Solver::PSD< Matrix_, Filter_ >::_vec_z
protected

Definition at line 51 of file psd.hpp.


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