:orphan: # 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 ## Sample usage ```none TaoRegister("my_solver", MySolverCreate); ``` Then, your solver can be chosen with the procedural interface via ```none TaoSetType(tao, "my_solver") ``` or at runtime via the option ```none -tao_type my_solver ``` ## Note `TaoRegister()` may be called multiple times to add several user-defined solvers. ## See Also [](ch_tao), `Tao`, `TaoSetType()`, `TaoRegisterAll()`, `TaoRegisterDestroy()` ## Level advanced ## Location src/tao/interface/taosolver.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/tao/interface/taosolver.c) [Index of all Tao routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)