TaoRegister — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# TaoRegister

Adds a method to the Tao package for minimization.

## Synopsis

    #include "petsctao.h"
    PetscErrorCode TaoRegister(const char sname[], PetscErrorCode (*func)(Tao))

Not Collective

## Input Parameters

- sname - name of a new user-defined solver

- func - routine to Create method context

## Example Usage

       TaoRegister("my_solver", MySolverCreate);

Then, your solver can be chosen with the procedural interface via

    TaoSetType(tao, "my_solver")

or at runtime via the option

    -tao_type my_solver

## Note

`TaoRegister()` may be called multiple times to add several user-defined solvers.

## See Also

TAO: Optimization Solvers, `Tao`, `TaoSetType()`, `TaoRegisterAll()`, `TaoRegisterDestroy()`

## Level

advanced

## Location

src/tao/interface/taosolver.c

Index of all Tao routines
Table of Contents for all manual pages
Index of all manual pages