Changeset 1824
- Timestamp:
- 08/24/09 17:45:33 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/parallel/control.cpp
r1708 r1824 27 27 28 28 /*Fem models : */ 29 FemModel femmodels[5];29 Model* model=NULL; 30 30 31 31 /*Results: */ … … 62 62 fid=pfopen(inputfilename,"rb"); 63 63 64 /*Initialize model structure: */ 65 model=new Model(); 66 64 67 _printf_("read and create finite element model:\n"); 65 68 _printf_("\n reading control horiz model data:\n"); 66 CreateFemModel( &femmodels[0],fid,ControlAnalysisEnum(),HorizAnalysisEnum());69 CreateFemModel(model->DiagnosticHorizontal(),fid,ControlAnalysisEnum(),HorizAnalysisEnum()); 67 70 _printf_("\n reading control vert model data:\n"); 68 CreateFemModel( &femmodels[1],fid,ControlAnalysisEnum(),VertAnalysisEnum());71 CreateFemModel(model->DiagnosticVertical(),fid,ControlAnalysisEnum(),VertAnalysisEnum()); 69 72 _printf_("\n reading control stokes model data:\n"); 70 CreateFemModel( &femmodels[2],fid,ControlAnalysisEnum(),StokesAnalysisEnum());73 CreateFemModel(model->DiagnosticStokes(),fid,ControlAnalysisEnum(),StokesAnalysisEnum()); 71 74 _printf_("\n reading control hutter model data:\n"); 72 CreateFemModel( &femmodels[3],fid,ControlAnalysisEnum(),HutterAnalysisEnum());75 CreateFemModel(model->DiagnosticHutter(),fid,ControlAnalysisEnum(),HutterAnalysisEnum()); 73 76 _printf_("\n reading surface and bed slope computation model data:\n"); 74 CreateFemModel( &femmodels[4],fid,SlopeComputeAnalysisEnum(),NoneAnalysisEnum());77 CreateFemModel(model->Slope(),fid,SlopeComputeAnalysisEnum(),NoneAnalysisEnum()); 75 78 76 79 _printf_("initialize inputs:\n"); 77 femmodels[0].parameters->FindParam((void*)&u_g_initial,"u_g");78 femmodels[0].parameters->FindParam((void*)&u_g_obs,"u_g_obs");79 femmodels[0].parameters->FindParam((void*)&numberofnodes,"numberofnodes");80 model->DiagnosticHorizontal()->parameters->FindParam((void*)&u_g_initial,"u_g"); 81 model->DiagnosticHorizontal()->parameters->FindParam((void*)&u_g_obs,"u_g_obs"); 82 model->DiagnosticHorizontal()->parameters->FindParam((void*)&numberofnodes,"numberofnodes"); 80 83 81 84 inputs=new ParameterInputs; … … 85 88 86 89 /*erase velocities: */ 87 param=(Param*) femmodels[0].parameters->FindParamObject("u_g");88 femmodels[0].parameters->DeleteObject((Object*)param);90 param=(Param*)model->DiagnosticHorizontal()->parameters->FindParamObject("u_g"); 91 model->DiagnosticHorizontal()->parameters->DeleteObject((Object*)param); 89 92 90 param=(Param*) femmodels[0].parameters->FindParamObject("u_g_obs");91 femmodels[0].parameters->DeleteObject((Object*)param);93 param=(Param*)model->DiagnosticHorizontal()->parameters->FindParamObject("u_g_obs"); 94 model->DiagnosticHorizontal()->parameters->DeleteObject((Object*)param); 92 95 93 96 _printf_("initialize results:\n"); … … 95 98 96 99 //Add output file name to parameters of femmodels[0] 97 count= femmodels[0].parameters->Size()+1;100 count=model->DiagnosticHorizontal()->parameters->Size()+1; 98 101 param= new Param(count,"outputfilename",STRING); 99 102 param->SetString(outputfilename); 100 femmodels[0].parameters->AddObject(param);103 model->DiagnosticHorizontal()->parameters->AddObject(param); 101 104 102 105 /*are we running the solution sequence, or a qmu wrapper around it? : */ 103 femmodels[0].parameters->FindParam((void*)&qmu_analysis,"qmu_analysis"); 106 model->DiagnosticHorizontal()->parameters->FindParam((void*)&qmu_analysis,"qmu_analysis"); 107 104 108 if(!qmu_analysis){ 105 109 106 110 /*run control analysis: */ 107 111 _printf_("call computational core:\n"); 108 control_core(results, femmodels,inputs);112 control_core(results,model,inputs); 109 113 110 114 } … … 114 118 115 119 #ifdef _HAVE_DAKOTA_ 116 Qmux( &femmodels[0],inputs,DiagnosticAnalysisEnum(),NoneAnalysisEnum());120 Qmux(model,inputs,DiagnosticAnalysisEnum(),NoneAnalysisEnum()); 117 121 #else 118 122 throw ErrorException(__FUNCT__," Dakota not present, cannot do qmu!"); … … 124 128 results->AddObject(result); 125 129 126 femmodels[0].parameters->FindParam((void*)&control_type,"control_type");130 model->DiagnosticHorizontal()->parameters->FindParam((void*)&control_type,"control_type"); 127 131 result=new Result(results->Size()+1,0,1,"control_type",control_type); 128 132 results->AddObject(result); 129 133 130 134 _printf_("process results:\n"); 131 ProcessResults(&results, &femmodels[0],ControlAnalysisEnum());135 ProcessResults(&results,model,ControlAnalysisEnum()); 132 136 133 137 _printf_("write results to disk:\n"); … … 135 139 136 140 _printf_("write lock file:\n"); 137 femmodels[0].parameters->FindParam((void*)&waitonlock,"waitonlock");141 model->DiagnosticHorizontal()->parameters->FindParam((void*)&waitonlock,"waitonlock"); 138 142 if (waitonlock){ 139 143 WriteLockFile(lockname);
Note:
See TracChangeset
for help on using the changeset viewer.