Changeset 20936
- Timestamp:
- 07/18/16 09:05:08 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/FemModel.cpp
r20935 r20936 294 294 295 295 /*intermediary*/ 296 int i; 297 int analysis_type; 298 FILE *IOMODEL = NULL; 299 FILE *toolkitsoptionsfid = NULL; 300 FILE *output_fid = NULL; 301 int my_rank; 296 FILE *IOMODEL = NULL; 297 FILE *toolkitsoptionsfid = NULL; 298 FILE *output_fid = NULL; 302 299 303 300 /*recover my_rank:*/ 304 my_rank=IssmComm::GetRank(); 305 306 /*Initialize internal data: */ 307 this->solution_type = in_solution_type; 308 this->analysis_counter = nummodels-1; //point to last analysis_type carried out. 309 this->results = new Results(); //not initialized by CreateDataSets 310 /*Open input file on cpu 0 and create IoModel */ 301 int my_rank=IssmComm::GetRank(); 302 303 /*Open input file descriptor on cpu 0: */ 311 304 if(my_rank==0) IOMODEL = pfopen0(inputfilename ,"rb"); 312 IoModel* iomodel = new IoModel(IOMODEL,in_solution_type,trace,X);313 314 /*Figure out what analyses are activated for this solution*/315 SolutionAnalysesList(&this->analysis_type_list,&this->nummodels,iomodel,this->solution_type);316 305 317 306 /*Open toolkits file: */ 318 307 toolkitsoptionsfid=pfopen(toolkitsfilename,"r"); 319 308 320 /*create datasets for all analyses*/ 321 ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,iomodel,toolkitsoptionsfid,rootpath,this->solution_type,this->nummodels,this->analysis_type_list); 322 323 324 /*do the post-processing of the datasets to get an FemModel that can actually run analyses: */ 325 for(i=0;i<nummodels;i++){ 326 327 if(VerboseMProcessor()) _printf0_(" Processing finite element model of analysis " << EnumToStringx(analysis_type_list[i]) << ":\n"); 328 analysis_type=analysis_type_list[i]; 329 this->SetCurrentConfiguration(analysis_type); 330 331 if(VerboseMProcessor()) _printf0_(" configuring element and loads\n"); 332 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters); 333 334 if(i==0){ 335 if(VerboseMProcessor()) _printf0_(" creating vertex PIDs\n"); 336 VerticesDofx(vertices,parameters); 337 338 if(VerboseMProcessor()) _printf0_(" detecting active vertices\n"); 339 GetMaskOfIceVerticesLSMx(this); 340 } 341 342 if(VerboseMProcessor()) _printf0_(" resolving node constraints\n"); 343 SpcNodesx(nodes,constraints,parameters,analysis_type); 344 345 if(VerboseMProcessor()) _printf0_(" creating nodal degrees of freedom\n"); 346 NodesDofx(nodes,parameters,analysis_type); 347 } 309 /*Now, go create FemModel:*/ 310 this->InitFromFids(rootpath,IOMODEL,toolkitsoptionsfid,in_solution_type,trace,X); 348 311 349 312 /*Close input file and toolkits file descriptors: */ … … 363 326 this->parameters->AddObject(new StringParam(RestartFileNameEnum,restartfilename)); 364 327 365 /*Clean up*/366 delete iomodel;367 328 }/*}}}*/ 368 329 void FemModel::InitFromFids(char* rootpath, FILE* IOMODEL, FILE* toolkitsoptionsfid, int in_solution_type, bool trace, IssmPDouble* X){/*{{{*/ 369 330 370 /*intermediary*/371 int i;372 int analysis_type;373 374 375 331 /*Initialize internal data: */ 376 332 this->solution_type = in_solution_type; … … 388 344 389 345 /*do the post-processing of the datasets to get an FemModel that can actually run analyses: */ 390 for(i =0;i<nummodels;i++){346 for(int i=0;i<nummodels;i++){ 391 347 392 348 if(VerboseMProcessor()) _printf0_(" Processing finite element model of analysis " << EnumToStringx(analysis_type_list[i]) << ":\n"); 393 analysis_type=analysis_type_list[i]; 394 this->SetCurrentConfiguration(analysis_type); 349 this->SetCurrentConfiguration(analysis_type_list[i]); 350 351 if(VerboseMProcessor()) _printf0_(" configuring element and loads\n"); 352 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters); 395 353 396 354 if(i==0){ … … 403 361 404 362 if(VerboseMProcessor()) _printf0_(" resolving node constraints\n"); 405 SpcNodesx(nodes,constraints,parameters,analysis_type );363 SpcNodesx(nodes,constraints,parameters,analysis_type_list[i]); 406 364 407 365 if(VerboseMProcessor()) _printf0_(" creating nodal degrees of freedom\n"); 408 NodesDofx(nodes,parameters,analysis_type); 409 410 if(VerboseMProcessor()) _printf0_(" configuring element and loads\n"); 411 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters); 366 NodesDofx(nodes,parameters,analysis_type_list[i]); 412 367 } 413 368 414 369 /*Clean up*/ 415 370 delete iomodel; 416 417 371 }/*}}}*/ 418 372 void FemModel::Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
Note:
See TracChangeset
for help on using the changeset viewer.