Changeset 6323 for issm/trunk/src/c/solutions/control_core.cpp
- Timestamp:
- 10/15/10 16:13:34 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/solutions/control_core.cpp
r6226 r6323 17 17 18 18 /*parameters: */ 19 int verbose=0;20 19 int num_controls; 21 20 int nsteps; … … 67 66 68 67 /*Launch once a complete solution to set up all inputs*/ 69 _printf_("%s\n","preparing initial solution");68 ISSMPRINTF(VerboseControl(),"%s\n"," preparing initial solution"); 70 69 if (isstokes) solutioncore(femmodel); 71 70 … … 81 80 82 81 /*Display info*/ 83 _printf_("\n%s%i%s%i\n"," control method step ",n+1,"/",nsteps);82 ISSMPRINTF(VerboseControl(),"\n%s%i%s%i\n"," control method step ",n+1,"/",nsteps); 84 83 InputUpdateFromConstantx(femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,(int)responses[n],CmResponseEnum); 85 84 … … 87 86 if (solution_type==SteadystateSolutionEnum) solutioncore(femmodel); 88 87 89 _printf_("%s\n","compute adjoint state:");88 ISSMPRINTF(VerboseControl(),"%s\n"," compute adjoint state:"); 90 89 adjointcore(femmodel); 91 90 92 _printf_("%s\n"," computing gradJ...");93 91 gradient_core(femmodel,n,search_scalar); 94 92 … … 99 97 } 100 98 101 _printf_("%s\n","optimizing along gradient direction");99 ISSMPRINTF(VerboseControl(),"%s\n"," optimizing along gradient direction"); 102 100 optargs.n=n; optpars.maxiter=(int)maxiter[n]; optpars.cm_jump=cm_jump[n]; 103 101 BrentSearch(&search_scalar,J+n,&optpars,&objectivefunctionC,&optargs); 104 102 //OptimalSearch(&search_scalar,J+n,&optpars,&objectivefunctionC,&optargs); 105 103 106 _printf_("%s\n"," updating parameter using optimized search scalar..."); //true means update save controls104 ISSMPRINTF(VerboseControl(),"%s\n"," updating parameter using optimized search scalar"); //true means update save controls 107 105 InputControlUpdatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,search_scalar,true); 108 106 … … 111 109 /*Temporary saving every 5 control steps: */ 112 110 if (((n+1)%5)==0){ 113 _printf_("%s\n"," saving temporary results...");111 ISSMPRINTF(VerboseControl(),"%s\n"," saving temporary results"); 114 112 controlrestart(femmodel,J); 115 113 } 116 114 } 117 115 118 _printf_("%s\n","preparing final solution");116 ISSMPRINTF(VerboseControl(),"%s\n"," preparing final solution"); 119 117 femmodel->parameters->SetParam(false,ControlAnalysisEnum); //needed to turn control result output in solutioncore 120 118 solutioncore(femmodel);
Note:
See TracChangeset
for help on using the changeset viewer.