![]() |
v0.15.0 |
Interface for TAO solvers. More...
#include "src/petsc/TaoCtx.hpp"
Public Types | |
using | PairNameFEMethodPtr = MoFEM::PairNameFEMethodPtr |
using | FEMethodsSequence = MoFEM::FEMethodsSequence |
using | BasicMethodsSequence = MoFEM::BasicMethodsSequence |
Public Member Functions | |
TaoCtx (Interface &m_field, const std::string &problem_name) | |
virtual | ~TaoCtx ()=default |
FEMethodsSequence & | getHessianLoops () |
BasicMethodsSequence & | getPreProcHessian () |
BasicMethodsSequence & | getPostProcHessian () |
FEMethodsSequence & | getObjectiveLoops () |
BasicMethodsSequence & | getPreProcObjective () |
BasicMethodsSequence & | getPostProcObjective () |
FEMethodsSequence & | getGradientLoops () |
BasicMethodsSequence & | getPreProcGradient () |
BasicMethodsSequence & | getPostProcGradient () |
MoFEMErrorCode | copyLoops (const TaoCtx &tao_ctx) |
Copy sequences from another TaoCtx. | |
MoFEMErrorCode | clearLoops () |
Clear loops. | |
Public Attributes | |
MoFEM::Interface & | mField |
database Interface | |
moab::Interface & | moab |
moab Interface | |
std::string | problemName |
problem name | |
bool | vErify |
If true verify vector. | |
FEMethodsSequence | loopsHessian |
FEMethodsSequence | loopsObjective |
FEMethodsSequence | loopsGradient |
BasicMethodsSequence | preHessian |
Sequence of methods run before Hessian is assembled. | |
BasicMethodsSequence | postHessian |
Sequence of methods run after Hessian is assembled. | |
BasicMethodsSequence | preObjective |
Sequence of methods run before objective is evaluated. | |
BasicMethodsSequence | postObjective |
Sequence of methods run after objective is evaluated. | |
BasicMethodsSequence | preGradient |
Sequence of methods run before gradient is assembled. | |
BasicMethodsSequence | postGradient |
Sequence of methods run after gradient is assembled. | |
Private Attributes | |
boost::movelib::unique_ptr< bool > | vecAssembleSwitch |
boost::movelib::unique_ptr< bool > | matAssembleSwitch |
PetscLogEvent | MOFEM_EVENT_SnesRhs |
Log events to assemble residual. | |
PetscLogEvent | MOFEM_EVENT_SnesMat |
Log events to assemble tangent matrix. | |
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. | |
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. | |
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.
Definition at line 21 of file TaoCtx.hpp.
|
inline |
Definition at line 50 of file TaoCtx.hpp.
|
virtualdefault |
MoFEMErrorCode MoFEM::TaoCtx::clearLoops | ( | ) |
Clear loops.
Definition at line 23 of file TaoCtx.cpp.
MoFEMErrorCode MoFEM::TaoCtx::copyLoops | ( | const TaoCtx & | tao_ctx | ) |
Copy sequences from another TaoCtx.
tao_ctx | TaoCtx from which sequences are copied |
Definition at line 9 of file TaoCtx.cpp.
|
inline |
Definition at line 78 of file TaoCtx.hpp.
|
inline |
Definition at line 68 of file TaoCtx.hpp.
|
inline |
Definition at line 73 of file TaoCtx.hpp.
|
inline |
Definition at line 80 of file TaoCtx.hpp.
|
inline |
Definition at line 70 of file TaoCtx.hpp.
|
inline |
Definition at line 75 of file TaoCtx.hpp.
|
inline |
Definition at line 79 of file TaoCtx.hpp.
|
inline |
Definition at line 69 of file TaoCtx.hpp.
|
inline |
Definition at line 74 of file TaoCtx.hpp.
|
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 92 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 186 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 37 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 178 of file TaoCtx.cpp.
FEMethodsSequence MoFEM::TaoCtx::loopsGradient |
Sequence of finite element methods for assembling the gradient (first derivative) vector in TAO optimization
Definition at line 32 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 26 of file TaoCtx.hpp.
FEMethodsSequence MoFEM::TaoCtx::loopsObjective |
Sequence of finite element methods for evaluating the objective function in TAO optimization
Definition at line 29 of file TaoCtx.hpp.
|
private |
Definition at line 106 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 |
Log events to assemble tangent matrix.
Definition at line 108 of file TaoCtx.hpp.
|
private |
Log events to assemble residual.
Definition at line 107 of file TaoCtx.hpp.
|
private |
Log event for TAO Gradient.
Definition at line 110 of file TaoCtx.hpp.
|
private |
Log event for TAO Hessian.
Definition at line 109 of file TaoCtx.hpp.
|
private |
Log event for TAO Objective.
Definition at line 111 of file TaoCtx.hpp.
BasicMethodsSequence MoFEM::TaoCtx::postGradient |
Sequence of methods run after gradient is assembled.
Definition at line 48 of file TaoCtx.hpp.
BasicMethodsSequence MoFEM::TaoCtx::postHessian |
Sequence of methods run after Hessian is assembled.
Definition at line 38 of file TaoCtx.hpp.
BasicMethodsSequence MoFEM::TaoCtx::postObjective |
Sequence of methods run after objective is evaluated.
Definition at line 43 of file TaoCtx.hpp.
BasicMethodsSequence MoFEM::TaoCtx::preGradient |
Sequence of methods run before gradient is assembled.
Definition at line 46 of file TaoCtx.hpp.
BasicMethodsSequence MoFEM::TaoCtx::preHessian |
Sequence of methods run before Hessian is assembled.
Definition at line 36 of file TaoCtx.hpp.
BasicMethodsSequence MoFEM::TaoCtx::preObjective |
Sequence of methods run before objective is evaluated.
Definition at line 41 of file TaoCtx.hpp.
std::string MoFEM::TaoCtx::problemName |
problem name
Definition at line 18 of file TaoCtx.hpp.
|
private |
Definition at line 105 of file TaoCtx.hpp.
bool MoFEM::TaoCtx::vErify |
If true verify vector.
Definition at line 19 of file TaoCtx.hpp.