Changeset 1845


Ignore:
Timestamp:
08/24/09 18:02:57 (15 years ago)
Author:
Eric.Larour
Message:

Brachning back from issm.controlstatic, by hand

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/solutions/cielo/control_core.m

    r1652 r1845  
    77
    88%Preprocess models
    9 [inputs model]=ControlInitialization(models,inputs);
     9[inputs models]=ControlInitialization(models,inputs);
     10
     11%recover active model.
     12model=models.active;
    1013
    1114%recover parameters common to all solutions
    1215debug=model.parameters.debug;
     16dim=model.parameters.dim;
     17isstokes=model.parameters.isstokes;
    1318
    1419%initialize control parameters
     
    3338
    3439        displaystring(debug,'\n%s',['      computing gradJ...']);
    35         [u_g c(n).grad_g]=GradJCompute(model,inputs,model.parameters.analysis_type,model.parameters.sub_analysis_type);
    36         inputs=add(inputs,'velocity',u_g,'doublevec',2,model.parameters.numberofnodes);
     40        results_grad=gradjcompute_core(models,inputs);
     41        u_g=results_grad.u_g; c(n).grad_g=results_grad.grad_g;
     42        if dim==3,
     43                if isstokes,
     44                        inputs=add(inputs,'velocity',u_g,'doublevec',3,model.parameters.numberofnodes);
     45                else
     46                        inputs=add(inputs,'velocity',u_g,'doublevec',3,model.parameters.numberofnodes);
     47                end
     48        else
     49                inputs=add(inputs,'velocity',u_g,'doublevec',2,model.parameters.numberofnodes);
     50        end
    3751
    3852        displaystring(debug,'\n%s',['      normalizing directions...']);
     
    4963
    5064        displaystring(debug,'\n%s',['      optimizing along gradient direction...']);
    51         [search_scalar c(n).J]=ControlOptimization('objectivefunctionC',0,1,options,model,inputs,param_g,c(n).grad_g,n,model.parameters.analysis_type,model.parameters.sub_analysis_type);
     65        [search_scalar c(n).J]=ControlOptimization('objectivefunctionC',0,1,options,models,inputs,param_g,c(n).grad_g,n,model.parameters.analysis_type,model.parameters.sub_analysis_type);
    5266
    5367        displaystring(debug,'\n%s',['      updating parameter using optimized search scalar...']);
Note: See TracChangeset for help on using the changeset viewer.