Changeset 1997
- Timestamp:
- 08/27/09 07:51:42 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/parallel/steadystate.cpp
r1901 r1997 25 25 int numberofnodes; 26 26 int qmu_analysis=0; 27 int control_analysis=0; 28 char* control_type=NULL; 27 29 28 30 /*Model: */ … … 38 40 double* u_g_initial=NULL; 39 41 double* p_g_initial=NULL; 42 double* u_g_obs=NULL; 40 43 double dt; 41 44 Param* param=NULL; … … 91 94 /*recover parameters: */ 92 95 model->FindParam(&waitonlock,"waitonlock"); 96 model->FindParam(&control_analysis,"control_analysis"); 93 97 model->FindParam(&qmu_analysis,"qmu_analysis"); 94 98 … … 104 108 inputs->Add("pressure",p_g_initial,1,numberofnodes); 105 109 inputs->Add("dt",dt); 110 if(control_analysis){ 111 inputs->Add("velocity_obs",u_g_obs,2,numberofnodes); 112 } 106 113 107 114 _printf_("initialize results:\n"); … … 111 118 if(!qmu_analysis){ 112 119 113 /*run diagnostic analysis: */ 114 _printf_("call computational core:\n"); 115 steadystate_core(results,model,inputs); 116 120 if(!control_analysis){ 121 /*run diagnostic analysis: */ 122 _printf_("call computational core:\n"); 123 steadystate_core(results,model,inputs); 124 } 125 else{ 126 /*run control analysis: */ 127 _printf_("call computational core:\n"); 128 control_core(results,model,inputs); 129 } 117 130 } 118 131 else{ … … 127 140 } 128 141 129 /*Add analysis_type to results: */ 130 result=new Result(results->Size()+1,0,1,"analysis_type","steadystate"); 131 results->AddObject(result); 142 if(!control_analysis){ 143 /*Add analysis_type to results: */ 144 result=new Result(results->Size()+1,0,1,"analysis_type","steadystate"); 145 results->AddObject(result); 132 146 133 _printf_("process results:\n"); 134 ProcessResults(&results,model,SteadystateAnalysisEnum()); 147 _printf_("process results:\n"); 148 ProcessResults(&results,model,SteadystateAnalysisEnum()); 149 } 150 else{ 151 /*Add analysis_type and control_type to results: */ 152 result=new Result(results->Size()+1,0,1,"analysis_type","steadystate"); 153 results->AddObject(result); 154 155 model->FindParam(&control_type,"control_type"); 156 result=new Result(results->Size()+1,0,1,"control_type",control_type); 157 results->AddObject(result); 158 159 _printf_("process results:\n"); 160 ProcessResults(&results,model,ControlAnalysisEnum()); 161 } 135 162 136 163 _printf_("write results to disk:\n");
Note:
See TracChangeset
for help on using the changeset viewer.