Changeset 11510
- Timestamp:
- 02/23/12 12:48:53 (13 years ago)
- 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 18 18 /*Local prototype*/ 19 19 int FormFunctionGradient(TaoSolver tao,Vec,double*,Vec,void*); 20 int IssmMonitor(TaoSolver,void *); 20 21 typedef struct { 21 22 FemModel* femmodel; … … 53 54 _printf_(VerboseControl(),"%s\n"," Initializing the Toolkit for Advanced Optimization (TAO)"); 54 55 TaoCreate(PETSC_COMM_WORLD,&tao); 55 PetscOptionsSetValue("-tao_monitor","");56 56 TaoSetFromOptions(tao); 57 57 TaoSetType(tao,"tao_blmvm"); … … 60 60 61 61 /*Prepare all TAO parameters*/ 62 TaoSetMonitor(tao,IssmMonitor,NULL,NULL); 62 63 TaoSetMaximumFunctionEvaluations(tao,maxiter); 63 64 TaoSetMaximumIterations(tao,nsteps); … … 143 144 return 0; 144 145 } 146 int 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 } 145 156 146 157 #else
Note:
See TracChangeset
for help on using the changeset viewer.