DOLFIN
DOLFIN C++ interface
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
dolfin::PETScTAOSolver Class Reference

#include <PETScTAOSolver.h>

Inheritance diagram for dolfin::PETScTAOSolver:
Inheritance graph
[legend]
Collaboration diagram for dolfin::PETScTAOSolver:
Collaboration graph
[legend]

Public Member Functions

 PETScTAOSolver (MPI_Comm comm, std::string tao_type="default", std::string ksp_type="default", std::string pc_type="default")
 Create TAO solver.
 
 PETScTAOSolver (std::string tao_type="default", std::string ksp_type="default", std::string pc_type="default")
 Create TAO solver on MPI_COMM_WORLD.
 
virtual ~PETScTAOSolver ()
 Destructor.
 
std::pair< std::size_t, bool > solve (OptimisationProblem &optimisation_problem, GenericVector &x, const GenericVector &lb, const GenericVector &ub)
 
std::pair< std::size_t, bool > solve (OptimisationProblem &optimisation_problem, GenericVector &x)
 
MPI_Comm mpi_comm () const
 Return the MPI communicator.
 
Tao tao () const
 Return the TAO pointer.
 
void init (OptimisationProblem &optimisation_problem, PETScVector &x, const PETScVector &lb, const PETScVector &ub)
 
void init (OptimisationProblem &optimisation_problem, PETScVector &x)
 
- Public Member Functions inherited from dolfin::PETScObject
 PETScObject ()
 Constructor. Ensures that PETSc has been initialised.
 
virtual ~PETScObject ()
 Destructor.
 

Static Public Member Functions

static std::vector< std::pair< std::string, std::string > > methods ()
 Return a list of available solver methods.
 
static Parameters default_parameters ()
 Default parameter values.
 
- Static Public Member Functions inherited from dolfin::PETScObject
static void petsc_error (int error_code, std::string filename, std::string petsc_function)
 Print error message for PETSc calls that return an error.
 

Public Attributes

Parameters parameters
 Parameters for the PETSc TAO solver.
 

Detailed Description

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

Member Function Documentation

◆ init() [1/2]

void PETScTAOSolver::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

◆ init() [2/2]

void PETScTAOSolver::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

◆ solve() [1/2]

std::pair< std::size_t, bool > PETScTAOSolver::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

◆ solve() [2/2]

std::pair< std::size_t, bool > PETScTAOSolver::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


The documentation for this class was generated from the following files: