# DAAppSetBeforeMonitor

Set a routine that will be called before the optimization on each grid.

## Synopsis

    #include "taodaapplication.h"
    int DAAppSetBeforeMonitor(TAO_APPLICATION daapplication, int (*beforemonitor)(TAO_APPLICATION,DA,int, void*), void *ctx)

Collective on TAO_APPLICATION

## Input Parameters

| daapplication | - the DA Application object
| beforemonitor | - a monitor routine called before solving the application on each DA
| ctx | - the monitor context

## Calling sequence of monitor

        beforemonitor(TAO_APPLICATION daapplication, DA da,int level, void *ctx);

| daapplication | - this TAO_APPLICATION context
| da | - the Distributed Array
| level | - the grid level that will be solved next (level 0 is coarsest)
| ctx | - user-defined function context set from DAAppSetBeforeMonitor()

## Note

These monitors are different from the monitors that can be called after each iteration of the optimization algorithm.

## Note

The beforemonitor and aftermonitor are good for setting up and destroying the application data.

## Keywords

DA, monitor

## See Also

DAAppSetAfterMonitor(), TaoSetMonitor(), TaoAppSetMonitor();

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

### Examples

src/petsctao/gridapplication/examples/eptorsion3.c.html

### Examples

src/petsctao/gridapplication/examples/jbearing3.c.html

### Examples

src/petsctao/gridapplication/examples/minsurf3.c.html

### Examples

src/petsctao/gridapplication/examples/combustion3.c.html