DAAppSetGradientRoutine

Set a routine that will evaluate the gradient function on the given DA at the given point.

Synopsis

#include "taodaapplication.h" 
int DAAppSetGradientRoutine(TAO_APPLICATION daapplication, int (*grad)(TAO_APPLICATION,DA,Vec,Vec, void*),void *ctx)
Collective on TAO_APPLICATION

Input Parameters

daapplication - the DA Application object
grad - the function pointer for the gradient evaluation routine
ctx - the gradient context

Calling sequence of grad

    grad(TAO_APPLICATION daapplication,DA da, Vec x,Vec g,void *ctx);

daapplication - the TAO_APPLICATION context
da - the Distributed Array
x - input vector
g - gradient vector
ctx - user defined gradient context set from DAAppSetGradientRoutine()

Options Database Key

-tao_view_gradient -view the gradient after each evaluation using PETSC_VIEWER_STDOUT_SELF

Keywords

DA, gradient

See Also

DAAppSetObjectiveRoutine(), DAAppSetObjectiveAndGradientRoutine();

Level:intermediate
Location:src/petsctao/gridapplication/interface/daapp.c
TAO DA Application Index
Table of Contents