Skip to main content
`Ctrl`+`K`

# TaoTermShellSetObjectiveAndGradient

Set the objective and gradient function of a `TAOTERMSHELL`

## Synopsis

    #include "petsctao.h"
    PetscErrorCode TaoTermShellSetObjectiveAndGradient(TaoTerm term, TaoTermObjectiveAndGradientFn *objandgrad)

Logically collective

## Input Parameters

- term - a `TaoTerm` of type `TAOTERMSHELL`

- objandgrad - a `TaoTermObjectiveAndGradientFn` function pointer

## See Also

TaoTerm: composable objective function terms, `TaoTerm`, `TAOTERMSHELL`, `TaoTermShellGetContext()`, `TaoTermShellSetContextDestroy()`, `TaoTermShellSetObjective()`, `TaoTermShellSetGradient()`, `TaoTermShellSetHessian()`, `TaoTermShellSetView()`, `TaoTermObjectiveAndGradientFn`

## Level

intermediate

## Location

src/tao/term/impls/shell/taotermshell.c

## Examples

src/tao/unconstrained/tutorials/rosenbrock1_taoterm.c

## Implementations

TaoTermShellSetObjectiveAndGradient_Shell() in src/tao/term/impls/shell/taotermshell.c

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