#include "math.h"
#include <assert.h>
#include <petsctao.h>
#include "defs.hpp"
#include "timestepper.hpp"
#include <iostream>
#include <algorithm>
#include "optimtarget.hpp"
Go to the source code of this file.
|
| #define | TaoSetObjective TaoSetObjectiveRoutine |
| |
| #define | TaoSetGradient(tao, NULL, TaoEvalGradient, this) TaoSetGradientRoutine(tao, TaoEvalGradient,this) |
| |
| #define | TaoSetObjectiveAndGradient(tao, NULL, TaoEvalObjectiveAndGradient, this) TaoSetObjectiveAndGradientRoutine(tao, TaoEvalObjectiveAndGradient,this) |
| |
| #define | TaoSetSolution(tao, xinit) TaoSetInitialVector(tao, xinit) |
| |
| #define | TaoGetSolution(tao, params) TaoGetSolutionVector(tao, params) |
| |
| #define | TaoMonitorSet TaoSetMonitor |
| |
|
| PetscErrorCode | TaoMonitor (Tao tao, void *ptr) |
| | Monitors optimization progress during TAO optimization iterations.
|
| |
| PetscErrorCode | TaoEvalObjective (Tao tao, Vec x, PetscReal *f, void *ptr) |
| | PETSc TAO interface routine for objective function evaluation.
|
| |
| PetscErrorCode | TaoEvalGradient (Tao tao, Vec x, Vec G, void *ptr) |
| | PETSc TAO interface routine for gradient evaluation.
|
| |
| PetscErrorCode | TaoEvalObjectiveAndGradient (Tao tao, Vec x, PetscReal *f, Vec G, void *ptr) |
| | PETSc TAO interface routine for combined objective and gradient evaluation.
|
| |
◆ TaoGetSolution
| #define TaoGetSolution |
( |
|
tao, |
|
|
|
params |
|
) |
| TaoGetSolutionVector(tao, params) |
◆ TaoMonitorSet
| #define TaoMonitorSet TaoSetMonitor |
◆ TaoSetGradient
◆ TaoSetObjective
| #define TaoSetObjective TaoSetObjectiveRoutine |
◆ TaoSetObjectiveAndGradient
◆ TaoSetSolution
| #define TaoSetSolution |
( |
|
tao, |
|
|
|
xinit |
|
) |
| TaoSetInitialVector(tao, xinit) |
◆ TaoEvalGradient()
| PetscErrorCode TaoEvalGradient |
( |
Tao |
tao, |
|
|
Vec |
x, |
|
|
Vec |
G, |
|
|
void * |
ptr |
|
) |
| |
PETSc TAO interface routine for gradient evaluation.
- Parameters
-
| tao | TAO solver object |
| x | Design vector |
| G | Gradient vector |
| ptr | Pointer to user context (OptimProblem instance) |
- Returns
- PetscErrorCode Error code
◆ TaoEvalObjective()
| PetscErrorCode TaoEvalObjective |
( |
Tao |
tao, |
|
|
Vec |
x, |
|
|
PetscReal * |
f, |
|
|
void * |
ptr |
|
) |
| |
PETSc TAO interface routine for objective function evaluation.
- Parameters
-
| tao | TAO solver object |
| x | Design vector |
| f | Pointer to store objective function value |
| ptr | Pointer to user context (OptimProblem instance) |
- Returns
- PetscErrorCode Error code
◆ TaoEvalObjectiveAndGradient()
| PetscErrorCode TaoEvalObjectiveAndGradient |
( |
Tao |
tao, |
|
|
Vec |
x, |
|
|
PetscReal * |
f, |
|
|
Vec |
G, |
|
|
void * |
ptr |
|
) |
| |
PETSc TAO interface routine for combined objective and gradient evaluation.
- Parameters
-
| tao | TAO solver object |
| x | Design vector |
| f | Pointer to store objective function value |
| G | Gradient vector |
| ptr | Pointer to user context (OptimProblem instance) |
- Returns
- PetscErrorCode Error code
◆ TaoMonitor()
| PetscErrorCode TaoMonitor |
( |
Tao |
tao, |
|
|
void * |
ptr |
|
) |
| |
Monitors optimization progress during TAO optimization iterations.
This callback function is called at each iteration of TaoSolve() to track convergence and output progress information.
- Parameters
-
| tao | TAO solver object |
| ptr | Pointer to user context (OptimProblem instance) |
- Returns
- PetscErrorCode Error code