PETScTAOSolver.h

Note

The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.

class PETScTAOSolver

Parent class(es)

This class implements methods for solving nonlinear optimisation problems via PETSc TAO solver. It supports unconstrained as well as bound-constrained minimisation problem

explicit PETScTAOSolver(MPI_Comm comm, std::string tao_type = "default", std::string ksp_type = "default", std::string pc_type = "default")

Create TAO solver

explicit PETScTAOSolver(std::string tao_type = "default", std::string ksp_type = "default", std::string pc_type = "default")

Create TAO solver on MPI_COMM_WORLD

std::pair<std::size_t, bool> solve(OptimisationProblem &optimisation_problem, GenericVector &x, const GenericVector &lb, const GenericVector &ub)

Solve a nonlinear bound-constrained optimisation problem

Arguments
optimisation_problem (OptimisationProblem)
The nonlinear optimisation problem.
x (GenericVector)
The solution vector (initial guess).
lb (GenericVector)
The lower bound.
ub (GenericVector)
The upper bound.
Returns
(its, converged) (std::pair<std::size_t, bool>)
Pair of number of iterations, and whether iteration converged
std::pair<std::size_t, bool> solve(OptimisationProblem &optimisation_problem, GenericVector &x)

Solve a nonlinear unconstrained minimisation problem

Arguments
optimisation_problem (OptimisationProblem)
The nonlinear optimisation problem.
x (GenericVector)
The solution vector (initial guess).
Returns
(its, converged) (std::pair<std::size_t, bool>)
Pair of number of iterations, and whether iteration converged
MPI_Comm mpi_comm() const

Return the MPI communicator

static std::vector<std::pair<std::string, std::string>> methods()

Return a list of available solver methods

static Parameters default_parameters()

Default parameter values

Tao tao() const

Return the TAO pointer

void init(OptimisationProblem &optimisation_problem, PETScVector &x, const PETScVector &lb, const PETScVector &ub)

Initialise the TAO solver for a bound-constrained minimisation problem, in case the user wants to access the TAO object directly

void init(OptimisationProblem &optimisation_problem, PETScVector &x)

Initialise the TAO solver for an unconstrained minimisation problem, in case the user wants to access the TAO object directly

std::pair<std::size_t, bool> solve(OptimisationProblem &optimisation_problem, PETScVector &x, const PETScVector &lb, const PETScVector &ub)

Solve a nonlinear bound-constrained minimisation problem

Arguments
optimisation_problem (OptimisationProblem)
The nonlinear optimisation problem.
x (PETScVector)
The solution vector (initial guess).
lb (PETScVector)
The lower bound.
ub (PETScVector)
The upper bound.
Returns
(its, converged) (std::pair<std::size_t, bool>)
Pair of number of iterations, and whether iteration converged