Changeset 23493
- Timestamp:
- 11/30/18 11:52:30 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/FemModel.cpp
r23489 r23493 182 182 if(lockfilename)xDelete<char>(lockfilename); 183 183 if(elements)delete elements; 184 if(nodes)delete nodes;185 184 if(vertices)delete vertices; 186 185 if(this->constraints_list && this->nummodels){ … … 191 190 for(int i=0;i<this->nummodels;i++) delete this->loads_list[i]; 192 191 xDelete<Loads*>(loads_list); 192 } 193 if(this->nodes_list && this->nummodels){ 194 for(int i=0;i<this->nummodels;i++) delete this->nodes_list[i]; 195 xDelete<Nodes*>(nodes_list); 193 196 } 194 197 if(materials)delete materials; … … 328 331 output->constraints_list=xNew<Constraints*>(this->nummodels); 329 332 output->loads_list=xNew<Loads*>(this->nummodels); 333 output->nodes_list=xNew<Nodes*>(this->nummodels); 330 334 331 335 output->profiler=static_cast<Profiler*>(this->profiler->copy()); … … 334 338 output->parameters=static_cast<Parameters*>(this->parameters->Copy()); 335 339 output->results=static_cast<Results*>(this->results->Copy()); 336 output->nodes=static_cast<Nodes*>(this->nodes->Copy());337 340 output->vertices=static_cast<Vertices*>(this->vertices->Copy()); 338 341 output->elements=static_cast<Elements*>(this->elements->Copy()); … … 347 350 output->constraints_list[i] = static_cast<Constraints*>(this->constraints_list[i]->Copy()); 348 351 output->loads_list[i] = static_cast<Loads*>(this->loads_list[i]->Copy()); 352 output->nodes_list[i] = static_cast<Nodes*>(this->nodes_list[i]->Copy()); 349 353 analysis_type=output->analysis_type_list[i]; 350 354 output->SetCurrentConfiguration(analysis_type); 351 355 if(i==0) VerticesDofx(output->vertices,output->parameters); //only call once, we only have one set of vertices 352 SpcNodesx(output->nodes ,output->constraints_list[i],output->parameters,analysis_type);353 NodesDofx(output->nodes ,output->parameters,analysis_type);354 ConfigureObjectsx(output->elements,output->loads_list[i],output->nodes ,output->vertices,output->materials,output->parameters);356 SpcNodesx(output->nodes_list[i],output->constraints_list[i],output->parameters,analysis_type); 357 NodesDofx(output->nodes_list[i],output->parameters,analysis_type); 358 ConfigureObjectsx(output->elements,output->loads_list[i],output->nodes_list[i],output->vertices,output->materials,output->parameters); 355 359 } 356 360 … … 426 430 427 431 /*create datasets for all analyses*/ 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);432 ModelProcessorx(&this->elements,&this->nodes_list,&this->vertices,&this->materials,&this->constraints_list,&this->loads_list,&this->parameters,iomodel,toolkitsoptionsfid,rootpath,this->solution_type,this->nummodels,this->analysis_type_list); 429 433 430 434 /*do the post-processing of the datasets to get an FemModel that can actually run analyses: */ … … 471 475 xDelete<Loads*>(loads_list); 472 476 } 477 if(this->nodes_list && this->nummodels){ 478 for(i=0;i<this->nummodels;i++) delete this->nodes_list[i]; 479 xDelete<Nodes*>(nodes_list); 480 } 473 481 delete this->results; 474 delete this->nodes;475 482 delete this->vertices; 476 483 delete this->elements; … … 495 502 this->parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 496 503 this->results->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 497 this->nodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);498 504 this->vertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 499 505 this->elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); … … 504 510 this->loads_list = xNew<Loads*>(this->nummodels); 505 511 for(i=0;i<nummodels;i++) this->loads_list[i] = new Loads(); 512 this->nodes_list = xNew<Nodes*>(this->nummodels); 513 for(i=0;i<nummodels;i++) this->nodes_list[i] = new Nodes(); 506 514 } 507 515 … … 509 517 this->constraints_list[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 510 518 this->loads_list[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 519 this->nodes_list[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 511 520 } 512 521 … … 522 531 SetCurrentConfiguration(analysis_type); 523 532 if(i==0) VerticesDofx(this->vertices,this->parameters); //only call once, we only have one set of vertices 524 SpcNodesx(this->nodes ,this->constraints_list[i],this->parameters,analysis_type);525 NodesDofx(this->nodes ,this->parameters,analysis_type);526 ConfigureObjectsx(this->elements,this->loads_list[i],this->nodes ,this->vertices,this->materials,this->parameters);533 SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters,analysis_type); 534 NodesDofx(this->nodes_list[i],this->parameters,analysis_type); 535 ConfigureObjectsx(this->elements,this->loads_list[i],this->nodes_list[i],this->vertices,this->materials,this->parameters); 527 536 } 528 537 … … 607 616 this->loads = this->loads_list[this->analysis_counter]; 608 617 this->constraints = this->constraints_list[this->analysis_counter]; 618 this->nodes = this->nodes_list[this->analysis_counter]; 609 619 this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters); 610 620 this->elements->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters); … … 2637 2647 /*Creating nodes and constraints*/ 2638 2648 /*Just SSA (2D) and P1 in this version*/ 2639 Nodes* new_nodes = new Nodes();2640 2649 Constraints** new_constraints_list = xNew<Constraints*>(this->nummodels); 2650 Nodes** new_nodes_list = xNew<Nodes*>(this->nummodels); 2641 2651 2642 2652 int nodecounter =0; … … 2647 2657 if(this->loads_list[i]->Size()!=0) _error_("not supported yet"); 2648 2658 new_constraints_list[i] = new Constraints(); 2659 new_nodes_list[i] = new Nodes(); 2649 2660 2650 2661 int analysis_enum = this->analysis_type_list[i]; … … 2653 2664 if(analysis_enum==StressbalanceVerticalAnalysisEnum) continue; 2654 2665 2655 this->CreateNodes(newnumberofvertices,my_vertices,nodecounter,analysis_enum,new_nodes );2666 this->CreateNodes(newnumberofvertices,my_vertices,nodecounter,analysis_enum,new_nodes_list[i]); 2656 2667 this->CreateConstraints(new_vertices,nodecounter,constraintcounter,analysis_enum,new_constraints_list[i]); 2657 2668 this->UpdateElements(newnumberofelements,newelementslist,my_elements,nodecounter,i,new_elements); 2658 2669 2659 if(new_nodes ->Size()) nodecounter=new_nodes->MaximumId();2670 if(new_nodes_list[i]->Size()) nodecounter=new_nodes_list[i]->MaximumId(); 2660 2671 constraintcounter = new_constraints_list[i]->NumberOfConstraints(); 2661 2672 /*Make sure nodecounter is at least 0 (if no node exists, maxid will be -1*/ … … 2663 2674 2664 2675 new_constraints_list[i]->Presort(); 2676 new_nodes_list[i]->Presort(); 2665 2677 } 2666 2678 2667 2679 new_elements->Presort(); 2668 new_nodes->Presort();2669 2680 new_vertices->Presort(); 2670 2681 //this->loads->Presort(); 2671 2682 new_materials->Presort(); 2672 2683 2673 /*reset hooks for elements, loads and nodes:*/2684 /*reset hooks*/ 2674 2685 new_elements->ResetHooks(); 2675 2686 //this->loads->ResetHooks(); … … 2689 2700 2690 2701 /*configure elements, loads and nodes, for this new analysis: */ 2691 new_elements->SetCurrentConfiguration(new_elements,this->loads,new_nodes ,new_vertices,new_materials,this->parameters);2692 this->loads->SetCurrentConfiguration(new_elements,this->loads,new_nodes ,new_vertices,new_materials,this->parameters);2702 new_elements->SetCurrentConfiguration(new_elements,this->loads,new_nodes_list[i],new_vertices,new_materials,this->parameters); 2703 this->loads->SetCurrentConfiguration(new_elements,this->loads,new_nodes_list[i],new_vertices,new_materials,this->parameters); 2693 2704 2694 2705 /*take care of toolkits options, that depend on this analysis type (present only after model processor)*/ … … 2698 2709 } 2699 2710 2700 ConfigureObjectsx(new_elements,this->loads,new_nodes ,new_vertices,new_materials,this->parameters);2711 ConfigureObjectsx(new_elements,this->loads,new_nodes_list[i],new_vertices,new_materials,this->parameters); 2701 2712 if(i==0){ 2702 2713 VerticesDofx(new_vertices,this->parameters); //only call once, we only have one set of vertices 2703 2714 } 2704 SpcNodesx(new_nodes ,new_constraints_list[i],this->parameters,analysis_type);2705 NodesDofx(new_nodes ,this->parameters,analysis_type);2715 SpcNodesx(new_nodes_list[i],new_constraints_list[i],this->parameters,analysis_type); 2716 NodesDofx(new_nodes_list[i],this->parameters,analysis_type); 2706 2717 } 2707 2718 … … 2712 2723 delete this->vertices; this->vertices = new_vertices; 2713 2724 delete this->elements; this->elements = new_elements; 2714 delete this->nodes; this->nodes = new_nodes;2715 2725 delete this->materials; this->materials = new_materials; 2716 2717 2726 if(this->constraints_list && this->nummodels){ 2718 2727 for(int i=0;i<this->nummodels;i++) delete this->constraints_list[i]; 2719 2728 xDelete<Constraints*>(this->constraints_list); 2720 2729 } 2721 this->constraints_list = new_constraints_list; 2730 this->constraints_list= new_constraints_list; 2731 if(this->nodes_list && this->nummodels){ 2732 for(int i=0;i<this->nummodels;i++) delete this->nodes_list[i]; 2733 xDelete<Nodes*>(this->nodes_list); 2734 } 2735 this->nodes_list = new_nodes_list; 2722 2736 2723 2737 GetMaskOfIceVerticesLSMx0(this); -
issm/trunk-jpl/src/c/classes/FemModel.h
r23488 r23493 43 43 Elements *elements; //elements (one set for all analyses) 44 44 Materials *materials; //one set of materials, for each element 45 Nodes *nodes; //one set of nodes46 45 Parameters *parameters; //one set of parameters, independent of the analysis_type 47 46 Results *results; //results that cannot be fit into the elements … … 53 52 Loads *loads; 54 53 Loads **loads_list; 54 Nodes *nodes; 55 Nodes **nodes_list; 55 56 56 57 //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/modules/ModelProcessorx/ModelProcessorx.cpp
r23488 r23493 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*/ … … 25 25 /*Initialize datasets*/ 26 26 Elements *elements = new Elements(); 27 Nodes *nodes = new Nodes();28 27 Vertices *vertices = new Vertices(); 29 28 Materials *materials = new Materials(); … … 34 33 Loads **loads = xNew<Loads*>(nummodels); 35 34 for(int i=0;i<nummodels;i++) loads[i] = new Loads(); 35 Nodes **nodes = xNew<Nodes*>(nummodels); 36 for(int i=0;i<nummodels;i++) nodes[i] = new Nodes(); 36 37 37 38 … … 55 56 Analysis* analysis = EnumToAnalysis(analysis_enum); 56 57 analysis->UpdateParameters(parameters,iomodel,solution_enum,analysis_enum); 57 analysis->CreateNodes(nodes ,iomodel);58 analysis->CreateNodes(nodes[i],iomodel); 58 59 analysis->CreateConstraints(constraints[i],iomodel); 59 60 analysis->CreateLoads(loads[i],iomodel); … … 64 65 * constraints, and ids for objects created in next call to CreateDataSets 65 66 * will need to start at the end of the updated counters: */ 66 if(nodes ->Size()) iomodel->nodecounter = nodes->MaximumId();67 if(nodes[i]->Size()) iomodel->nodecounter = nodes[i]->MaximumId(); 67 68 iomodel->loadcounter = loads[i]->NumberOfLoads(); 68 69 iomodel->constraintcounter = constraints[i]->NumberOfConstraints(); … … 74 75 constraints[i]->Presort(); 75 76 loads[i]->Presort(); 77 nodes[i]->Presort(); 76 78 } 77 79 … … 94 96 * redone: */ 95 97 elements->Presort(); 96 nodes->Presort();97 98 vertices->Presort(); 98 99 materials->Presort(); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
r23488 r23493 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*/
Note:
See TracChangeset
for help on using the changeset viewer.