int DAAppSetADElementFunctionGradient2(TAO_APPLICATION daapplication,
int (*funcgrad)(int[2],DERIV_TYPE[16],DERIV_TYPE*,void*),
int flops, void *ctx)
Collective on TAO_APPLICATION
| daapp | - the TAO_DA_APPLICATION solver context | |
| funcgrad | - local function gradient routine | |
| flops | - the number of flops done performed in the funcgrad routine | |
| fgctx | - [optional] user-defined context for private data for the evaluation. |
int funcgrad(int coordinates[2], DERIV_TYPE x[16], DERIV_TYPE *f, void* ctx)
| coord | - the global coordinates [i j] in each direction of the DA | |
| x | - the variables on the DA ( da[j][i], da[j][j+1], da[j+1][i], da[j+1][i+1] ) (bottom left, bottom right, top left, top right) | |
| g | - the ADIC differentiated objective function with respect to each variable | |
| ctx | - user defined context |
Calling sequence of func before calling ADIC
int func(int coordinates[2], double x[16], double *f, void* ctx)
| coord | - the global coordinates [i j] in each direction of the DA | |
| x | - the variables on the DA ( da[j][i], da[j][j+1], da[j+1][i], da[j+1][i+1] ) (bottom left, bottom right, top left, top right) | |
| f | - the objective function | |
| ctx | - user defined context |
Note: This function requires ADIC to be installed and the ADIC-specific variables to be set in $TAO_DIR/bmake/packages.$PETSC_ARCH
Concepts: DA, gradient, ADIC
Level:intermediate
Location:src/petsctao/gridapplication/daadic/adelement2.c
TAO DA Application Index
Table of Contents