Namespace for black-box FD Newton solver. More...
Typedefs | |
typedef void(* | ResidualFctPt) (const Vector< double > ¶meters, const Vector< double > &unknowns, Vector< double > &residuals) |
typedef void(* | JacobianFctPt) (const Vector< double > &, const Vector< double > &, DenseDoubleMatrix &jacobian) |
Functions | |
void | black_box_fd_newton_solve (ResidualFctPt residual_fct, const Vector< double > ¶ms, Vector< double > &unknowns, JacobianFctPt jacobian_fct) |
Black-box FD Newton solver: Calling sequence for residual function is. More... | |
void | line_search (const Vector< double > &x_old, const double half_residual_squared_old, const Vector< double > &gradient, ResidualFctPt residual_fct, const Vector< double > ¶ms, Vector< double > &newton_dir, Vector< double > &x, double &half_residual_squared, const double &stpmax) |
Line search helper for globally convergent Newton method. More... | |
Variables | |
unsigned | Max_iter = 20 |
Max. # of Newton iterations. More... | |
unsigned | N_iter_taken = 0 |
Number of Newton iterations taken in most recent invocation. More... | |
bool | Doc_Progress = false |
Flag to indicate if progress of Newton iteration is to be documented (defaults to false) More... | |
double | FD_step = 1.0e-8 |
FD step. More... | |
double | Tol = 1.0e-8 |
Tolerance. More... | |
bool | Use_step_length_control = false |
Use steplength control do make globally convergent (default false) More... | |
Namespace for black-box FD Newton solver.
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
typedef void(* oomph::BlackBoxFDNewtonSolver::JacobianFctPt) (const Vector< double > &, const Vector< double > &, DenseDoubleMatrix &jacobian) |
Definition at line 60 of file black_box_newton_solver.h.
typedef void(* oomph::BlackBoxFDNewtonSolver::ResidualFctPt) (const Vector< double > ¶meters, const Vector< double > &unknowns, Vector< double > &residuals) |
Definition at line 55 of file black_box_newton_solver.h.
void oomph::BlackBoxFDNewtonSolver::black_box_fd_newton_solve | ( | ResidualFctPt | residual_fct, |
const Vector< double > & | params, | ||
Vector< double > & | unknowns, | ||
JacobianFctPt | jacobian_fct | ||
) |
Black-box FD Newton solver: Calling sequence for residual function is.
where all arguments are double Vectors. unknowns.size() = residuals.size()
Reset number of Newton iterations taken in most recent invocation
Definition at line 67 of file black_box_newton_solver.cc.
References Doc_Progress, FD_step, i, line_search(), Max_iter, N_iter_taken, oomph::oomph_info, oomph::DoubleMatrixBase::solve(), oomph::Matrix< T, MATRIX_TYPE >::sparse_indexed_output(), oomph::OomphInfo::stream_pt(), Tol, and Use_step_length_control.
void oomph::BlackBoxFDNewtonSolver::line_search | ( | const Vector< double > & | x_old, |
const double | half_residual_squared_old, | ||
const Vector< double > & | gradient, | ||
ResidualFctPt | residual_fct, | ||
const Vector< double > & | params, | ||
Vector< double > & | newton_dir, | ||
Vector< double > & | x, | ||
double & | half_residual_squared, | ||
const double & | stpmax | ||
) |
Line search helper for globally convergent Newton method.
Definition at line 233 of file black_box_newton_solver.cc.
References i.
Referenced by black_box_fd_newton_solve().
bool oomph::BlackBoxFDNewtonSolver::Doc_Progress = false |
Flag to indicate if progress of Newton iteration is to be documented (defaults to false)
Definition at line 51 of file black_box_newton_solver.cc.
Referenced by black_box_fd_newton_solve().
double oomph::BlackBoxFDNewtonSolver::FD_step = 1.0e-8 |
FD step.
Definition at line 54 of file black_box_newton_solver.cc.
Referenced by black_box_fd_newton_solve(), oomph::Problem::get_derivative_wrt_global_parameter(), oomph::Problem::get_fd_jacobian(), oomph::Problem::get_hessian_vector_products(), oomph::FoldHandler::get_jacobian(), oomph::PitchForkHandler::get_jacobian(), oomph::HopfHandler::get_jacobian(), oomph::AugmentedBlockFoldLinearSolver::resolve(), oomph::AugmentedBlockPitchForkLinearSolver::resolve(), oomph::AugmentedBlockFoldLinearSolver::solve(), oomph::AugmentedBlockPitchForkLinearSolver::solve(), oomph::BlockHopfLinearSolver::solve(), and oomph::BlockHopfLinearSolver::solve_for_two_rhs().
unsigned oomph::BlackBoxFDNewtonSolver::Max_iter = 20 |
Max. # of Newton iterations.
Definition at line 44 of file black_box_newton_solver.cc.
Referenced by black_box_fd_newton_solve(), oomph::ComplexDampedJacobi< MATRIX >::complex_solve_helper(), oomph::ComplexGMRES< MATRIX >::complex_solve_helper(), oomph::CG< MATRIX >::solve_helper(), oomph::BiCGStab< MATRIX >::solve_helper(), oomph::GS< MATRIX >::solve_helper(), oomph::DampedJacobi< MATRIX >::solve_helper(), oomph::GMRES< MATRIX >::solve_helper(), oomph::HelmholtzGMRESMG< MATRIX >::solve_helper(), and oomph::HelmholtzFGMRESMG< MATRIX >::solve_helper().
unsigned oomph::BlackBoxFDNewtonSolver::N_iter_taken = 0 |
Number of Newton iterations taken in most recent invocation.
Definition at line 47 of file black_box_newton_solver.cc.
Referenced by black_box_fd_newton_solve().
double oomph::BlackBoxFDNewtonSolver::Tol = 1.0e-8 |
Tolerance.
Definition at line 57 of file black_box_newton_solver.cc.
Referenced by black_box_fd_newton_solve().
bool oomph::BlackBoxFDNewtonSolver::Use_step_length_control = false |
Use steplength control do make globally convergent (default false)
Definition at line 60 of file black_box_newton_solver.cc.
Referenced by black_box_fd_newton_solve().