Changeset 2892
- Timestamp:
- 01/22/10 07:26:54 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Makefile.am
r2865 r2892 308 308 ./ProcessParamsx/ProcessParamsx.cpp\ 309 309 ./ProcessParamsx/ProcessParamsx.h\ 310 ./PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.cpp\ 311 ./PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.h\ 310 312 ./Qmux/Qmux.h\ 311 313 ./Qmux/Qmux.cpp\ -
issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp
r2383 r2892 20 20 Param* param = NULL; 21 21 int count; 22 int analysis_type;23 int numberofdofspernode;24 22 25 23 double* fit=NULL; … … 140 138 param= new Param(count,"cm_max",DOUBLE); 141 139 param->SetDouble(iomodel->cm_max); 140 parameters->AddObject(param); 141 142 /*cm_gradient: */ 143 count++; 144 param= new Param(count,"cm_gradient",DOUBLE); 145 param->SetDouble(iomodel->cm_gradient); 142 146 parameters->AddObject(param); 143 147 -
issm/trunk/src/c/ModelProcessorx/IoModel.cpp
r2383 r2892 125 125 iomodel->cm_min=0; 126 126 iomodel->cm_max=0; 127 iomodel->cm_gradient=0; 127 128 iomodel->verbose=0; 128 129 iomodel->plot=0; … … 353 354 IoModelFetchData(&iomodel->cm_min,iomodel_handle,"cm_min"); 354 355 IoModelFetchData(&iomodel->cm_max,iomodel_handle,"cm_max"); 356 IoModelFetchData(&iomodel->cm_gradient,iomodel_handle,"cm_gradient"); 355 357 IoModelFetchData(&iomodel->eps_res,iomodel_handle,"eps_res"); 356 358 IoModelFetchData(&iomodel->eps_rel,iomodel_handle,"eps_rel"); -
issm/trunk/src/c/ModelProcessorx/IoModel.h
r2722 r2892 117 117 double cm_min; 118 118 double cm_max; 119 int cm_gradient;; 119 120 120 121 double cm_noisedampening; -
issm/trunk/src/c/issm.h
r2776 r2892 49 49 #include "./PenaltyConstraintsx/PenaltyConstraintsx.h" 50 50 #include "./ProcessParamsx/ProcessParamsx.h" 51 #include "./PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.h" 51 52 #include "./Gradjx/Gradjx.h" 52 53 #include "./Orthx/Orthx.h" -
issm/trunk/src/c/parallel/ProcessResults.cpp
r2722 r2892 90 90 double* m_g_serial=NULL; 91 91 double* melting=NULL; 92 93 Vec grad_g=NULL; 94 double* grad_g_serial=NULL; 95 double* gradient=NULL; 92 96 93 97 Vec v_g=NULL; … … 286 290 VecFree(&t_g); 287 291 } 292 else if(strcmp(result->GetFieldName(),"grad_g")==0){ 293 294 /*easy, grad_g is of size numberofnodes, on 1 dof, just repartition: */ 295 result->GetField(&grad_g); 296 VecToMPISerial(&grad_g_serial,grad_g); 297 fem_c->parameters->FindParam(&numberofnodes,"numberofnodes"); 298 VecToMPISerial(&partition,fem_c->partition->vector); 299 300 gradient=(double*)xmalloc(numberofnodes*sizeof(double)); 301 302 for(i=0;i<numberofnodes;i++){ 303 gradient[i]=grad_g_serial[(int)partition[i]]; 304 } 305 306 /*Ok, add gradient to newresults: */ 307 newresult=new Result(newresults->Size()+1,result->GetTime(),result->GetStep(),"gradient",gradient,numberofnodes); 308 newresults->AddObject(newresult); 309 310 /*do some cleanup: */ 311 xfree((void**)&grad_g_serial); 312 xfree((void**)&partition); 313 xfree((void**)&gradient); 314 VecFree(&grad_g); 315 } 288 316 else if(strcmp(result->GetFieldName(),"m_g")==0){ 289 317 /*easy, m_g is of size numberofnodes, on 1 dof, just repartition: */ -
issm/trunk/src/c/parallel/control_core.cpp
r2773 r2892 42 42 double cm_min; 43 43 double cm_max; 44 int cm_gradient; 44 45 int nsteps,n,i; 45 46 double* J=NULL; … … 71 72 model->FindParam(&cm_min,"cm_min"); 72 73 model->FindParam(&cm_max,"cm_max"); 74 model->FindParam(&cm_gradient,"cm_gradient"); 73 75 model->FindParam(¶m_g,NULL,NULL,"param_g"); 74 76 model->FindParam(&analysis_type,"analysis_type"); … … 113 115 gradjcompute_results->FindResult(&grad_g,"grad_g"); 114 116 delete gradjcompute_results; 117 118 /*Return gradient if asked: */ 119 if (cm_gradient){ 120 121 /*Plug results into output dataset: */ 122 result=new Result(results->Size()+1,0,1,"grad_g",grad_g); 123 results->AddObject(result); 124 125 /*Free ressources: */ 126 xfree((void**)&control_type); 127 xfree((void**)&fit); 128 xfree((void**)&optscal); 129 xfree((void**)&maxiter); 130 xfree((void**)&cm_jump); 131 xfree((void**)&grad_g_double); 132 xfree((void**)¶m_g); 133 VecFree(&u_g); 134 VecFree(&t_g); 135 VecFree(&m_g); 136 xfree((void**)&J); 137 return; 138 } 115 139 116 140 /*Normalize if last gradient not satisfying (search_scalar==0)*/ -
issm/trunk/src/m/classes/@model/model.m
r2547 r2892 198 198 md.fit=[]; 199 199 md.cm_jump=[]; 200 md.cm_gradient=0; 200 201 md.epsvel=0; 201 202 md.meanvel=0; -
issm/trunk/src/m/classes/@model/setdefaultparameters.m
r2547 r2892 204 204 md.cm_max=200; 205 205 206 %stop control solution at the gradient computation and return it? 207 md.cm_gradient=0; 208 206 209 %eps_cm is a criteria to stop the control methods. 207 210 %if J[n]-J[n-1]/J[n] < criteria, the control run stops -
issm/trunk/src/mex/Makefile.am
r2775 r2892 37 37 PenaltySystemMatrices\ 38 38 ProcessParams\ 39 PropagateFlagsFromConnectivity\ 39 40 Qmu\ 40 41 Reduceloadfromgtof\ … … 178 179 ProcessParams/ProcessParams.h 179 180 181 PropagateFlagsFromConnectivity_SOURCES = PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp\ 182 PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.h 183 180 184 Qmu_SOURCES = Qmu/Qmu.cpp\ 181 185 Qmu/Qmu.h
Note:
See TracChangeset
for help on using the changeset viewer.