Go to the documentation of this file.
20 #ifndef LIBMESH_TAO_OPTIMIZATION_SOLVER_H
21 #define LIBMESH_TAO_OPTIMIZATION_SOLVER_H
23 #include "libmesh/libmesh_config.h"
26 #if defined(LIBMESH_HAVE_PETSC_TAO) && !defined(LIBMESH_USE_COMPLEX_NUMBERS)
29 #include "libmesh/petsc_macro.h"
30 #include "libmesh/optimization_solver.h"
34 # define LIBMESH_SAW_I
38 # undef I // Avoid complex.h contamination
87 virtual void clear ()
override;
92 virtual void init ()
override;
102 virtual void solve ()
override;
160 #endif // #if defined(LIBMESH_HAVE_PETSC_TAO) && !defined(LIBMESH_USE_COMPLEX_NUMBERS)
161 #endif // LIBMESH_TAO_OPTIMIZATION_SOLVER_H
This System subclass enables us to assemble an objective function, gradient, Hessian and bounds for o...
TaoOptimizationSolver(sys_type &system)
Constructor.
TaoConvergedReason _reason
Store the reason for Tao convergence/divergence for use even after _tao has been cleared.
virtual void solve() override
Call the Tao solver.
The libMesh namespace provides an interface to certain functionality in the library.
PetscErrorCode __libmesh_tao_gradient(Tao tao, Vec x, Vec g, void *ctx)
virtual void get_dual_variables() override
Get the current values of dual variables associated with inequality and equality constraints.
Tao _tao
Optimization solver context.
OptimizationSystem sys_type
The type of system that we use in conjunction with this solver.
This base class can be inherited from to provide interfaces to optimization solvers from different pa...
virtual int get_converged_reason() override
friend PetscErrorCode __libmesh_tao_hessian(Tao tao, Vec x, Mat h, Mat pc, void *ctx)
PetscErrorCode __libmesh_tao_objective(Tao tao, Vec x, PetscReal *objective, void *ctx)
virtual void print_converged_reason() override
Prints a useful message about why the latest optimization solve con(di)verged.
virtual void init() override
Initialize data structures if not done so already.
PetscErrorCode __libmesh_tao_hessian(Tao tao, Vec x, Mat h, Mat pc, void *ctx)
friend PetscErrorCode __libmesh_tao_objective(Tao tao, Vec x, PetscReal *objective, void *ctx)
const sys_type & system() const
PetscErrorCode __libmesh_tao_inequality_constraints(Tao tao, Vec x, Vec cineq, void *ctx)
friend PetscErrorCode __libmesh_tao_gradient(Tao tao, Vec x, Vec g, void *ctx)
friend PetscErrorCode __libmesh_tao_equality_constraints(Tao tao, Vec x, Vec ce, void *ctx)
This class provides an interface to the Tao optimization solvers.
PetscErrorCode __libmesh_tao_equality_constraints(Tao tao, Vec x, Vec ce, void *ctx)
PetscErrorCode __libmesh_tao_inequality_constraints_jacobian(Tao tao, Vec x, Mat J, Mat Jpre, void *ctx)
friend PetscErrorCode __libmesh_tao_inequality_constraints_jacobian(Tao tao, Vec x, Mat J, Mat Jpre, void *ctx)
PetscErrorCode __libmesh_tao_equality_constraints_jacobian(Tao tao, Vec x, Mat J, Mat Jpre, void *ctx)
virtual void clear() override
Release all memory and clear data structures.
~TaoOptimizationSolver()
Destructor.
friend PetscErrorCode __libmesh_tao_equality_constraints_jacobian(Tao tao, Vec x, Mat J, Mat Jpre, void *ctx)
friend PetscErrorCode __libmesh_tao_inequality_constraints(Tao tao, Vec x, Vec cineq, void *ctx)