Actual source code: bqnktl.c

petsc-3.15.0 2021-04-05
Report Typos and Errors
  1: #include <../src/tao/bound/impls/bqnk/bqnk.h>

  3: static PetscErrorCode TaoSetUp_BQNKTL(Tao tao)
  4: {
  5:   TAO_BNK         *bnk = (TAO_BNK*)tao->data;

  9:   TaoSetUp_BQNK(tao);
 10:   if (!bnk->is_nash && !bnk->is_stcg && !bnk->is_gltr) SETERRQ(PetscObjectComm((PetscObject)tao),PETSC_ERR_SUP,"Must use a trust-region CG method for KSP (KSPNASH, KSPSTCG, KSPGLTR)");
 11:   return(0);
 12: }

 14: /*MC
 15:   TAOBQNKTL - Bounded Quasi-Newton-Krylov Trust-region with Line-search fallback, for nonlinear
 16:               minimization with bound constraints. This method approximates the Hessian-vector
 17:               product using a limited-memory quasi-Newton formula, and iteratively inverts the
 18:               Hessian with a Krylov solver. The quasi-Newton matrix and its settings can be
 19:               accessed via the prefix `-tao_bqnk_`

 21:   Options Database Keys:
 22: + -tao_bqnk_max_cg_its - maximum number of bounded conjugate-gradient iterations taken in each Newton loop
 23: . -tao_bqnk_init_type - trust radius initialization method ("constant", "direction", "interpolation")
 24: . -tao_bqnk_update_type - trust radius update method ("step", "direction", "interpolation")
 25: - -tao_bqnk_as_type - active-set estimation method ("none", "bertsekas")

 27:   Level: beginner
 28: M*/
 29: PETSC_EXTERN PetscErrorCode TaoCreate_BQNKTL(Tao tao)
 30: {
 31:   TAO_BNK        *bnk;
 32:   TAO_BQNK       *bqnk;

 36:   TaoCreate_BQNK(tao);
 37:   tao->ops->setup = TaoSetUp_BQNKTL;
 38:   bnk = (TAO_BNK*)tao->data;
 39:   bqnk = (TAO_BQNK*)bnk->ctx;
 40:   bqnk->solve = TaoSolve_BNTL;
 41:   return(0);
 42: }