Changeset 11510


Ignore:
Timestamp:
02/23/12 12:48:53 (13 years ago)
Author:
Mathieu Morlighem
Message:

Forgot to commit the module:

Location:
issm/trunk-jpl/src/c
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/solutions/controltao_core.cpp

    r11359 r11510  
    1818/*Local prototype*/
    1919int FormFunctionGradient(TaoSolver tao,Vec,double*,Vec,void*);
     20int IssmMonitor(TaoSolver,void *);
    2021typedef struct {
    2122        FemModel* femmodel;
     
    5354        _printf_(VerboseControl(),"%s\n","   Initializing the Toolkit for Advanced Optimization (TAO)");
    5455        TaoCreate(PETSC_COMM_WORLD,&tao);
    55         PetscOptionsSetValue("-tao_monitor","");
    5656        TaoSetFromOptions(tao);
    5757        TaoSetType(tao,"tao_blmvm");
     
    6060
    6161        /*Prepare all TAO parameters*/
     62        TaoSetMonitor(tao,IssmMonitor,NULL,NULL);
    6263        TaoSetMaximumFunctionEvaluations(tao,maxiter);
    6364        TaoSetMaximumIterations(tao,nsteps);
     
    143144        return 0;
    144145}
     146int IssmMonitor(TaoSolver tao, void *userCtx){
     147
     148        AppCtx *user = (AppCtx *)userCtx;
     149        int     its;
     150        double  f,gnorm,cnorm,xdiff;
     151
     152        TaoGetSolutionStatus(tao, &its, &f, &gnorm, &cnorm, &xdiff, NULL);
     153        printf("Iteration %3i: Function value: %12.7g, Residual: %g\n",its,f,gnorm);
     154        return 0;
     155}
    145156
    146157#else
Note: See TracChangeset for help on using the changeset viewer.