# DAAppSetConstraintRoutine

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

## Synopsis

    #include "taodaapplication.h"
    int DAAppSetConstraintRoutine(TAO_APPLICATION daapplication, int (*f)(TAO_APPLICATION,DA,Vec,Vec, void*),void *ctx)

Collective on TAO_APPLICATION

## Input Parameters

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

## Calling sequence of grad

        f(TAO_APPLICATION daapplication,DA da, Vec x,Vec r,void *ctx);

| daapplication | - the DA_APPLICATION context
| da | - the Distributed Array
| x | - input vector
| r | - constraint vector
| ctx | - user defined gradient context set from DAAppSetGradientRoutine()

## Options Database Key

-tao_view -view the gradient after each evaluation using PETSC_VIEWER_STDOUT_SELF

## Keywords

DA, gradient

## See Also

DAAppSetJacobianRoutine();

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