Changeset 6235
- Timestamp:
- 10/11/10 10:51:32 (15 years ago)
- Location:
- issm/trunk/src/c/modules/ModelProcessorx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
r5607 r6235 18 18 #include "../ModelProcessorx/ModelProcessorx.h" 19 19 20 void ElementsAndVerticesPartitioning(bool** pmy_elements, bool** pmy_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle){20 void ElementsAndVerticesPartitioning(bool** pmy_elements, int** pmy_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle){ 21 21 22 22 int i; … … 27 27 /*output: */ 28 28 bool* my_elements=NULL; 29 bool* my_vertices=NULL;29 int* my_vertices=NULL; 30 30 31 31 /*intermediary: */ … … 77 77 78 78 /*Used later on: */ 79 my_vertices=( bool*)xcalloc(iomodel->numberofvertices,sizeof(bool));79 my_vertices=(int*)xcalloc(iomodel->numberofvertices,sizeof(int)); 80 80 my_elements=(bool*)xcalloc(iomodel->numberofelements,sizeof(bool)); 81 81 … … 93 93 into the vertices coordinates. If we start plugging 1 into my_vertices for each index[n][i] (i=0:2), then my_vertices 94 94 will hold which vertices belong to this partition*/ 95 my_vertices[(int)*(iomodel->elements+elements_width*i+0)-1]= true;96 my_vertices[(int)*(iomodel->elements+elements_width*i+1)-1]= true;97 my_vertices[(int)*(iomodel->elements+elements_width*i+2)-1]= true;95 my_vertices[(int)*(iomodel->elements+elements_width*i+0)-1]=1; 96 my_vertices[(int)*(iomodel->elements+elements_width*i+1)-1]=1; 97 my_vertices[(int)*(iomodel->elements+elements_width*i+2)-1]=1; 98 98 99 99 if(elements_width==6){ 100 my_vertices[(int)*(iomodel->elements+elements_width*i+3)-1]= true;101 my_vertices[(int)*(iomodel->elements+elements_width*i+4)-1]= true;102 my_vertices[(int)*(iomodel->elements+elements_width*i+5)-1]= true;100 my_vertices[(int)*(iomodel->elements+elements_width*i+3)-1]=1; 101 my_vertices[(int)*(iomodel->elements+elements_width*i+4)-1]=1; 102 my_vertices[(int)*(iomodel->elements+elements_width*i+5)-1]=1; 103 103 } 104 104 } … … 112 112 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 113 113 for(i=0;i<iomodel->numpenalties;i++){ 114 if(my_vertices[(int)iomodel->penalties[2*i+0]-1] ){115 my_vertices[(int)iomodel->penalties[2*i+1]-1]= true;114 if(my_vertices[(int)iomodel->penalties[2*i+0]-1] && !my_vertices[(int)iomodel->penalties[2*i+1]-1]){ 115 my_vertices[(int)iomodel->penalties[2*i+1]-1]=2; //to know that these elements are not on the partition 116 116 } 117 117 } -
issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.h
r6213 r6235 86 86 87 87 /*partitioning: */ 88 void ElementsAndVerticesPartitioning(bool** pmy_elements, bool** pmy_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle);89 void NodesPartitioning(bool** pmy_nodes,bool* my_elements, bool* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle,bool continuous);88 void ElementsAndVerticesPartitioning(bool** pmy_elements, int** pmy_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle); 89 void NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle,bool continuous); 90 90 91 91 /*Connectivity*/ -
issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
r4919 r6235 18 18 #include "../ModelProcessorx/ModelProcessorx.h" 19 19 20 void DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, bool* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle);21 void ContinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, bool* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle);20 void DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle); 21 void ContinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle); 22 22 23 void NodesPartitioning(bool** pmy_nodes,bool* my_elements, bool* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle,bool continuous){23 void NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle,bool continuous){ 24 24 25 25 /*First thing, this is a new partition for a new analysis_type, therefore, to avoid a leak, erase the nodes partition that might come through pmy_nodes: */ … … 33 33 } 34 34 35 void ContinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, bool* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle){35 void ContinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle){ 36 36 37 37 /*as many nodes as there are vertices */ … … 48 48 49 49 50 void DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, bool* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle){50 void DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, ConstDataHandle iomodel_handle){ 51 51 52 52 /*each element has it own nodes (as many as vertices) + additional nodes from neighbouring elements for each edge. This yields to a very different partition for
Note:
See TracChangeset
for help on using the changeset viewer.