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

Linesearch base class. More...

#include <linesearch.hpp>

Inheritance diagram for FEAT::Solver::Linesearch< Functional_, Filter_ >:
FEAT::Solver::IterativeSolver< Functional_::VectorTypeR > FEAT::Solver::SolverBase< Vector_ > FEAT::Solver::FixedStepLinesearch< Functional_, Filter_ > FEAT::Solver::MQCLinesearch< Functional_, Filter_ > FEAT::Solver::NewtonRaphsonLinesearch< Functional_, Filter_ > FEAT::Solver::SecantLinesearch< Functional_, Filter_ >

Public Types

typedef IterativeSolver< typename Functional_::VectorTypeR > BaseClass
 Our base class. More...
 
typedef Functional_::DataType DataType
 Underlying floating point type. More...
 
typedef Filter_ FilterType
 Filter type to be applied to the gradient of the functional. More...
 
typedef Functional_::VectorTypeR VectorType
 Input vector type for the functional's gradient. More...
 

Public Member Functions

 Linesearch (const String &plot_name, const String &section_name, const PropertyMap *section, Functional_ &functional, Filter_ &filter)
 Constructor using a PropertyMap. More...
 
 Linesearch (const String &plot_name, Functional_ &functional, Filter_ &filter, bool keep_iterates=false)
 Standard constructor. More...
 
virtual ~Linesearch ()
 Virtual destructor. More...
 
virtual Status apply (Vector_ &vec_cor, const Vector_ &vec_def)=0
 Solver application method. More...
 
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)=0
 Solver correction method. More...
 
virtual void done ()
 Finalization method. More...
 
virtual void done_numeric ()
 Numeric finalization method. More...
 
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...
 
void get_defect_from_grad (VectorType &vec_def) const
 Sets the initial gradient from a defect vector. More...
 
DataType get_div_abs () const
 Returns the absolute divergence. More...
 
DataType get_div_rel () const
 Returns the relative divergence. More...
 
DataType get_final_fval () const
 Gets the functional value of the last iteration. More...
 
const VectorTypeget_initial_sol () const
 Gets the initial solution the linesearch started with. 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...
 
virtual DataType get_rel_update () const
 Get the relative update of the solver application. More...
 
DataType get_stag_rate () const
 Returns the stagnation rate. More...
 
Status get_status () const
 Returns the status. More...
 
virtual String get_summary () const override
 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 ()
 Numeric initialization method. More...
 
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 =0
 Returns a descriptive string. More...
 
virtual void plot_summary () const
 Plot a summary of the last solver run. More...
 
virtual void reset ()
 Resets various member variables in case the solver is reused. More...
 
void set_dir_scaling (const bool b)
 Determines if search direction scaling is to be used. 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_grad_from_defect (const VectorType &vec_def)
 Gets a defect vector from the final gradient. More...
 
void set_initial_fval (DataType f0)
 Sets the intitial functional value. 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_curvature (DataType tol_curvature)
 Sets the tolerance for the sufficient decrease in curvature. More...
 
void set_tol_decrease (DataType tol_decrease)
 Sets the tolerance for the sufficient decrease in functional value. More...
 
void set_tol_rel (DataType tol_rel)
 Sets the relative tolerance for the solver. More...
 
void set_tol_step (DataType tol_step)
 Sets the step length tolerance. More...
 
virtual void trim_func_grad (DataType &func)
 Trims the function value and gradient according to some threshold. More...
 

Public Attributes

std::deque< VectorType > * iterates
 For debugging purposes, it is possible to save all iterates to this. 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 DataType _calc_def_norm (const VectorType &vec_def, const VectorType &vec_sol)
 Computes the defect norm. More...
 
virtual Status _check_convergence (const DataType fval, const DataType df, const DataType alpha)
 Performs the line search convergence checks using the strong Wolfe conditions. 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...
 
void _set_comm_by_matrix (const Matrix_ &matrix)
 Sets the communicator for the solver from a matrix. More...
 
