# TaoSetMaximumFunctionEvaluations
Sets a maximum number of function evaluations. 
## Synopsis
```
#include "petsctao.h" 
PetscErrorCode TaoSetMaximumFunctionEvaluations(Tao tao, PetscInt nfcn)
```
Logically Collective


## Input Parameters

- ***tao -*** the Tao solver context
- ***nfcn -*** the maximum number of function evaluations (>=0)



## Options Database Keys

- ***-tao_max_funcs <nfcn> -*** sets the maximum number of function evaluations





## See Also
 `TaoSetTolerances()`, `TaoSetMaximumIterations()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/interface/taosolver.c.html#TaoSetMaximumFunctionEvaluations">src/tao/interface/taosolver.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/constrained/tutorials/ex1.c.html">src/tao/constrained/tutorials/ex1.c.html</A><BR>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
