Actual source code: daapp_impl.h

      1: #ifndef PETSCDAAPPIMPL_H
      2: #define PETSCDAAPPIMPL_H

      4: #include "petscmat.h"
      5: #include "petscda.h"
     6:  #include dagridctx.h

      8: typedef struct _p_DA_APPLICATION* DA_APPLICATION;
      9: typedef struct _p_TAOAPPLICATION* TAO_APPLICATION;

     12: #define PETSCDAAPPMAXGRIDS 20
     13: #define MAX_DAAP_MONITORS 10

     15: struct _p_DA_APPLICATION {

     17:   PETSCHEADER(int);

     19:   GridCtx grid[PETSCDAAPPMAXGRIDS];

     21:   int ndamax;        /* Max number of levels */
     22:   int nda;           /* Number of levels in current application */
     23:   int currentlevel;  /* The current level being solved */

     25:   PetscTruth IsComplementarity;
     26:   MatStructure kspflag;
     27:   char HessianMatrixType[20];
     28:
     29:   /* Function Gradient Evaluation over entire DA */
     30:   int  (*computedafunction)(TAO_APPLICATION,DA,Vec,double*,void*);
     31:   int  (*computedagradient)(TAO_APPLICATION,DA,Vec,Vec,void*);
     32:   int  (*computedafunctiongradient)(TAO_APPLICATION,DA,Vec,double*,Vec,void*);
     33:   void *usrdafctx;
     34:   void *usrdagctx;
     35:   void *usrdafgctx;

     37:   /* Hessian Evaluation over entire DA */
     38:   int  (*computedahessian)(TAO_APPLICATION,DA,Vec,Mat,void*);
     39:   void *usrdahctx;

     41:   /* Evaluate bounds over entire DA */
     42:   void* bounddactx;
     43:   int  (*computedabounds)(TAO_APPLICATION,DA,Vec,Vec,void*);

     45:   /* User monitors before and after each Optimization Solve */
     46:   int   nbeforemonitors;
     47:   void *beforemonitorctx[MAX_DAAP_MONITORS];
     48:   int  (*beforemonitor[MAX_DAAP_MONITORS])(TAO_APPLICATION,DA,int,void*);

     50:   int   naftermonitors;
     51:   void *aftermonitorctx[MAX_DAAP_MONITORS];
     52:   int  (*aftermonitor[MAX_DAAP_MONITORS])(TAO_APPLICATION,DA,int,void*);

     54: };

     56: //#include "taodaapplication.h"

     58: #endif