Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
Public Member Functions | Public Attributes | Protected Attributes | List of all members
smith::TrustRegion Class Reference

Equation solver class based on a standard preconditioned trust-region algorithm. More...

Collaboration diagram for smith::TrustRegion:
Collaboration graph
[legend]

Public Member Functions

void projectToBoundaryWithCoefs (mfem::Vector &z, const mfem::Vector &d, double delta, double zz, double zd, double dd) const
 finds tau s.t. (z + tau*d)^2 = trSize^2
 
template<typename HessVecFunc >
void solveTheSubspaceProblem ([[maybe_unused]] mfem::Vector &z, [[maybe_unused]] const HessVecFunc &hess_vec_func, [[maybe_unused]] const std::vector< const mfem::Vector * > ds, [[maybe_unused]] const std::vector< const mfem::Vector * > Hds, [[maybe_unused]] const mfem::Vector &g, [[maybe_unused]] double delta, [[maybe_unused]] int num_leftmost) const
 solve the exact trust-region subspace problem with directions ds, and the leftmosts
 
void projectToBoundaryBetweenWithCoefs (mfem::Vector &z, const mfem::Vector &y, double trSize, double zz, double zy, double yy) const
 finds tau s.t. (z + tau*(y-z))^2 = trSize^2
 
void doglegStep (const mfem::Vector &cp, const mfem::Vector &newtonP, double trSize, mfem::Vector &s) const
 take a dogleg step in direction s, solution norm must be within trSize
 
template<typename HessVecFunc >
double computeEnergy (const mfem::Vector &r_local, const HessVecFunc &H, const mfem::Vector &z) const
 compute the energy of the linearized system for a given solution vector z
 
template<typename HessVecFunc , typename PrecondFunc >
void solveTrustRegionModelProblem (const mfem::Vector &r0, mfem::Vector &rCurrent, HessVecFunc hess_vec_func, PrecondFunc precond, const TrustRegionSettings &settings, double &trSize, TrustRegionResults &results) const
 Minimize quadratic sub-problem given residual vector, the action of the stiffness and a preconditioner.
 
void assembleJacobian (const mfem::Vector &x) const
 assemble the jacobian
 
mfem::real_t computeResidual (const mfem::Vector &x_, mfem::Vector &r_) const
 evaluate the nonlinear residual
 
void hessVec (const mfem::Vector &x_, mfem::Vector &v_) const
 apply the action of the assembled Jacobian matrix to a vector
 
void precond (const mfem::Vector &x_, mfem::Vector &v_) const
 apply trust region specific preconditioner
 
void Mult (const mfem::Vector &, mfem::Vector &X) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Public Attributes

size_t num_hess_vecs = 0
 internal counter for hess-vecs
 
size_t num_preconds = 0
 internal counter for preconditions
 
size_t num_residuals = 0
 internal counter for residuals
 
size_t num_subspace_solves = 0
 internal counter for subspace solves
 
size_t num_jacobian_assembles = 0
 internal counter for matrix assembles
 

Protected Attributes

mfem::Vector x_pred
 predicted solution
 
mfem::Vector r_pred
 predicted residual
 
mfem::Vector scratch
 scratch
 
std::vector< std::shared_ptr< mfem::Vector > > left_mosts
 left most eigenvectors
 
std::vector< std::shared_ptr< mfem::Vector > > H_left_mosts
 the action of the stiffness/hessian (H) on the left most eigenvectors
 
NonlinearSolverOptions nonlinear_options
 nonlinear solution options
 
LinearSolverOptions linear_options
 linear solution options
 
Solver & tr_precond
 
size_t print_level = 0
 reconstructed smith print level
 

Detailed Description

Equation solver class based on a standard preconditioned trust-region algorithm.

This is a fairly standard implementation of 'The Conjugate Gradient Method and Trust Regions in Large Scale Optimization' by T. Steihaug It is also called the Steihaug-Toint CG trust region algorithm (see also Trust Region Methods by Conn, Gould, and Toint). One important difference is we do not compute an explicit energy. Instead we rely on an incremental work approximation: 0.5 (f^n + f^{n+1}) dot (u^{n+1} - u^n). While less theoretically sound, it appears to be very effective in practice.

Definition at line 315 of file equation_solver.cpp.

Member Data Documentation

◆ tr_precond

Solver& smith::TrustRegion::tr_precond
protected

handle to the preconditioner used by the trust region, it ignores the linear solver as a SPD preconditioner is currently required

Definition at line 335 of file equation_solver.cpp.


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