![]() |
v0.16.3 |
Interface for TAO solvers. More...
#include "src/petsc/TaoCtx.hpp"
Public Types | |
| using | PairNameFEMethodPtr = MoFEM::PairNameFEMethodPtr |
| using | FEMethodsSequence = MoFEM::FEMethodsSequence |
| using | BasicMethodsSequence = MoFEM::BasicMethodsSequence |
| using | ObjectiveHook = boost::function< MoFEMErrorCode(Tao tao, Vec x, PetscReal *objective)> |
| using | GradientHook = boost::function< MoFEMErrorCode(Tao tao, Vec x, Vec gradient)> |
| using | ObjectiveAndGradientHook = boost::function< MoFEMErrorCode(Tao tao, Vec x, PetscReal *objective, Vec gradient)> |
Private Member Functions | |
| PetscErrorCode | evaluateConstraint (Tao tao, Vec x, Vec c, FEMethodsSequence &loops, BasicMethodsSequence &pre_process, BasicMethodsSequence &post_process, TaoMethod::TAOContext evaluation_context, PetscLogEvent log_event) |
| PetscErrorCode | evaluateConstraintJacobian (Tao tao, Vec x, Mat J, Mat Jpre, FEMethodsSequence &loops, BasicMethodsSequence &pre_process, BasicMethodsSequence &post_process, TaoMethod::TAOContext evaluation_context, PetscLogEvent log_event) |
Private Attributes | |
| ObjectiveHook | objectiveHook |
| GradientHook | gradientHook |
| ObjectiveAndGradientHook | objectiveAndGradientHook |
| boost::movelib::unique_ptr< bool > | vecAssembleSwitch |
| boost::movelib::unique_ptr< bool > | matAssembleSwitch |
| PetscLogEvent | MOFEM_EVENT_TaoHessian |
| Log event for TAO Hessian. | |
| PetscLogEvent | MOFEM_EVENT_TaoGradient |
| Log event for TAO Gradient. | |
| PetscLogEvent | MOFEM_EVENT_TaoObjective |
| Log event for TAO Objective. | |
| PetscLogEvent | MOFEM_EVENT_TaoEqualityConstraint |
| PetscLogEvent | MOFEM_EVENT_TaoInequalityConstraint |
| PetscLogEvent | MOFEM_EVENT_TaoEqualityJacobian |
| PetscLogEvent | MOFEM_EVENT_TaoInequalityJacobian |
Friends | |
| PetscErrorCode | TaoSetObjective (Tao tao, Vec x, PetscReal *f, void *ctx) |
| Sets the objective function value for a TAO optimization context. | |
| PetscErrorCode | TaoSetGradient (Tao tao, Vec x, Vec g, void *ctx) |
| Sets the gradient vector for a TAO optimization context. | |
| PetscErrorCode | TaoSetObjectiveAndGradient (Tao tao, Vec x, PetscReal *f, Vec g, void *ctx) |
| Sets the objective function value and gradient for a TAO optimization solver. | |
| PetscErrorCode | TaoSetHessian (Tao tao, Vec x, Mat H, Mat Hpre, void *ctx) |
| Sets the Hessian matrix for a TAO optimization context. | |
| PetscErrorCode | TaoSetEqualityConstraints (Tao tao, Vec x, Vec c, void *ctx) |
| Evaluate equality constraints for a TAO optimization context. | |
| PetscErrorCode | TaoSetInequalityConstraints (Tao tao, Vec x, Vec c, void *ctx) |
| Evaluate inequality constraints for a TAO optimization context. | |
| PetscErrorCode | TaoSetJacobianEquality (Tao tao, Vec x, Mat J, Mat Jpre, void *ctx) |
| Assemble the equality constraint Jacobian. | |
| PetscErrorCode | TaoSetJacobianInequality (Tao tao, Vec x, Mat J, Mat Jpre, void *ctx) |
| Assemble the inequality constraint Jacobian. | |
Interface for TAO solvers.
Definition at line 14 of file TaoCtx.hpp.
Definition at line 23 of file TaoCtx.hpp.
Definition at line 22 of file TaoCtx.hpp.
| using MoFEM::TaoCtx::GradientHook = boost::function<MoFEMErrorCode(Tao tao, Vec x, Vec gradient)> |
Definition at line 26 of file TaoCtx.hpp.
| using MoFEM::TaoCtx::ObjectiveAndGradientHook = boost::function<MoFEMErrorCode( Tao tao, Vec x, PetscReal *objective, Vec gradient)> |
Definition at line 28 of file TaoCtx.hpp.
| using MoFEM::TaoCtx::ObjectiveHook = boost::function<MoFEMErrorCode(Tao tao, Vec x, PetscReal *objective)> |
Definition at line 24 of file TaoCtx.hpp.
Definition at line 21 of file TaoCtx.hpp.
|
inline |
Definition at line 93 of file TaoCtx.hpp.
|
virtualdefault |
| MoFEMErrorCode MoFEM::TaoCtx::clearLoops | ( | ) |
Clear loops.
Evaluator hooks are unchanged.
Definition at line 67 of file TaoCtx.cpp.
| MoFEMErrorCode MoFEM::TaoCtx::copyLoops | ( | const TaoCtx & | tao_ctx | ) |
Copy sequences from another TaoCtx.
Evaluator hooks are unchanged.
| tao_ctx | TaoCtx from which sequences are copied |
Definition at line 41 of file TaoCtx.cpp.
|
private |
Definition at line 93 of file TaoCtx.cpp.
|
private |
Definition at line 160 of file TaoCtx.cpp.
|
inline |
Definition at line 134 of file TaoCtx.hpp.
|
inline |
Definition at line 156 of file TaoCtx.hpp.
|
inline |
Get an optional gradient evaluator.
When set, MoFEM::TaoSetGradient delegates the complete evaluation to this hook before scattering controls to the mesh or running element loops. The hook owns state synchronization and gradient assembly.
Definition at line 193 of file TaoCtx.hpp.
|
inline |
Definition at line 129 of file TaoCtx.hpp.
|
inline |
Definition at line 119 of file TaoCtx.hpp.
|
inline |
Definition at line 145 of file TaoCtx.hpp.
|
inline |
Definition at line 167 of file TaoCtx.hpp.
|
inline |
Get an optional combined objective-and-gradient evaluator.
When set, MoFEM::TaoSetObjectiveAndGradient delegates the complete evaluation to this hook. This supports reduced objectives which require an application-owned state solve before returning the value and gradient. Otherwise, the separate objective and gradient callbacks are used.
Definition at line 203 of file TaoCtx.hpp.
|
inline |
Get an optional objective evaluator.
When set, MoFEM::TaoSetObjective delegates the complete evaluation to this hook before scattering controls to the mesh or running element loops. The hook owns state synchronization and objective evaluation.
Definition at line 184 of file TaoCtx.hpp.
|
inline |
Definition at line 124 of file TaoCtx.hpp.
|
inline |
Definition at line 140 of file TaoCtx.hpp.
|
inline |
Definition at line 162 of file TaoCtx.hpp.
|
inline |
Definition at line 131 of file TaoCtx.hpp.
|
inline |
Definition at line 121 of file TaoCtx.hpp.
|
inline |
Definition at line 151 of file TaoCtx.hpp.
|
inline |
Definition at line 173 of file TaoCtx.hpp.
|
inline |
Definition at line 126 of file TaoCtx.hpp.
|
inline |
Definition at line 137 of file TaoCtx.hpp.
|
inline |
Definition at line 159 of file TaoCtx.hpp.
|
inline |
Definition at line 130 of file TaoCtx.hpp.
|
inline |
Definition at line 120 of file TaoCtx.hpp.
|
inline |
Definition at line 148 of file TaoCtx.hpp.
|
inline |
Definition at line 170 of file TaoCtx.hpp.
|
inline |
Definition at line 125 of file TaoCtx.hpp.
|
friend |
Evaluate equality constraints for a TAO optimization context.
Register this callback with TaoSetEqualityConstraintsRoutine().
Definition at line 468 of file TaoCtx.cpp.
|
friend |
Sets the gradient vector for a TAO optimization context.
| tao | The TAO optimization solver context. |
| x | The input vector at which to evaluate the gradient. |
| g | Pointer to the gradient vector. |
| ctx | User-defined context for the gradient function. |
Definition at line 296 of file TaoCtx.cpp.
|
friend |
Sets the Hessian matrix for a TAO optimization context.
| tao | The TAO optimization solver context. |
| x | The input vector at which to evaluate the Hessian. |
| H | Pointer to the Hessian matrix. |
| Hpre | Preconditioner matrix (can be NULL). |
| ctx | User-defined context for the Hessian function. |
Definition at line 399 of file TaoCtx.cpp.
|
friend |
Evaluate inequality constraints for a TAO optimization context.
Register this callback with TaoSetInequalityConstraintsRoutine(). PETSc defines feasible inequality constraints by c(x) >= 0.
Definition at line 479 of file TaoCtx.cpp.
|
friend |
Assemble the equality constraint Jacobian.
Register this callback with TaoSetJacobianEqualityRoutine().
Definition at line 490 of file TaoCtx.cpp.
|
friend |
Assemble the inequality constraint Jacobian.
Register this callback with TaoSetJacobianInequalityRoutine().
Definition at line 502 of file TaoCtx.cpp.
|
friend |
Sets the objective function value for a TAO optimization context.
| tao | The TAO optimization solver context. |
| x | The input vector at which to evaluate the objective. |
| f | Pointer to store the computed objective value. |
| ctx | User-defined context for the objective function. |
Definition at line 237 of file TaoCtx.cpp.
|
friend |
Sets the objective function value and gradient for a TAO optimization solver.
| tao | The TAO solver context. |
| x | Input vector at which to evaluate the objective and gradient. |
| f | Pointer to store the computed objective function value. |
| g | Vector to store the computed gradient. |
| ctx | User-defined context for objective and gradient evaluation. |
Definition at line 386 of file TaoCtx.cpp.
|
private |
Definition at line 254 of file TaoCtx.hpp.
| FEMethodsSequence MoFEM::TaoCtx::loopsEqualityConstraint |
Sequence of finite element methods for evaluating equality constraints
Definition at line 40 of file TaoCtx.hpp.
| FEMethodsSequence MoFEM::TaoCtx::loopsEqualityJacobian |
Sequence of finite element methods for assembling the equality constraint Jacobian
Definition at line 46 of file TaoCtx.hpp.
| FEMethodsSequence MoFEM::TaoCtx::loopsGradient |
Sequence of finite element methods for assembling the gradient (first derivative) vector in TAO optimization
Definition at line 38 of file TaoCtx.hpp.
| FEMethodsSequence MoFEM::TaoCtx::loopsHessian |
Sequence of finite element methods for assembling the Hessian (second derivative) matrix in TAO optimization
Definition at line 32 of file TaoCtx.hpp.
| FEMethodsSequence MoFEM::TaoCtx::loopsInequalityConstraint |
Sequence of finite element methods for evaluating inequality constraints
Definition at line 43 of file TaoCtx.hpp.
| FEMethodsSequence MoFEM::TaoCtx::loopsInequalityJacobian |
Sequence of finite element methods for assembling the inequality constraint Jacobian
Definition at line 49 of file TaoCtx.hpp.
| FEMethodsSequence MoFEM::TaoCtx::loopsObjective |
Sequence of finite element methods for evaluating the objective function in TAO optimization
Definition at line 35 of file TaoCtx.hpp.
|
private |
Definition at line 257 of file TaoCtx.hpp.
| MoFEM::Interface& MoFEM::TaoCtx::mField |
database Interface
Definition at line 16 of file TaoCtx.hpp.
| moab::Interface& MoFEM::TaoCtx::moab |
moab Interface
Definition at line 17 of file TaoCtx.hpp.
|
private |
Definition at line 261 of file TaoCtx.hpp.
|
private |
Definition at line 263 of file TaoCtx.hpp.
|
private |
Log event for TAO Gradient.
Definition at line 259 of file TaoCtx.hpp.
|
private |
Log event for TAO Hessian.
Definition at line 258 of file TaoCtx.hpp.
|
private |
Definition at line 262 of file TaoCtx.hpp.
|
private |
Definition at line 264 of file TaoCtx.hpp.
|
private |
Log event for TAO Objective.
Definition at line 260 of file TaoCtx.hpp.
|
private |
Definition at line 255 of file TaoCtx.hpp.
|
private |
Definition at line 253 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::postEqualityConstraint |
Sequence of methods run after equality constraints are evaluated
Definition at line 71 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::postEqualityJacobian |
Sequence of methods run after the equality Jacobian is assembled
Definition at line 83 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::postGradient |
Sequence of methods run after gradient is assembled.
Definition at line 66 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::postHessian |
Sequence of methods run after Hessian is assembled.
Definition at line 56 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::postInequalityConstraint |
Sequence of methods run after inequality constraints are evaluated
Definition at line 77 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::postInequalityJacobian |
Sequence of methods run after the inequality Jacobian is assembled
Definition at line 89 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::postObjective |
Sequence of methods run after objective is evaluated.
Definition at line 61 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::preEqualityConstraint |
Sequence of methods run before equality constraints are evaluated
Definition at line 68 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::preEqualityJacobian |
Sequence of methods run before the equality Jacobian is assembled
Definition at line 80 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::preGradient |
Sequence of methods run before gradient is assembled.
Definition at line 64 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::preHessian |
Sequence of methods run before Hessian is assembled.
Definition at line 54 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::preInequalityConstraint |
Sequence of methods run before inequality constraints are evaluated
Definition at line 74 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::preInequalityJacobian |
Sequence of methods run before the inequality Jacobian is assembled
Definition at line 86 of file TaoCtx.hpp.
| BasicMethodsSequence MoFEM::TaoCtx::preObjective |
Sequence of methods run before objective is evaluated.
Definition at line 59 of file TaoCtx.hpp.
| std::string MoFEM::TaoCtx::problemName |
problem name
Definition at line 18 of file TaoCtx.hpp.
|
private |
Definition at line 256 of file TaoCtx.hpp.
| bool MoFEM::TaoCtx::vErify |
If true verify vector.
Definition at line 19 of file TaoCtx.hpp.