Changeset 2223
- Timestamp:
- 09/11/09 16:50:20 (16 years ago)
- Location:
- issm/trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Pengrid.cpp
r2212 r2223 60 60 printf(" matpar_offset=%i\n",matpar_offset); 61 61 62 if(node)node->Echo();63 if(matpar)matpar->Echo();64 62 return; 65 63 } … … 560 558 int dofs1[1]={0}; 561 559 int unstable=0; 560 int reset_penalties=0; 562 561 563 562 ParameterInputs* inputs=NULL; … … 579 578 found=inputs->Recover("temperature",&temperature,1,dofs1,numgrids,(void**)&node); 580 579 if(!found)throw ErrorException(__FUNCT__," could not find temperature in inputs!"); 581 580 581 found=inputs->Recover("reset_penalties",&reset_penalties); 582 583 if(reset_penalties)zigzag_counter=0; 582 584 583 585 //Compute pressure melting point … … 608 610 /*If penalty keeps zigzagging more than 5 times: */ 609 611 if(stabilize_constraints){ 610 if(zigzag_counter> 5){612 if(zigzag_counter>stabilize_constraints){ 611 613 unstable=0; 612 614 active=1; -
issm/trunk/src/c/parallel/control_core.cpp
r2220 r2223 94 94 inputs->Add("fit",fit[n]); 95 95 96 /*Update parameters: */97 UpdateFromInputsx(fem_model->elements,fem_model->nodes,fem_model->loads, fem_model->materials,inputs);98 99 _printf_("%s\n"," computing gradJ...");100 gradjcompute_results=new DataSet(ResultsEnum());101 gradjcompute_core(gradjcompute_results,model, inputs);102 gradjcompute_results->FindResult(&grad_g,"grad_g");103 delete gradjcompute_results;104 _printf_("%s\n"," done.");105 106 _printf_("%s\n"," normalizing directions...");107 Orthx(&new_grad_g,grad_g,grad_g_old);108 VecFree(&grad_g); VecFree(&grad_g_old);109 grad_g_old=new_grad_g;110 VecToMPISerial(&grad_g_double,new_grad_g);111 _printf_("%s\n"," done.");112 113 _printf_("%s\n"," optimizing along gradient direction...");114 optargs.model=model;115 optargs.param_g=param_g; optargs.grad_g=grad_g_double; optargs.inputs=inputs;optargs.n=n;116 optpars.xmin=0; optpars.xmax=1; optpars.tolerance=tolx; optpars.maxiter=(int)maxiter[n];optpars.cmjump=cmjump[n];117 BrentSearch(&search_scalar,J+n,&optpars,&objectivefunctionC,&optargs);118 _printf_("%s\n"," done.");119 120 _printf_("%s\n"," updating parameter using optimized search scalar...");121 for(i=0;i<numberofnodes;i++)param_g[i]=param_g[i]+search_scalar*optscal[n]*grad_g_double[i];122 _printf_("%s\n"," done.");123 124 _printf_("%s\n"," constraining the new distribution...");125 ControlConstrainx(param_g,numberofnodes,mincontrolconstraint,maxcontrolconstraint,control_type);126 _printf_("%s\n"," done.");127 128 96 /*In case we are running a steady state control method, compute new temperature field using new parameter 129 97 * distribution: */ … … 133 101 delete steadystate_results; 134 102 inputs->Add("temperature",t_g,1,numberofnodes); 135 103 104 /*Update parameters: */ 105 UpdateFromInputsx(fem_model->elements,fem_model->nodes,fem_model->loads, fem_model->materials,inputs); 106 107 _printf_("%s\n"," computing gradJ..."); 108 gradjcompute_results=new DataSet(ResultsEnum()); 109 gradjcompute_core(gradjcompute_results,model, inputs); 110 gradjcompute_results->FindResult(&grad_g,"grad_g"); 111 delete gradjcompute_results; 112 _printf_("%s\n"," done."); 113 114 _printf_("%s\n"," normalizing directions..."); 115 Orthx(&new_grad_g,grad_g,grad_g_old); 116 VecFree(&grad_g); VecFree(&grad_g_old); 117 grad_g_old=new_grad_g; 118 VecToMPISerial(&grad_g_double,new_grad_g); 119 _printf_("%s\n"," done."); 120 121 _printf_("%s\n"," optimizing along gradient direction..."); 122 optargs.model=model; 123 optargs.param_g=param_g; optargs.grad_g=grad_g_double; optargs.inputs=inputs;optargs.n=n; 124 optpars.xmin=0; optpars.xmax=1; optpars.tolerance=tolx; optpars.maxiter=(int)maxiter[n];optpars.cmjump=cmjump[n]; 125 BrentSearch(&search_scalar,J+n,&optpars,&objectivefunctionC,&optargs); 126 _printf_("%s\n"," done."); 127 128 _printf_("%s\n"," updating parameter using optimized search scalar..."); 129 for(i=0;i<numberofnodes;i++)param_g[i]=param_g[i]+search_scalar*optscal[n]*grad_g_double[i]; 130 _printf_("%s\n"," done."); 131 132 _printf_("%s\n"," constraining the new distribution..."); 133 ControlConstrainx(param_g,numberofnodes,mincontrolconstraint,maxcontrolconstraint,control_type); 134 _printf_("%s\n"," done."); 135 136 137 136 138 _printf_("%s%i%s%g\n"," value of misfit J after optimization #",n+1,": ",J[n]); 137 139 -
issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp
r2008 r2223 58 58 59 59 if(debug)_printf_("%s\n","starting direct shooting method"); 60 61 if(count==1) inputs->Add("reset_penalties",1); 62 else inputs->Add("reset_penalties",0); 60 63 61 64 /*Update parameters: */ -
issm/trunk/src/m/solutions/cielo/control_core.m
r2221 r2223 33 33 34 34 disp(sprintf('\n%s%s%s%s\n',[' control method step ' num2str(n) '/' num2str(model.parameters.nsteps)])); 35 36 %In case we are running a steady state control method, compute new temperature field using new parameter distribution: 37 if model.parameters.control_steady; 38 steadystate_results=steadystate_core(models,inputs); t_g=results.t_g; 39 inputs=add(inputs,'temperature',t_g,'doublevec',1,model.parameters.numberofnodes); 40 end 35 41 36 42 %update inputs with new fit … … 75 81 param_g=ControlConstrain(param_g,model.parameters); 76 82 77 %In case we are running a steady state control method, compute new temperature field using new parameter distribution: 78 if model.parameters.control_steady; 79 steadystate_results=steadystate_core(models,inputs); t_g=results.t_g; 80 inputs=add(inputs,'temperature',t_g,'doublevec',1,model.parameters.numberofnodes); 81 end 82 83 83 84 disp([' value of misfit J after optimization #' num2str(n) ':' num2str(c(n).J)]); 84 85 -
issm/trunk/test/Verification/PigControlMethodDragP3d_22/Pig.par
r2197 r2223 52 52 md.maxiter=10*ones(md.nsteps,1); 53 53 md.cmjump=0.3*ones(md.nsteps,1); 54 md.debug=0; 55 md.stabilize_constraints=5; -
issm/trunk/test/Verification/PigControlMethodDragP3d_22/configuration.m
r2202 r2223 26 26 {'diagnostic', 'none', 0 , 1, 'relative', 1 };... 27 27 {'diagnostic', 'none', 0 , 1, 'logarithmic', 1 };... 28 {'steadystate', 'none', 0 , 1, 'absolute', 1 };... 28 29 };
Note:
See TracChangeset
for help on using the changeset viewer.