Changeset 853
- Timestamp:
- 06/08/09 16:47:31 (15 years ago)
- Location:
- issm/trunk/src/c/parallel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/parallel/ProcessResults.cpp
r758 r853 71 71 double* parameter=NULL; 72 72 73 Vec s_g=NULL; 74 double* s_g_serial=NULL; 75 double* surface=NULL; 76 77 Vec b_g=NULL; 78 double* b_g_serial=NULL; 79 double* bed=NULL; 80 73 81 Vec h_g=NULL; 74 82 double* h_g_serial=NULL; … … 107 115 } 108 116 117 if(analysis_type==TransientAnalysisEnum()){ 118 119 fem_dh=fems+0; 120 fem_dv=fems+1; 121 fem_ds=fems+2; 122 fem_dhu=fems+3; 123 fem_sl=fems+4; 124 fem_p=fems+5; 125 126 /*some flags needed: */ 127 fem_dh->parameters->FindParam((void*)&dim,"dim"); 128 fem_dhu->parameters->FindParam((void*)&ishutter,"ishutter"); 129 fem_ds->parameters->FindParam((void*)&isstokes,"isstokes"); 130 fem_dh->parameters->FindParam((void*)&ismacayealpattyn,"ismacayealpattyn"); 131 } 132 109 133 if(analysis_type==PrognosticAnalysisEnum()){ 110 134 fem_p=fems+0; … … 121 145 122 146 for(n=0;n<results->Size();n++){ 123 124 147 result=(Result*)results->GetObjectByOffset(n); 125 148 126 149 if(strcmp(result->GetFieldName(),"u_g")==0){ 150 127 151 /*Ok, are we dealing with velocities coming from MacAyeal, Pattyin, Hutter, on 2,3 dofs or 128 152 *Stokes on 4 dofs: */ … … 155 179 } 156 180 } 157 158 181 //3d results -> 3 or 4 (stokes) dofs per node 159 182 else{ 160 161 183 if(!isstokes){ 162 184 /*ok, 3 dofs, on number of nodes: */ … … 183 205 } 184 206 } 185 186 207 else{ 187 208 /* 4 dofs on number of nodes. discard pressure: */ … … 317 338 xfree((void**)&partition); 318 339 } 340 else if(strcmp(result->GetFieldName(),"s_g")==0){ 341 /*easy, s_g is of size numberofnodes, on 1 dof, just repartition: */ 342 result->GetField(&s_g); 343 VecToMPISerial(&s_g_serial,s_g); 344 fem_p->parameters->FindParam((void*)&numberofnodes,"numberofnodes"); 345 VecToMPISerial(&partition,fem_p->partition); 346 347 surface=(double*)xmalloc(numberofnodes*sizeof(double)); 348 349 for(i=0;i<numberofnodes;i++){ 350 surface[i]=s_g_serial[(int)partition[i]]; 351 } 352 353 /*Ok, add pressure to newresults: */ 354 newresult=new Result(newresults->Size()+1,result->GetTime(),result->GetStep(),"surface",surface,numberofnodes); 355 newresults->AddObject(newresult); 356 357 /*do some cleanup: */ 358 xfree((void**)&s_g_serial); 359 xfree((void**)&partition); 360 } 361 else if(strcmp(result->GetFieldName(),"b_g")==0){ 362 /*easy, b_g is of size numberofnodes, on 1 dof, just repartition: */ 363 result->GetField(&b_g); 364 VecToMPISerial(&b_g_serial,b_g); 365 fem_p->parameters->FindParam((void*)&numberofnodes,"numberofnodes"); 366 VecToMPISerial(&partition,fem_p->partition); 367 368 bed=(double*)xmalloc(numberofnodes*sizeof(double)); 369 370 for(i=0;i<numberofnodes;i++){ 371 bed[i]=b_g_serial[(int)partition[i]]; 372 } 373 374 /*Ok, add pressure to newresults: */ 375 newresult=new Result(newresults->Size()+1,result->GetTime(),result->GetStep(),"bed",bed,numberofnodes); 376 newresults->AddObject(newresult); 377 378 /*do some cleanup: */ 379 xfree((void**)&b_g_serial); 380 xfree((void**)&partition); 381 } 319 382 else if(strcmp(result->GetFieldName(),"param_g")==0){ 320 383 /*easy, param_g is of size numberofnodes, on 1 dof, just repartition: */ -
issm/trunk/src/c/parallel/transient.cpp
r828 r853 131 131 132 132 _printf_("process results:\n"); 133 ProcessResults(&results,&femmodels[0], DiagnosticAnalysisEnum());133 ProcessResults(&results,&femmodels[0],TransientAnalysisEnum()); 134 134 135 135 _printf_("write results to disk:\n"); -
issm/trunk/src/c/parallel/transient_core_2d.cpp
r851 r853 83 83 84 84 fem_p->parameters->FindParam((void*)&u_g_serial,"u_g"); 85 u_g=SerialToVec(u_g_serial, 2*numberofnodes); xfree((void**)&u_g_serial);85 u_g=SerialToVec(u_g_serial,3*numberofnodes); xfree((void**)&u_g_serial); 86 86 87 87 fem_p->parameters->FindParam((void*)&p_g_serial,"p_g");
Note:
See TracChangeset
for help on using the changeset viewer.