Changeset 23505
- Timestamp:
- 12/05/18 15:03:06 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
r23372 r23505 92 92 iomodel->DeleteData(vertex_pairing,"md.masstransport.vertex_pairing"); 93 93 iomodel->DeleteData(nodeonbase,"md.mesh.vertexonbase"); 94 95 94 }/*}}}*/ 96 95 void MasstransportAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ -
issm/trunk-jpl/src/c/classes/IoModel.cpp
r23319 r23505 247 247 xDelete<bool>(this->my_faces); 248 248 xDelete<bool>(this->my_edges); 249 xDelete< int>(this->my_vertices);249 xDelete<bool>(this->my_vertices); 250 250 251 251 xDelete<int>(this->elements); -
issm/trunk-jpl/src/c/classes/IoModel.h
r23167 r23505 66 66 bool *my_faces; 67 67 bool *my_edges; 68 int*my_vertices;68 bool *my_vertices; 69 69 70 70 /*Mesh properties and connectivity tables*/ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp
r23285 r23505 28 28 29 29 case P1DGEnum: 30 NodesPartitioning(&my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,false);30 DiscontinuousGalerkinNodesPartitioning(&my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel); 31 31 for(i=0;i<iomodel->numberofelements;i++){ 32 32 for(j=0;j<3;j++){ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
r22617 r23505 69 69 parameters->AddObject(iomodel->CopyConstantObject("md.qmu.numberofpartitions",QmuNumberofpartitionsEnum)); 70 70 iomodel->FetchData(&dpart,NULL,NULL,"md.qmu.partition"); 71 if(!dpart){ 72 /*Partition elements and vertices and nodes: */ 73 ElementsAndVerticesPartitioning(&iomodel->my_elements,&iomodel->my_vertices,iomodel); 74 75 dpart=xNew<double>(iomodel->numberofvertices); 76 for(i=0;i<iomodel->numberofvertices;i++)dpart[i]=iomodel->my_vertices[i]; 77 } 71 if(!dpart) _error_("md.qmu.partition is empty"); 78 72 parameters->AddObject(new DoubleVecParam(QmuPartitionEnum,dpart,iomodel->numberofvertices)); 79 73 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
r23504 r23505 15 15 #include "../ModelProcessorx/ModelProcessorx.h" 16 16 17 void ElementsAndVerticesPartitioning(bool** pmy_elements, int** pmy_vertices,IoModel* iomodel){17 void ElementsAndVerticesPartitioning(bool** pmy_elements,bool** pmy_vertices,IoModel* iomodel){ 18 18 19 19 int numberofelements2d; … … 23 23 24 24 /*intermediary: */ 25 int *epart = NULL; //element partitioning. 26 int *npart = NULL; //node partitioning. 27 int elements_width; //number of columns in elements (2d->3, 3d->6) 28 int el1,el2; 29 int *elements2d = NULL; 25 int *epart = NULL; //element partitioning. 26 int *npart = NULL; //node partitioning. 27 int elements_width; //number of columns in elements (2d->3, 3d->6) 28 int *elements2d = NULL; 30 29 31 30 /*Get my_rank:*/ … … 75 74 for(int i=0;i<numrifts;i++){ 76 75 const int RIFTINFOSIZE = 12; 77 el1=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+2))-1; //matlab indexing to c indexing78 el2=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+3))-1; //matlab indexing to c indexing76 int el1=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+2))-1; //matlab indexing to c indexing 77 int el2=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+3))-1; //matlab indexing to c indexing 79 78 epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding vertices; 80 79 } … … 84 83 /*Create my_vertices and my_elements, used by each partition */ 85 84 bool *my_elements = xNewZeroInit<bool>(iomodel->numberofelements); 86 int *my_vertices = xNewZeroInit<int>(iomodel->numberofvertices);85 bool *my_vertices = xNewZeroInit<bool>(iomodel->numberofvertices); 87 86 88 87 /*Start figuring out, out of the partition, which elements belong to this cpu: */ … … 97 96 will hold which vertices belong to this partition*/ 98 97 for(int j=0;j<elements_width;j++){ 99 my_vertices[iomodel->elements[elements_width*i+j]-1]= 1;98 my_vertices[iomodel->elements[elements_width*i+j]-1]=true; 100 99 } 101 100 } … … 109 108 for(int i=0;i<numvertex_pairing;i++){ 110 109 if(my_vertices[vertex_pairing[2*i+0]-1] && !my_vertices[vertex_pairing[2*i+1]-1]){ 111 my_vertices[vertex_pairing[2*i+1]-1]= 2; //to know that these elements are not on the partition110 my_vertices[vertex_pairing[2*i+1]-1]=true; 112 111 } 113 112 } … … 116 115 for(int i=0;i<numvertex_pairing;i++){ 117 116 if(my_vertices[vertex_pairing[2*i+0]-1] && !my_vertices[vertex_pairing[2*i+1]-1]){ 118 my_vertices[vertex_pairing[2*i+1]-1]= 2; //to know that these elements are not on the partition117 my_vertices[vertex_pairing[2*i+1]-1]=true; 119 118 } 120 119 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
r23493 r23505 25 25 26 26 /*partitioning: */ 27 void ElementsAndVerticesPartitioning(bool** pmy_elements, int** pmy_vertices, IoModel* iomodel);28 void NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, bool continuous);27 void ElementsAndVerticesPartitioning(bool** pmy_elements,bool** pmy_vertices, IoModel* iomodel); 28 void DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements,bool* my_vertices, IoModel* iomodel); 29 29 void FacesPartitioning(IoModel* iomodel); 30 30 void EdgesPartitioning(IoModel* iomodel); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
r18946 r23505 15 15 #include "../ModelProcessorx/ModelProcessorx.h" 16 16 17 void DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel); 18 void ContinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel); 19 20 void NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, bool continuous){ 21 22 if(continuous==true) 23 ContinuousGalerkinNodesPartitioning(pmy_nodes,my_elements, my_vertices, iomodel); 24 else 25 DiscontinuousGalerkinNodesPartitioning(pmy_nodes,my_elements, my_vertices, iomodel); 26 } 27 28 void ContinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel){ 29 30 /*output: */ 31 bool* my_nodes=xNew<bool>(iomodel->numberofvertices); 32 for(int i=0;i<iomodel->numberofvertices;i++) my_nodes[i]=(bool)my_vertices[i]; 33 34 /*Assign output pointers:*/ 35 *pmy_nodes=my_nodes; 36 } 37 38 void DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel){ 17 void DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements,bool* my_vertices, IoModel* iomodel){ 39 18 40 19 /* Each element has it own nodes (as many as vertices) + additional nodes
Note:
See TracChangeset
for help on using the changeset viewer.