Changeset 694
- Timestamp:
- 06/02/09 08:25:14 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/parallel/ProcessResults.cpp
r693 r694 40 40 FemModel* fem_sl=NULL; 41 41 42 /*fem thermal models: */ 43 FemModel* fem_t=NULL; 44 42 45 /*fem prognostic models: */ 43 46 FemModel* fem_p=NULL; 44 47 48 /*some parameters*/ 45 49 int ishutter; 46 50 int ismacayealpattyn; … … 66 70 double* thickness=NULL; 67 71 72 Vec t_g=NULL; 73 double* t_g_serial=NULL; 74 double* temperature=NULL; 75 76 Vec m_g=NULL; 77 double* m_g_serial=NULL; 78 double* melting=NULL; 79 68 80 int numberofnodes; 69 81 … … 92 104 if(analysis_type==PrognosticAnalysisEnum()){ 93 105 fem_p=fems+0; 106 } 107 108 if(analysis_type==ThermalAnalysisEnum()){ 109 fem_t=fems+0; 94 110 } 95 111 … … 229 245 } 230 246 247 else if(strcmp(result->GetFieldName(),"t_g")==0){ 248 /*easy, t_g is of size numberofnodes, on 1 dof, just repartition: */ 249 result->GetField(&t_g); 250 VecToMPISerial(&t_g_serial,t_g); 251 fem_t->parameters->FindParam((void*)&numberofnodes,"numberofnodes"); 252 VecToMPISerial(&partition,fem_t->partition); 253 254 temperature=(double*)xmalloc(numberofnodes*sizeof(double)); 255 256 for(i=0;i<numberofnodes;i++){ 257 temperature[i]=t_g_serial[(int)partition[i]]; 258 } 259 260 /*Ok, add pressure to newresults: */ 261 newresult=new Result(newresults->Size()+1,result->GetTime(),result->GetStep(),"temperature",temperature,numberofnodes); 262 newresults->AddObject(newresult); 263 264 /*do some cleanup: */ 265 xfree((void**)&t_g_serial); 266 xfree((void**)&partition); 267 } 268 269 else if(strcmp(result->GetFieldName(),"m_g")==0){ 270 /*easy, m_g is of size numberofnodes, on 1 dof, just repartition: */ 271 result->GetField(&m_g); 272 VecToMPISerial(&m_g_serial,m_g); 273 fem_t->parameters->FindParam((void*)&numberofnodes,"numberofnodes"); 274 VecToMPISerial(&partition,fem_t->partition); 275 276 melting=(double*)xmalloc(numberofnodes*sizeof(double)); 277 278 for(i=0;i<numberofnodes;i++){ 279 melting[i]=m_g_serial[(int)partition[i]]; 280 } 281 282 /*Ok, add pressure to newresults: */ 283 newresult=new Result(newresults->Size()+1,result->GetTime(),result->GetStep(),"melting",melting,numberofnodes); 284 newresults->AddObject(newresult); 285 286 /*do some cleanup: */ 287 xfree((void**)&m_g_serial); 288 xfree((void**)&partition); 289 } 290 231 291 else if(strcmp(result->GetFieldName(),"h_g")==0){ 232 292 /*easy, h_g is of size numberofnodes, on 1 dof, just repartition: */
Note:
See TracChangeset
for help on using the changeset viewer.