Changeset 19261
- Timestamp:
- 04/06/15 18:54:25 (10 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/FemModel.cpp
r19254 r19261 412 412 ConfigureObjectsx(output->elements,output->loads,output->nodes,output->vertices,output->materials,output->parameters); 413 413 } 414 415 /*Reset current configuration: */ 416 analysis_type=output->analysis_type_list[analysis_counter]; 417 output->SetCurrentConfiguration(analysis_type); 414 418 415 419 return output; … … 650 654 651 655 FILE* restartfid=NULL; 656 FILE* output_fid=NULL; 652 657 char* restartfilename = NULL; 653 658 int femmodel_size=0; … … 679 684 femmodel_buffer_ini=femmodel_buffer; //keep track of the initial position, so as to free later. 680 685 686 this->parameters->FindParam(&output_fid,OutputFilePointerEnum); 687 681 688 /*Create new FemModel by demarshalling the buffer: */ 682 689 this->Marshall(&femmodel_buffer,NULL,MARSHALLING_BACKWARD); 683 690 691 this->parameters->SetParam(output_fid,OutputFilePointerEnum); 692 684 693 /*Reset position of buffer: */ 685 694 femmodel_buffer=femmodel_buffer_ini; … … 687 696 /*Done, close file :*/ 688 697 pfclose(restartfid,restartfilename); 689 698 690 699 /*Free ressources: */ 691 700 xDelete<char>(restartfilename); … … 700 709 701 710 if(marshall_direction==MARSHALLING_BACKWARD){ 702 delete profiler; profiler=new Profiler(); 703 delete loads; loads=new Loads(); 704 delete materials; materials=new Materials(); 705 delete parameters; parameters=new Parameters(); 706 delete constraints; constraints=new Constraints(); 707 delete results; results=new Results(); 708 delete nodes; nodes=new Nodes(); 709 delete vertices; vertices=new Vertices(); 710 delete elements; elements=new Elements(); 711 xDelete<int>(analysis_type_list); 711 delete this->profiler; 712 delete this->loads; 713 delete this->materials; 714 delete this->parameters; 715 delete this->constraints; 716 delete this->results; 717 delete this->nodes; 718 delete this->vertices; 719 delete this->elements; 720 xDelete<int>(this->analysis_type_list); 721 722 this->profiler = new Profiler(); 723 this->loads = new Loads(); 724 this->materials = new Materials(); 725 this->parameters = new Parameters(); 726 this->constraints = new Constraints(); 727 this->results = new Results(); 728 this->nodes = new Nodes(); 729 this->vertices = new Vertices(); 730 this->elements = new Elements(); 712 731 } 713 732 … … 719 738 MARSHALLING_DYNAMIC(analysis_type_list,int,nummodels); 720 739 721 profiler->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);722 loads->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);723 materials->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);724 parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);725 constraints->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);726 results->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);727 nodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);728 vertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);729 elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);740 this->profiler->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 741 this->loads->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 742 this->materials->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 743 this->parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 744 this->constraints->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 745 this->results->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 746 this->nodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 747 this->vertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 748 this->elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 730 749 731 750 if(marshall_direction==MARSHALLING_BACKWARD){ 732 751 //reset hooks for elements, loads and nodes: 733 elements->ResetHooks();734 loads->ResetHooks();735 materials->ResetHooks();752 this->elements->ResetHooks(); 753 this->loads->ResetHooks(); 754 this->materials->ResetHooks(); 736 755 737 756 //do the post-processing of the datasets to get an FemModel that can actually run analyses: 738 757 for(i=0;i<nummodels;i++){ 739 analysis_type= analysis_type_list[i];758 analysis_type=this->analysis_type_list[i]; 740 759 SetCurrentConfiguration(analysis_type); 741 if(i==0) VerticesDofx( vertices,parameters); //only call once, we only have one set of vertices742 SpcNodesx( nodes,constraints,parameters,analysis_type);743 NodesDofx( nodes,parameters,analysis_type);744 ConfigureObjectsx( elements,loads,nodes,vertices,materials,parameters);760 if(i==0) VerticesDofx(this->vertices,this->parameters); //only call once, we only have one set of vertices 761 SpcNodesx(this->nodes,this->constraints,this->parameters,analysis_type); 762 NodesDofx(this->nodes,this->parameters,analysis_type); 763 ConfigureObjectsx(this->elements,this->loads,this->nodes,this->vertices,this->materials,this->parameters); 745 764 } 765 766 /*Reset current configuration: */ 767 analysis_type=this->analysis_type_list[analysis_counter]; 768 SetCurrentConfiguration(analysis_type); 746 769 } 747 770 -
issm/trunk-jpl/src/c/classes/Params/FileParam.cpp
r19254 r19261 58 58 59 59 MARSHALLING_ENUM(FileParamEnum); 60 MARSHALLING(enum_type); 60 61 MARSHALLING(value); 61 62 62 if(marshall_direction==MARSHALLING_BACKWARD) value=NULL; //meaningless file pointer!63 if(marshall_direction==MARSHALLING_BACKWARD) value=NULL; //meaningless file pointer! 63 64 64 65 } -
issm/trunk-jpl/src/c/datastructures/DataSet.cpp
r19254 r19261 215 215 fileparam=new FileParam(); 216 216 fileparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 217 this->AddObject(fileparam); 217 delete fileparam; 218 /* No need to add this object, the pointer is not valid 219 The FemModel should reset all FileParams in the restart function */ 218 220 } 219 221 else if(obj_enum==StringParamEnum){
Note:
See TracChangeset
for help on using the changeset viewer.