Changeset 11289


Ignore:
Timestamp:
02/01/12 13:34:04 (13 years ago)
Author:
Mathieu Morlighem
Message:

Better way to set TAO parameters

File:
1 edited

Legend:

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

    r11283 r11289  
    3535        if(ierr) _error_("Could not initialize Tao");
    3636
    37         /*Line search options*/
    38         /*TAO options: http://www.mcs.anl.gov/research/projects/tao/docs/manualpages/solver/TaoSetFromOptions.html*/
    3937        info = PetscOptionsSetValue("-tao_monitor",""); if(info) _error_("STOP");
    40         info = PetscOptionsSetValue("-tao_max_its","20"); if(info) _error_("STOP");
    41         info = PetscOptionsSetValue("-tao_max_funcs","50"); if(info) _error_("STOP");
    4238
    4339        /*Initialize argument*/
     
    4844        info = TaoSetType(tao,"tao_blmvm"); if(info) _error_("STOP");
    4945        //info = TaoSetType(tao,"tao_cg"); if(info) _error_("STOP");
     46        TaoSetMaximumFunctionEvaluations(tao,10);
     47        TaoSetMaximumIterations(tao,3);
    5048
    5149        int size=femmodel->vertices->NumberOfVertices();
     
    9795        VecFree(&gradient);
    9896        CostFunctionx(fcn, femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials, femmodel->parameters);
     97        _printf_(true,"f(x)=%g\n",*fcn);
    9998        return 0;
    10099}
Note: See TracChangeset for help on using the changeset viewer.