Changeset 23488
- Timestamp:
- 11/29/18 17:08:07 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/FemModel.cpp
r23487 r23488 188 188 xDelete<Constraints*>(constraints_list); 189 189 } 190 if(loads)delete loads; 190 if(this->loads_list && this->nummodels){ 191 for(int i=0;i<this->nummodels;i++) delete this->loads_list[i]; 192 xDelete<Loads*>(loads_list); 193 } 191 194 if(materials)delete materials; 192 195 if(parameters)delete parameters; … … 324 327 /*Analysis dependent arrays*/ 325 328 output->constraints_list=xNew<Constraints*>(this->nummodels); 329 output->loads_list=xNew<Loads*>(this->nummodels); 326 330 327 331 output->profiler=static_cast<Profiler*>(this->profiler->copy()); 328 332 329 output->loads=static_cast<Loads*>(this->loads->Copy());330 333 output->materials=static_cast<Materials*>(this->materials->Copy()); 331 334 output->parameters=static_cast<Parameters*>(this->parameters->Copy()); 332 335 output->results=static_cast<Results*>(this->results->Copy()); 333 334 336 output->nodes=static_cast<Nodes*>(this->nodes->Copy()); 335 337 output->vertices=static_cast<Vertices*>(this->vertices->Copy()); … … 344 346 for(i=0;i<nummodels;i++){ 345 347 output->constraints_list[i] = static_cast<Constraints*>(this->constraints_list[i]->Copy()); 348 output->loads_list[i] = static_cast<Loads*>(this->loads_list[i]->Copy()); 346 349 analysis_type=output->analysis_type_list[i]; 347 350 output->SetCurrentConfiguration(analysis_type); … … 349 352 SpcNodesx(output->nodes,output->constraints_list[i],output->parameters,analysis_type); 350 353 NodesDofx(output->nodes,output->parameters,analysis_type); 351 ConfigureObjectsx(output->elements,output->loads ,output->nodes,output->vertices,output->materials,output->parameters);354 ConfigureObjectsx(output->elements,output->loads_list[i],output->nodes,output->vertices,output->materials,output->parameters); 352 355 } 353 356 … … 423 426 424 427 /*create datasets for all analyses*/ 425 ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints_list,&this->loads ,&this->parameters,iomodel,toolkitsoptionsfid,rootpath,this->solution_type,this->nummodels,this->analysis_type_list);428 ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints_list,&this->loads_list,&this->parameters,iomodel,toolkitsoptionsfid,rootpath,this->solution_type,this->nummodels,this->analysis_type_list); 426 429 427 430 /*do the post-processing of the datasets to get an FemModel that can actually run analyses: */ … … 432 435 433 436 if(VerboseMProcessor()) _printf0_(" configuring element and loads\n"); 434 ConfigureObjectsx( elements, loads, nodes, vertices, materials,parameters);437 ConfigureObjectsx(this->elements,this->loads,this->nodes,this->vertices,this->materials,this->parameters); 435 438 436 439 if(i==0){ … … 458 461 459 462 if(marshall_direction==MARSHALLING_BACKWARD){ 460 delete this->loads;461 463 delete this->materials; 462 464 delete this->parameters; … … 464 466 for(i=0;i<this->nummodels;i++) delete this->constraints_list[i]; 465 467 xDelete<Constraints*>(constraints_list); 468 } 469 if(this->loads_list && this->nummodels){ 470 for(i=0;i<this->nummodels;i++) delete this->loads_list[i]; 471 xDelete<Loads*>(loads_list); 466 472 } 467 473 delete this->results; … … 487 493 MARSHALLING_DYNAMIC(analysis_type_list,int,nummodels); 488 494 489 this->loads->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);490 495 this->materials->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 491 496 this->parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); … … 498 503 this->constraints_list = xNew<Constraints*>(this->nummodels); 499 504 for(i=0;i<nummodels;i++) this->constraints_list[i] = new Constraints(); 505 this->loads_list = xNew<Loads*>(this->nummodels); 506 for(i=0;i<nummodels;i++) this->loads_list[i] = new Loads(); 500 507 } 501 508 502 509 for(i=0;i<nummodels;i++){ 503 510 this->constraints_list[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 511 this->loads_list[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 504 512 } 505 513 … … 517 525 SpcNodesx(this->nodes,this->constraints_list[i],this->parameters,analysis_type); 518 526 NodesDofx(this->nodes,this->parameters,analysis_type); 519 ConfigureObjectsx(this->elements,this->loads ,this->nodes,this->vertices,this->materials,this->parameters);527 ConfigureObjectsx(this->elements,this->loads_list[i],this->nodes,this->vertices,this->materials,this->parameters); 520 528 } 521 529 … … 598 606 599 607 /*configure elements, loads and nodes, for this new analysis: */ 608 this->loads = this->loads_list[this->analysis_counter]; 609 this->constraints = this->constraints_list[this->analysis_counter]; 610 this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters); 600 611 this->elements->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters); 601 this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters);602 this->constraints = this->constraints_list[this->analysis_counter];603 612 604 613 /*take care of toolkits options, that depend on this analysis type (present only after model processor)*/ … … 2614 2623 this->ElementsAndVerticesPartitioning(newnumberofvertices,newnumberofelements,elementswidth,newelementslist,&my_elements,&my_vertices); 2615 2624 2616 if(this->loads->Size()!=0) _error_("not supported yet");2617 2618 2625 /*Create vertices*/ 2619 2626 Vertices* new_vertices=new Vertices(); … … 2639 2646 for(int i=0;i<this->nummodels;i++){//create nodes for each analysis in analysis_type_list 2640 2647 2648 if(this->loads_list[i]->Size()!=0) _error_("not supported yet"); 2641 2649 new_constraints_list[i] = new Constraints(); 2642 2650 … … 2661 2669 new_nodes->Presort(); 2662 2670 new_vertices->Presort(); 2663 this->loads->Presort();2671 //this->loads->Presort(); 2664 2672 new_materials->Presort(); 2665 2673 2666 2674 /*reset hooks for elements, loads and nodes: */ 2667 2675 new_elements->ResetHooks(); 2668 this->loads->ResetHooks();2676 //this->loads->ResetHooks(); 2669 2677 new_materials->ResetHooks(); 2670 2678 -
issm/trunk-jpl/src/c/classes/FemModel.h
r23481 r23488 42 42 43 43 Elements *elements; //elements (one set for all analyses) 44 Loads *loads; //one set of constraints. each constraint knows which analysis_type it handles45 44 Materials *materials; //one set of materials, for each element 46 45 Nodes *nodes; //one set of nodes … … 52 51 Constraints *constraints; 53 52 Constraints **constraints_list; 53 Loads *loads; 54 Loads **loads_list; 54 55 55 56 //FIXME: do we want only one class and have virtual functions? or keep 2 classes, at least rename AdaptiveMeshRefinement -> AmrNeopz -
issm/trunk-jpl/src/c/classes/Loads/Loads.cpp
r19198 r23488 121 121 122 122 /*Check that this load corresponds to our analysis currently being carried out: */ 123 if (load->InAnalysis(analysis_type)) localloads++; 123 _assert_(load->InAnalysis(analysis_type)); 124 localloads++; 124 125 } 125 126 … … 174 175 175 176 /*Check that this load corresponds to our analysis currently being carried out: */ 176 if (load->InAnalysis(analysis_type)) localloads++; 177 _assert_(load->InAnalysis(analysis_type)); 178 localloads++; 177 179 } 178 180 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
r23481 r23488 13 13 #include "./ModelProcessorx.h" 14 14 15 void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints*** pconstraints, Loads** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_enum,const int nummodels,const int* analysis_enum_list){15 void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints*** pconstraints, Loads*** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_enum,const int nummodels,const int* analysis_enum_list){ 16 16 17 17 /*Set Verbosity once for all*/ … … 28 28 Vertices *vertices = new Vertices(); 29 29 Materials *materials = new Materials(); 30 Loads *loads = new Loads();31 30 Parameters *parameters = new Parameters(); 32 31 33 32 Constraints **constraints = xNew<Constraints*>(nummodels); 34 33 for(int i=0;i<nummodels;i++) constraints[i] = new Constraints(); 34 Loads **loads = xNew<Loads*>(nummodels); 35 for(int i=0;i<nummodels;i++) loads[i] = new Loads(); 35 36 36 37 … … 56 57 analysis->CreateNodes(nodes,iomodel); 57 58 analysis->CreateConstraints(constraints[i],iomodel); 58 analysis->CreateLoads(loads ,iomodel);59 analysis->CreateLoads(loads[i],iomodel); 59 60 analysis->UpdateElements(elements,iomodel,i,analysis_enum); 60 61 delete analysis; … … 64 65 * will need to start at the end of the updated counters: */ 65 66 if(nodes->Size()) iomodel->nodecounter = nodes->MaximumId(); 66 iomodel->loadcounter = loads ->NumberOfLoads();67 iomodel->loadcounter = loads[i]->NumberOfLoads(); 67 68 iomodel->constraintcounter = constraints[i]->NumberOfConstraints(); 68 69 … … 70 71 _assert_(iomodel->nodecounter>=0); 71 72 72 /*Tell constraints that Ids are already sorted*/73 /*Tell datasets that Ids are already sorted*/ 73 74 constraints[i]->Presort(); 75 loads[i]->Presort(); 74 76 } 75 77 … … 94 96 nodes->Presort(); 95 97 vertices->Presort(); 96 loads->Presort();97 98 materials->Presort(); 98 99 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
r23481 r23488 9 9 #include "../../analyses/analyses.h" 10 10 11 void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints*** pconstraints, Loads** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_listh);11 void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints*** pconstraints, Loads*** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_listh); 12 12 13 13 /*Creation of fem datasets: general drivers*/ -
issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
r18653 r23488 99 99 for (i=0;i<femmodel->loads->Size();i++){ 100 100 load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i)); 101 if(load->InAnalysis(configuration_type)){ 102 load->PenaltyCreateKMatrix(Kff,Kfs,kmax); 103 load->PenaltyCreatePVector(pf,kmax); 104 } 101 _assert_(load->InAnalysis(configuration_type)); 102 load->PenaltyCreateKMatrix(Kff,Kfs,kmax); 103 load->PenaltyCreatePVector(pf,kmax); 105 104 } 106 105 } -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp
r23198 r23488 109 109 if(conserve_loads){ 110 110 delete femmodel->loads; 111 int index=femmodel->AnalysisIndex(configuration_type); 112 femmodel->loads_list[index]=savedloads; 111 113 femmodel->loads=savedloads; 112 114 }
Note:
See TracChangeset
for help on using the changeset viewer.