void _set_comm_by_vector (const Functional_::VectorTypeR &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 _startup (DataType &alpha, DataType &fval, DataType &delta, const VectorType &vec_sol, const VectorType &vec_dir)
 Performs the startup of the iteration. More...
 
virtual Status _update_defect (const DataType def_cur_norm)
 Internal function: sets the new (next) defect norm. More...
 

Protected Attributes

DataType _alpha_0
 Initial line search parameter. More...
 
DataType _alpha_min
 Line search parameter. More...
 
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 _delta_0
 Initial <vec_dir, vec_grad> More...
 
bool _dir_scaling
 
DataType _div_abs
 absolute divergence parameter More...
 
DataType _div_rel
 relative divergence parameter More...
 
Filter_ & _filter
 The filter to be applied to the functional's gradient. More...
 
bool _force_def_norm_calc
 whether skipping of defect computation is allowed or not More...
 
Functional_ & _functional
 The (nonlinear) functional. More...
 
DataType _fval_0
 Initial functional value. More...
 
DataType _fval_min
 Functional functional value. 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...
 
DataType _norm_dir
 The 2-norm of the search direction. More...
 
DataType _norm_sol
 The 2-norm of the iterate. 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...
 
DataType _stag_rate
 stagnation rate More...
 
Status _status
 current status of the solver More...
 
DataType _tol_abs
 absolute tolerance parameter More...
 
DataType _tol_abs_low
 absolute low tolerance parameter More...
 
DataType _tol_curvature
 Tolerance for sufficient decrease in the norm of the gradient (Wolfe conditions) More...
 
DataType _tol_decrease
 Tolerance for sufficient decrease in the functional value (Wolfe conditions) More...
 
DataType _tol_rel
 relative tolerance parameter More...
 
DataType _tol_step
 Tolerance for the update step. More...
 
DataType _trim_threshold
 Threshold for trimming function value and gradient. More...
 
VectorType _vec_grad
 Gradient vector. More...
 
VectorType _vec_initial_sol
 Initial solution. More...
 
VectorType _vec_pn
 descend direction vector, normalized for better numerical stability More...
 
VectorType _vec_tmp
 temporary vector More...
 

Detailed Description

template<typename Functional_, typename Filter_>
class FEAT::Solver::Linesearch< Functional_, Filter_ >

Linesearch base class.

Template Parameters
Functional_The (nonlinear) functional to be evaluated
Filter_The filter to be applied to the functional's gradient

This class implements a linesearch which approximately finds

\[ \alpha^* = \mathrm{argmin} \left< \nabla f(x + \alpha d), d \right> \]

for a given search direction \( d \).

Definition at line 33 of file linesearch.hpp.

Member Typedef Documentation

◆ BaseClass

template<typename Functional_ , typename Filter_ >
typedef IterativeSolver<typename Functional_::VectorTypeR> FEAT::Solver::Linesearch< Functional_, Filter_ >::BaseClass

Our base class.

Definition at line 43 of file linesearch.hpp.

◆ DataType

template<typename Functional_ , typename Filter_ >
typedef Functional_::DataType FEAT::Solver::Linesearch< Functional_, Filter_ >::DataType

Underlying floating point type.

Definition at line 41 of file linesearch.hpp.

◆ FilterType

template<typename Functional_ , typename Filter_ >
typedef Filter_ FEAT::Solver::Linesearch< Functional_, Filter_ >::FilterType

Filter type to be applied to the gradient of the functional.

Definition at line 37 of file linesearch.hpp.

◆ VectorType

template<typename Functional_ , typename Filter_ >
typedef Functional_::VectorTypeR FEAT::Solver::Linesearch< Functional_, Filter_ >::VectorType

Input vector type for the functional's gradient.

Definition at line 39 of file linesearch.hpp.

Constructor & Destructor Documentation

◆ Linesearch() [1/2]

template<typename Functional_ , typename Filter_ >
FEAT::Solver::Linesearch< Functional_, Filter_ >::Linesearch ( const String plot_name,
Functional_ &  functional,
Filter_ &  filter,
bool  keep_iterates = false 
)
inlineexplicit

Standard constructor.

Parameters
[in]plot_nameString to use in solver plots to console
[in,out]functionalThe (nonlinear) functional. Cannot be const because it saves its own state
[in]filterFilter to apply to the functional's gradient
[in]keep_iteratesKeep all iterates in a std::deque. Defaults to false.

Definition at line 110 of file linesearch.hpp.

References FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_set_comm_by_matrix(), and FEAT::Solver::Linesearch< Functional_, Filter_ >::iterates.

◆ Linesearch() [2/2]

template<typename Functional_ , typename Filter_ >
FEAT::Solver::Linesearch< Functional_, Filter_ >::Linesearch ( const String plot_name,
const String section_name,
const PropertyMap section,
Functional_ &  functional,
Filter_ &  filter 
)
inlineexplicit

Constructor using a PropertyMap.

Parameters
[in]plot_nameString to use in solver plots to console
[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,out]functionalThe (nonlinear) functional. Cannot be const because it saves its own state
[in]filterFilter to apply to the functional's gradient

Definition at line 157 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::iterates, FEAT::PropertyMap::query(), FEAT::Solver::Linesearch< Functional_, Filter_ >::set_tol_curvature(), FEAT::Solver::Linesearch< Functional_, Filter_ >::set_tol_decrease(), and FEAT::Solver::Linesearch< Functional_, Filter_ >::set_tol_step().

◆ ~Linesearch()

template<typename Functional_ , typename Filter_ >
virtual FEAT::Solver::Linesearch< Functional_, Filter_ >::~Linesearch ( )
inlinevirtual

Virtual destructor.

Definition at line 205 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::iterates.

Member Function Documentation

◆ _analyze_defect()

virtual Status FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_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.

◆ _calc_def_norm()

virtual DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_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.

◆ _check_convergence()

template<typename Functional_ , typename Filter_ >
virtual Status FEAT::Solver::Linesearch< Functional_, Filter_ >::_check_convergence ( const DataType  fval,
const DataType  df,
const DataType  alpha 
)
inlineprotectedvirtual

Performs the line search convergence checks using the strong Wolfe conditions.

Parameters
[in]fvalThe current functional value
[in]dfThe current directional derivative value: \( df = \left< \nabla f(x_0), d \right>\).
[in]alphaThe step size of the last update.

Also sets the current defect. The strong Wolfe conditions are

\[ f(x) < f(x_0) + \alpha c_1 \left< \nabla f(x_0), d \right> \wedge |\left< \nabla f(x), d \right>| < - c_2 \left< \nabla f(x_0), d \right>, \]

where \(c_1\) is known as tol_decrease and \( c_2 \) is known as tol_curvature.

Returns
Status::success if the strong Wolfe conditions hold.

Definition at line 543 of file linesearch.hpp.

References FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_def_cur, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_def_init, FEAT::Solver::Linesearch< Functional_, Filter_ >::_delta_0, FEAT::Solver::Linesearch< Functional_, Filter_ >::_fval_0, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_iter_digits, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_max_iter, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_num_iter, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_plot_iter(), FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_plot_name, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_print_line(), FEAT::Solver::Linesearch< Functional_, Filter_ >::_tol_curvature, FEAT::Solver::Linesearch< Functional_, Filter_ >::_tol_decrease, FEAT::Solver::aborted, FEAT::Math::abs(), FEAT::Solver::diverged, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_num_iter(), FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::is_diverged(), FEAT::Math::isfinite(), FEAT::Solver::max_iter, FEAT::Solver::SolverBase< Vector_ >::name(), FEAT::String::pad_front(), FEAT::Solver::progress, FEAT::stringify(), FEAT::stringify_fp_sci(), and FEAT::Solver::success.

Referenced by FEAT::Solver::MQCLinesearch< Functional_, Filter_ >::_apply_intern(), FEAT::Solver::NewtonRaphsonLinesearch< Functional_, Filter_ >::_apply_intern(), and FEAT::Solver::SecantLinesearch< Functional_, Filter_ >::_apply_intern().

◆ _plot_iter()

bool FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_plot_iter ( Status  st = Status::progress) const
inlineprotectedinherited

Plot the current iteration?

Parameters
[in]stThe status of the current iteration.
Returns
true if the plot mode is set to iter or all and the plot interval matches or the solver does not continue to the next iteration

Definition at line 720 of file iterative.hpp.

◆ _plot_iter_line()

virtual void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_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.

◆ _plot_summary()

bool FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_plot_summary ( ) const
inlineprotectedinherited

Plot summary?

Returns
true if the plot mode is set to summary or all.

Definition at line 731 of file iterative.hpp.

◆ _print_line()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_print_line ( const String line) const
inlineprotectedinherited

Prints a line.

Parameters
[in]lineThe line to be printed.

Definition at line 752 of file iterative.hpp.

◆ _progress()

bool FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_progress ( ) const
inlineprotectedinherited

Progress iteration?

Returns
true if the solver should process, otherwise false.

Definition at line 741 of file iterative.hpp.

◆ _set_comm()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_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()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_set_comm_by_matrix ( const Matrix_ &  matrix)
inlineprotectedinherited

Sets the communicator for the solver from a matrix.

Parameters
[in]matrixA reference to a matrix. If 'Matrix_' is a 'Global::Matrix', then the communicator of the matrix gate is taken.

Definition at line 680 of file iterative.hpp.

◆ _set_comm_by_vector()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_set_comm_by_vector ( const Functional_::VectorTypeR &  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()

virtual Status FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_set_initial_defect ( const VectorType vec_def,
const VectorType vec_sol 
)
inlineprotectedvirtualinherited

Internal function: sets the initial defect vector.

Parameters
[in]vec_defThe initial defect vector.
[in]vec_solThe current solution vector approximation.
Returns
The updated Status code.

Reimplemented in FEAT::Solver::QPenalty< Functional_ >.

Definition at line 802 of file iterative.hpp.

◆ _set_new_defect()

virtual Status FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_set_new_defect ( const VectorType vec_def,
const VectorType vec_sol 
)
inlineprotectedvirtualinherited

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

This function computes the defect vector's norm, increments the iteration count, plots an output line to std::cout and checks whether any of the stopping criterions is fulfilled.

Parameters
[in]vec_defThe new defect vector.
[in]vec_solThe current solution vector approximation.
Returns
The updated Status code.

Definition at line 924 of file iterative.hpp.

◆ _startup()

template<typename Functional_ , typename Filter_ >
virtual Status FEAT::Solver::Linesearch< Functional_, Filter_ >::_startup ( DataType alpha,
DataType fval,
DataType delta,
const VectorType vec_sol,
const VectorType vec_dir 
)
inlineprotectedvirtual

Performs the startup of the iteration.

Parameters
[out]alphaThe initial step size value.
[out]fvalThe initial functional value.
[out]deltaThe initial direction derivative value: \( \delta = \left< dir, grad \right>\).
[in]vec_solThe initial guess.
[in]vec_dirThe search direction.

The routine sets the initial data from "iteration 0" (needed for checking the strong Wolfe conditions later) and does some error checking.

Returns
Status::progress if no error occurred.

Definition at line 464 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::_alpha_0, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_def_init, FEAT::Solver::Linesearch< Functional_, Filter_ >::_delta_0, FEAT::Solver::Linesearch< Functional_, Filter_ >::_fval_0, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_iter_digits, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_num_iter, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_plot_iter(), FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_plot_name, FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_print_line(), FEAT::Solver::aborted, FEAT::Math::abs(), FEAT::Math::isfinite(), FEAT::String::pad_front(), FEAT::Solver::progress, FEAT::stringify(), FEAT::stringify_fp_sci(), and XABORTM.

Referenced by FEAT::Solver::MQCLinesearch< Functional_, Filter_ >::_apply_intern(), FEAT::Solver::NewtonRaphsonLinesearch< Functional_, Filter_ >::_apply_intern(), and FEAT::Solver::SecantLinesearch< Functional_, Filter_ >::_apply_intern().

◆ _update_defect()

virtual Status FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_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.

◆ apply()

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().

◆ calc_convergence_rate()

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::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.

◆ calc_defect_reduction()

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::calc_defect_reduction ( ) const
inlineinherited

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

Definition at line 597 of file iterative.hpp.

◆ correct()

virtual Status FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::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_ >.

◆ 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()

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

Numeric finalization method.

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

Reimplemented in FEAT::Solver::BFBT< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >, FEAT::Solver::BFBT< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >, FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >, FEAT::Solver::ConvertPrecond< Global::Vector< LocalVectorOuter_, MirrorOuter_ >, Global::Vector< LocalVectorInner_, MirrorInner_ > >, FEAT::Solver::CUDSS, FEAT::Solver::DirectStokesSolver< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, LAFEM::TupleFilter< FilterV_, FilterP_ > >, FEAT::Solver::DirectStokesSolver< Global::Matrix< LocalMatrix_, Mirror_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >, FEAT::Solver::ParaSailsPrecond< Matrix_, Filter_ >, FEAT::Solver::EuclidPrecond< Matrix_, Filter_ >, FEAT::Solver::BoomerAMG< Matrix_, Filter_ >, FEAT::Solver::PreconditionedIterativeSolver< Vector_ >, FEAT::Solver::PreconditionedIterativeSolver< Matrix_::VectorTypeR >, FEAT::Solver::PreconditionedIterativeSolver< Functional_::VectorTypeR >, FEAT::Solver::MKLDSS, FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >, FEAT::Solver::PCGNR< Matrix_, Filter_ >, FEAT::Solver::SchwarzPrecond< Global::Vector< LocalVector_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >, FEAT::Solver::Umfpack, FEAT::Solver::UmfpackMean, FEAT::Solver::SaddleUmfpackMean< DT_, IT_, dim_ >, FEAT::Solver::GenericUmfpack< Matrix_ >, FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >, and FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >.

Definition at line 246 of file base.hpp.

Referenced by FEAT::Solver::SolverBase< Vector_ >::done(), FEAT::Solver::BFBT< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::done_numeric(), FEAT::Solver::BFBT< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::done_numeric(), FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::done_numeric(), FEAT::Solver::ConvertPrecond< Global::Vector< LocalVectorOuter_, MirrorOuter_ >, Global::Vector< LocalVectorInner_, MirrorInner_ > >::done_numeric(), FEAT::Solver::ParaSailsPrecond< Matrix_, Filter_ >::done_numeric(), FEAT::Solver::PreconditionedIterativeSolver< Vector_ >::done_numeric(), FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >::done_numeric(), FEAT::Solver::PCGNR< Matrix_, Filter_ >::done_numeric(), FEAT::Solver::SaddleUmfpackMean< DT_, IT_, dim_ >::done_numeric(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::done_numeric(), and FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::done_numeric().

◆ done_symbolic()

template<typename Functional_ , typename Filter_ >
virtual void FEAT::Solver::Linesearch< Functional_, Filter_ >::done_symbolic ( )
inlineoverridevirtual

◆ force_defect_norm_calc()

virtual void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::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

Definition at line 490 of file iterative.hpp.

◆ get_def_final()

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_def_final ( ) const
inlineinherited

Returns the final defect.

Definition at line 570 of file iterative.hpp.

◆ get_def_initial()

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_def_initial ( ) const
inlineinherited

Returns the initial defect.

Definition at line 564 of file iterative.hpp.

◆ get_defect_from_grad()

template<typename Functional_ , typename Filter_ >
void FEAT::Solver::Linesearch< Functional_, Filter_ >::get_defect_from_grad ( VectorType vec_def) const
inline

Sets the initial gradient from a defect vector.

Parameters
[in]vec_defThe initial defect vector.

This is handy because the linesearch gets called from another solver that in general already evaluated the functional gradient.

Definition at line 378 of file linesearch.hpp.

◆ get_div_abs()

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_div_abs ( ) const
inlineinherited

Returns the absolute divergence.

Definition at line 419 of file iterative.hpp.

◆ get_div_rel()

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_div_rel ( ) const
inlineinherited

Returns the relative divergence.

Definition at line 413 of file iterative.hpp.

◆ get_final_fval()

template<typename Functional_ , typename Filter_ >
DataType FEAT::Solver::Linesearch< Functional_, Filter_ >::get_final_fval ( ) const
inline

Gets the functional value of the last iteration.

Returns
The functional value of the last iteration

Definition at line 344 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::_fval_min.

◆ get_initial_sol()

template<typename Functional_ , typename Filter_ >
const VectorType & FEAT::Solver::Linesearch< Functional_, Filter_ >::get_initial_sol ( ) const
inline

Gets the initial solution the linesearch started with.

Returns
A const reference to the initial solution vector.

This is useful for rejecting steps that are too small in the calling solver, like NLCG or NLSD.

Definition at line 404 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::_vec_initial_sol.

◆ get_max_iter()

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_max_iter ( ) const
inlineinherited

Returns the maximum number of iterations.

Definition at line 474 of file iterative.hpp.

◆ get_min_iter()

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_min_iter ( ) const
inlineinherited

Returns the minimal number of iterations.

Definition at line 468 of file iterative.hpp.

◆ get_min_stag_iter()

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_min_stag_iter ( ) const
inlineinherited

Returns the minimum stagnation iteration count.

Definition at line 443 of file iterative.hpp.

◆ get_num_iter()

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_num_iter ( ) const
inlineinherited

Returns number of performed iterations.

Definition at line 462 of file iterative.hpp.

◆ get_plot_name()

String FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_plot_name ( ) const
inlineinherited

Returns the plot name of the solver.

Definition at line 523 of file iterative.hpp.

◆ get_rel_update()

template<typename Functional_ , typename Filter_ >
virtual DataType FEAT::Solver::Linesearch< Functional_, Filter_ >::get_rel_update ( ) const
inlinevirtual

Get the relative update of the solver application.

The linesearch updates the solution according to

\[ x \mapsto x + \alpha d, \]

so the relative update is

\[ \hat{\alpha} = | \alpha | \frac{\| d \|_2}{ \| x \|_2}. \]

Used for determining if the linesearch stagnated without updating the solution in a significant way. As this base class normalizes \( d \) in _startup(), it just return \( \alpha \). Derived classes NOT performing this normalization must overwrite this.

Returns
The relative update.

Reimplemented in FEAT::Solver::FixedStepLinesearch< Functional_, Filter_ >.

Definition at line 334 of file linesearch.hpp.

References FEAT::Math::abs().

◆ get_stag_rate()

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_stag_rate ( ) const
inlineinherited

Returns the stagnation rate.

Definition at line 431 of file iterative.hpp.

◆ get_status()

Status FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_status ( ) const
inlineinherited

Returns the status.

Definition at line 576 of file iterative.hpp.

◆ get_summary()

◆ get_tol_abs()

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_tol_abs ( ) const
inlineinherited

Returns the absolute tolerance.

Definition at line 389 of file iterative.hpp.

◆ get_tol_abs_low()

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_tol_abs_low ( ) const
inlineinherited

Returns the lower absolute tolerance.

Definition at line 395 of file iterative.hpp.

◆ get_tol_rel()

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::get_tol_rel ( ) const
inlineinherited

Returns the relative tolerance.

Definition at line 383 of file iterative.hpp.

◆ 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()

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

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 in FEAT::Solver::AmaVanka< Matrix_, Filter_ >, FEAT::Solver::BFBT< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >, FEAT::Solver::BFBT< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >, FEAT::Solver::Chebyshev< Matrix_, Filter_ >, FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >, FEAT::Solver::ConvertPrecond< Global::Vector< LocalVectorOuter_, MirrorOuter_ >, Global::Vector< LocalVectorInner_, MirrorInner_ > >, FEAT::Solver::CUDSS, FEAT::Solver::DirectStokesSolver< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, LAFEM::TupleFilter< FilterV_, FilterP_ > >, FEAT::Solver::DirectStokesSolver< Global::Matrix< LocalMatrix_, Mirror_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >, FEAT::Solver::HypreSolverBase< Matrix_, Filter_, SolverBase_ >, FEAT::Solver::ParaSailsPrecond< Matrix_, Filter_ >, FEAT::Solver::EuclidPrecond< Matrix_, Filter_ >, FEAT::Solver::BoomerAMG< Matrix_, Filter_ >, FEAT::Solver::ILUPrecond< Matrix_, Filter_ >, FEAT::Solver::PreconditionedIterativeSolver< Vector_ >, FEAT::Solver::PreconditionedIterativeSolver< Matrix_::VectorTypeR >, FEAT::Solver::PreconditionedIterativeSolver< Functional_::VectorTypeR >, FEAT::Solver::JacobiPrecond< Matrix_, Filter_ >, FEAT::Solver::MatrixPrecond< Matrix_, Filter_ >, FEAT::Solver::MKLDSS, FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >, FEAT::Solver::NonlinearOperatorPrecondWrapper< NonlinearOperator_ >, FEAT::Solver::PCGNR< Matrix_, Filter_ >, FEAT::Solver::PCGNRILU< Matrix_, Filter_ >, FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >, FEAT::Solver::SchwarzPrecond< Global::Vector< LocalVector_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >, FEAT::Solver::SuperLU< Matrix_, Filter_ >, FEAT::Solver::Umfpack, FEAT::Solver::UmfpackMean, FEAT::Solver::SaddleUmfpackMean< DT_, IT_, dim_ >, FEAT::Solver::GenericUmfpack< Matrix_ >, FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >, FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >, FEAT::Solver::Vanka< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, Filter_ >, and FEAT::Solver::VoxelAmaVanka< Matrix_, Filter_, pol_threading_, macro_type_ >.

Definition at line 237 of file base.hpp.

Referenced by FEAT::Solver::SolverBase< Vector_ >::init(), FEAT::Solver::BFBT< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::init_numeric(), FEAT::Solver::BFBT< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::init_numeric(), FEAT::Solver::Chebyshev< Matrix_, Filter_ >::init_numeric(), FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::init_numeric(), FEAT::Solver::ConvertPrecond< Global::Vector< LocalVectorOuter_, MirrorOuter_ >, Global::Vector< LocalVectorInner_, MirrorInner_ > >::init_numeric(), FEAT::Solver::HypreSolverBase< Matrix_, Filter_, SolverBase_ >::init_numeric(), FEAT::Solver::PreconditionedIterativeSolver< Vector_ >::init_numeric(), FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >::init_numeric(), FEAT::Solver::PCGNR< Matrix_, Filter_ >::init_numeric(), FEAT::Solver::PCGNRILU< Matrix_, Filter_ >::init_numeric(), FEAT::Solver::SuperLU< Matrix_, Filter_ >::init_numeric(), FEAT::Solver::SaddleUmfpackMean< DT_, IT_, dim_ >::init_numeric(), FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >::init_numeric(), FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >::init_numeric(), and FEAT::Solver::VoxelAmaVanka< Matrix_, Filter_, pol_threading_, macro_type_ >::init_numeric().

◆ init_symbolic()

template<typename Functional_ , typename Filter_ >
virtual void FEAT::Solver::Linesearch< Functional_, Filter_ >::init_symbolic ( )
inlineoverridevirtual

◆ is_converged() [1/2]

bool FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::is_converged ( ) const
inlineinherited

checks for convergence

Returns
true, if converged, else false

Definition at line 533 of file iterative.hpp.

◆ is_converged() [2/2]

bool FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::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.

◆ is_diverged() [1/2]

bool FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::is_diverged ( ) const
inlineinherited

checks for divergence

Definition at line 552 of file iterative.hpp.

◆ is_diverged() [2/2]

bool FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::is_diverged ( const DataType  def_cur) const
inlineinherited

checks for divergence

Definition at line 558 of file iterative.hpp.

◆ name()

template<typename Vector_ >
virtual String FEAT::Solver::SolverBase< Vector_ >::name ( ) const
pure virtualinherited

Returns a descriptive string.

Returns
A string describing the solver.

Implemented in FEAT::Solver::ALGLIBMinLBFGS< Functional_, Filter_ >, FEAT::Solver::ALGLIBMinCG< Functional_, Filter_ >, FEAT::Solver::AmaVanka< Matrix_, Filter_ >, FEAT::Solver::BFBT< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >, FEAT::Solver::BFBT< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >, FEAT::Solver::BiCGStab< Matrix_, Filter_ >, FEAT::Solver::BiCGStabL< Matrix_, Filter_ >, FEAT::Solver::Chebyshev< Matrix_, Filter_ >, FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >, FEAT::Solver::ConvertPrecond< Global::Vector< LocalVectorOuter_, MirrorOuter_ >, Global::Vector< LocalVectorInner_, MirrorInner_ > >, FEAT::Solver::CUDSS, FEAT::Solver::CuSolverLU, FEAT::Solver::CuSolverQR, FEAT::Solver::Descent< Matrix_, Filter_ >, FEAT::Solver::DiagonalPrecond< Vector_, Filter_ >, FEAT::Solver::DirectStokesSolver< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, LAFEM::TupleFilter< FilterV_, FilterP_ > >, FEAT::Solver::DirectStokesSolver< Global::Matrix< LocalMatrix_, Mirror_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >, FEAT::Solver::FGMRES< Matrix_, Filter_ >, FEAT::Solver::FixedStepLinesearch< Functional_, Filter_ >, FEAT::Solver::GMRES< Matrix_, Filter_ >, FEAT::Solver::GroppPCG< Matrix_, Filter_ >, FEAT::Solver::ParaSailsPrecond< Matrix_, Filter_ >, FEAT::Solver::EuclidPrecond< Matrix_, Filter_ >, FEAT::Solver::BoomerAMG< Matrix_, Filter_ >, FEAT::Solver::IDRS< Matrix_, Filter_ >, FEAT::Solver::ILUPrecond< Matrix_, Filter_ >, FEAT::Solver::JacobiPrecond< Matrix_, Filter_ >, FEAT::Solver::MatrixPrecond< Matrix_, Filter_ >, FEAT::Solver::MKLDSS, FEAT::Solver::MQCLinesearch< Functional_, Filter_ >, FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >, FEAT::Solver::NewtonRaphsonLinesearch< Functional_, Filter_ >, FEAT::Solver::NLCG< Functional_, Filter_ >, FEAT::Solver::NonlinearOperatorPrecondWrapper< NonlinearOperator_ >, FEAT::Solver::NLSD< Functional_, Filter_ >, FEAT::Solver::PCG< Matrix_, Filter_ >, FEAT::Solver::PCGNR< Matrix_, Filter_ >, FEAT::Solver::PCGNRILU< Matrix_, Filter_ >, FEAT::Solver::PCR< Matrix_, Filter_ >, FEAT::Solver::PipePCG< Matrix_, Filter_ >, FEAT::Solver::PMR< Matrix_, Filter_ >, FEAT::Solver::PolynomialPrecond< Matrix_, Filter_ >, FEAT::Solver::PreconWrapper< Matrix_, Filter_, Precon_ >, FEAT::Solver::PSD< Matrix_, Filter_ >, FEAT::Solver::QPenalty< Functional_ >, FEAT::Solver::RBiCGStab< Matrix_, Filter_ >, FEAT::Solver::RGCR< Matrix_, Filter_ >, FEAT::Solver::Richardson< Matrix_, Filter_ >, FEAT::Solver::ScalePrecond< Vector_, Filter_ >, FEAT::Solver::SchwarzPrecond< Global::Vector< LocalVector_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >, FEAT::Solver::SecantLinesearch< Functional_, Filter_ >, FEAT::Solver::SORPrecond< Matrix_, Filter_ >, FEAT::Solver::SSORPrecond< Matrix_, Filter_ >, FEAT::Solver::SuperLU< Matrix_, Filter_ >, FEAT::Solver::Umfpack, FEAT::Solver::UmfpackMean, FEAT::Solver::SaddleUmfpackMean< DT_, IT_, dim_ >, FEAT::Solver::GenericUmfpack< Matrix_ >, FEAT::Solver::UzawaPrecond< MatrixA_, MatrixB_, MatrixD_, FilterV_, FilterP_ >, FEAT::Solver::UzawaPrecond< Global::Matrix< MatrixA_, MirrorV_, MirrorV_ >, Global::Matrix< MatrixB_, MirrorV_, MirrorP_ >, Global::Matrix< MatrixD_, MirrorP_, MirrorV_ >, Global::Filter< FilterV_, MirrorV_ >, Global::Filter< FilterP_, MirrorP_ > >, FEAT::Solver::Vanka< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, Filter_ >, FEAT::Solver::VoxelAmaVanka< Matrix_, Filter_, pol_threading_, macro_type_ >, FEAT::Solver::NLOptPrecond< VectorType_, FilterType_ >, FEAT::Solver::NLOptPrecond< OperatorType_::VectorType, Filter >, FEAT::Solver::NLOptPrecond< Operator_::VectorType, Filter_ >, and FEAT::Solver::NLOptPrecond< NonlinearOperator_::SystemLevelType::GlobalSystemVectorR, NonlinearOperator_::SystemLevelType::GlobalSystemFilter >.

Referenced by FEAT::Solver::PreconditionedIterativeSolver< Vector_ >::_apply_precond(), FEAT::Solver::Linesearch< Functional_, Filter_ >::_check_convergence(), FEAT::Solver::IterativeSolver< Vector_ >::_set_initial_defect(), FEAT::Solver::NLOptLS< Functional_, Filter_ >::_set_initial_defect(), FEAT::Solver::IterativeSolver< Vector_ >::_set_new_defect(), FEAT::Solver::NLOptLS< Functional_, Filter_ >::_set_new_defect(), and FEAT::Solver::IterativeSolver< Vector_ >::_update_defect().

◆ plot_summary()

virtual void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::plot_summary ( ) const
inlinevirtualinherited

Plot a summary of the last solver run.

Definition at line 627 of file iterative.hpp.

◆ reset()

◆ set_dir_scaling()

template<typename Functional_ , typename Filter_ >
void FEAT::Solver::Linesearch< Functional_, Filter_ >::set_dir_scaling ( const bool  b)
inline

Determines if search direction scaling is to be used.

Internally, the search direction vector gets normalized ( \( \| p \|_2 = 1 \)) for numerical stablility. Some line searches have a heuristic for choosing the initial step length \( \alpha_0 \), which can use \( \| p \|_2 \) if _dir_scaling is set to true. This is useful when using a preconditioner (e.g. Newton).

Definition at line 269 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::_dir_scaling.

◆ set_div_abs()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::set_div_abs ( DataType  div_abs)
inlineinherited

Sets the absolute divergence for the solver.

Definition at line 407 of file iterative.hpp.

◆ set_div_rel()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::set_div_rel ( DataType  div_rel)
inlineinherited

Sets the relative divergence for the solver.

Definition at line 401 of file iterative.hpp.

◆ set_grad_from_defect()

template<typename Functional_ , typename Filter_ >
void FEAT::Solver::Linesearch< Functional_, Filter_ >::set_grad_from_defect ( const VectorType vec_def)
inline

Gets a defect vector from the final gradient.

Parameters
[out]vec_defThe final defect vector.

This is handy because the other solver can use the gradient of the new solution without re-calculating it.

Definition at line 392 of file linesearch.hpp.

◆ set_initial_fval()

template<typename Functional_ , typename Filter_ >
void FEAT::Solver::Linesearch< Functional_, Filter_ >::set_initial_fval ( DataType  f0)
inline

Sets the intitial functional value.

Parameters
[in]f0The initial functional value.

This is handy because the linesearch gets called from another solver that in general already evaluated the functional.

Definition at line 359 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::_fval_0, FEAT::Solver::Linesearch< Functional_, Filter_ >::_trim_threshold, and FEAT::Math::abs().

◆ set_max_iter()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::set_max_iter ( Index  max_iter)
inlineinherited

Sets the maximum iteration count for the solver.

Definition at line 455 of file iterative.hpp.

◆ set_min_iter()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::set_min_iter ( Index  min_iter)
inlineinherited

Sets the minimum iteration count for the solver.

Definition at line 449 of file iterative.hpp.

◆ set_min_stag_iter()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::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.

◆ set_plot_interval()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::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.

◆ set_plot_mode()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::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.

◆ set_plot_name()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::set_plot_name ( const String plot_name)
inlineinherited

Sets the plot name of the solver.

Definition at line 517 of file iterative.hpp.

◆ set_stag_rate()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::set_stag_rate ( DataType  rate)
inlineinherited

Sets the stagnation rate for the solver.

Definition at line 425 of file iterative.hpp.

◆ set_tol_abs()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::set_tol_abs ( DataType  tol_abs)
inlineinherited

Sets the absolute tolerance for the solver.

Definition at line 371 of file iterative.hpp.

◆ set_tol_abs_low()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::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.

◆ set_tol_curvature()

template<typename Functional_ , typename Filter_ >
void FEAT::Solver::Linesearch< Functional_, Filter_ >::set_tol_curvature ( DataType  tol_curvature)
inline

Sets the tolerance for the sufficient decrease in curvature.

Definition at line 233 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::_tol_curvature, and XASSERT.

Referenced by FEAT::Solver::Linesearch< Functional_, Filter_ >::Linesearch().

◆ set_tol_decrease()

template<typename Functional_ , typename Filter_ >
void FEAT::Solver::Linesearch< Functional_, Filter_ >::set_tol_decrease ( DataType  tol_decrease)
inline

Sets the tolerance for the sufficient decrease in functional value.

Definition at line 243 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::_tol_decrease, and XASSERT.

Referenced by FEAT::Solver::Linesearch< Functional_, Filter_ >::Linesearch().

◆ set_tol_rel()

void FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::set_tol_rel ( DataType  tol_rel)
inlineinherited

Sets the relative tolerance for the solver.

Definition at line 365 of file iterative.hpp.

◆ set_tol_step()

template<typename Functional_ , typename Filter_ >
void FEAT::Solver::Linesearch< Functional_, Filter_ >::set_tol_step ( DataType  tol_step)
inline

Sets the step length tolerance.

Definition at line 254 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::_tol_step, and XASSERT.

Referenced by FEAT::Solver::Linesearch< Functional_, Filter_ >::Linesearch().

◆ trim_func_grad()

template<typename Functional_ , typename Filter_ >
virtual void FEAT::Solver::Linesearch< Functional_, Filter_ >::trim_func_grad ( DataType func)
inlinevirtual

Trims the function value and gradient according to some threshold.

Parameters
[in,out]funcFunction value.

This sets

\[ trim(f, \nabla f) = \begin{cases} (f, \nabla f), & f \leq f_t \\ (f_t, 0 ), & f > f_t \end{cases}, \]

where \( f_t : = 10*(|f_0|+1) \).

This is useful and even mandatory when \( f \) has singularities, so that if the linesearch steps into a singularity the very high function and gradient values do not pollute the solution process, since they get rejected by the linesearch anyway but might be used in computations.

Definition at line 430 of file linesearch.hpp.

References FEAT::Solver::Linesearch< Functional_, Filter_ >::_trim_threshold.

Referenced by FEAT::Solver::MQCLinesearch< Functional_, Filter_ >::_apply_intern(), and FEAT::Solver::NewtonRaphsonLinesearch< Functional_, Filter_ >::_apply_intern().

Member Data Documentation

◆ _alpha_0

◆ _alpha_min

◆ _comm

const Dist::Comm* FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_comm
protectedinherited

Communicator of the solver.

Definition at line 209 of file iterative.hpp.

◆ _def_cur

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_def_cur
protectedinherited

current defect

Definition at line 239 of file iterative.hpp.

◆ _def_init

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_def_init
protectedinherited

initial defect

Definition at line 237 of file iterative.hpp.

◆ _def_prev

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_def_prev
protectedinherited

previous iteration defect

Definition at line 241 of file iterative.hpp.

◆ _delta_0

◆ _dir_scaling

template<typename Functional_ , typename Filter_ >
bool FEAT::Solver::Linesearch< Functional_, Filter_ >::_dir_scaling
protected

Use the search direction norm for step scaling? This can be important if the search direction was preconditioned (e.g. the Newton direction)

Definition at line 87 of file linesearch.hpp.

Referenced by FEAT::Solver::SecantLinesearch< Functional_, Filter_ >::_apply_intern(), and FEAT::Solver::Linesearch< Functional_, Filter_ >::set_dir_scaling().

◆ _div_abs

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_div_abs
protectedinherited

absolute divergence parameter

Definition at line 223 of file iterative.hpp.

◆ _div_rel

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_div_rel
protectedinherited

relative divergence parameter

Definition at line 221 of file iterative.hpp.

◆ _filter

◆ _force_def_norm_calc

bool FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_force_def_norm_calc
protectedinherited

whether skipping of defect computation is allowed or not

Definition at line 249 of file iterative.hpp.

◆ _functional

◆ _fval_0

◆ _fval_min

◆ _iter_digits

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_iter_digits
protectedinherited

iteration count digits for plotting

Definition at line 243 of file iterative.hpp.

◆ _max_iter

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_max_iter
protectedinherited

maximum number of iterations

Definition at line 229 of file iterative.hpp.

◆ _min_iter

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_min_iter
protectedinherited

minimum number of iterations

Definition at line 227 of file iterative.hpp.

◆ _min_stag_iter

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_min_stag_iter
protectedinherited

minimum number of stagnation iterations

Definition at line 233 of file iterative.hpp.

◆ _norm_dir

◆ _norm_sol

template<typename Functional_ , typename Filter_ >
DataType FEAT::Solver::Linesearch< Functional_, Filter_ >::_norm_sol
protected

The 2-norm of the iterate.

Definition at line 77 of file linesearch.hpp.

Referenced by FEAT::Solver::Linesearch< Functional_, Filter_ >::reset().

◆ _num_iter

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_num_iter
protectedinherited

number of performed iterations

Definition at line 231 of file iterative.hpp.

◆ _num_stag_iter

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_num_stag_iter
protectedinherited

number of consecutive stagnated iterations

Definition at line 235 of file iterative.hpp.

◆ _plot_interval

Index FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_plot_interval
protectedinherited

plot output interval

Definition at line 247 of file iterative.hpp.

◆ _plot_mode

PlotMode FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_plot_mode
protectedinherited

whether to plot something

Definition at line 245 of file iterative.hpp.

◆ _plot_name

String FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_plot_name
protectedinherited

name of the solver in plots

Definition at line 211 of file iterative.hpp.

◆ _stag_rate

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_stag_rate
protectedinherited

stagnation rate

Definition at line 225 of file iterative.hpp.

◆ _status

Status FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_status
protectedinherited

current status of the solver

Definition at line 213 of file iterative.hpp.

◆ _tol_abs

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_tol_abs
protectedinherited

absolute tolerance parameter

Definition at line 217 of file iterative.hpp.

◆ _tol_abs_low

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_tol_abs_low
protectedinherited

absolute low tolerance parameter

Definition at line 219 of file iterative.hpp.

◆ _tol_curvature

template<typename Functional_ , typename Filter_ >
DataType FEAT::Solver::Linesearch< Functional_, Filter_ >::_tol_curvature
protected

◆ _tol_decrease

template<typename Functional_ , typename Filter_ >
DataType FEAT::Solver::Linesearch< Functional_, Filter_ >::_tol_decrease
protected

◆ _tol_rel

DataType FEAT::Solver::IterativeSolver< Functional_::VectorTypeR >::_tol_rel
protectedinherited

relative tolerance parameter

Definition at line 215 of file iterative.hpp.

◆ _tol_step

template<typename Functional_ , typename Filter_ >
DataType FEAT::Solver::Linesearch< Functional_, Filter_ >::_tol_step
protected

◆ _trim_threshold

template<typename Functional_ , typename Filter_ >
DataType FEAT::Solver::Linesearch< Functional_, Filter_ >::_trim_threshold
protected

◆ _vec_grad

◆ _vec_initial_sol

◆ _vec_pn

◆ _vec_tmp

◆ iterates

template<typename Functional_ , typename Filter_ >
std::deque<VectorType>* FEAT::Solver::Linesearch< Functional_, Filter_ >::iterates

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