Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 17486)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 17487)
@@ -17,5 +17,5 @@
 void  ElementsAndVerticesPartitioning(bool** pmy_elements, int** pmy_vertices, IoModel* iomodel){
 
-	int i;
+	int i,j;
 
 	const int RIFTINFOSIZE = 12;
@@ -102,23 +102,15 @@
 
 	/*Start figuring out, out of the partition, which elements belong to this cpu: */
-	for (i=0;i<iomodel->numberofelements;i++){
+	for(i=0;i<iomodel->numberofelements;i++){
 
 		/*!All elements have been partitioned above, only deal with elements for this cpu: */
 		if(my_rank==epart[i]){ 
-
 			my_elements[i]=true;
-
 			/*Now that we are here, we can also start building the list of vertices belonging to this cpu partition: we use 
 			 *the  element index to do this. For each element n, we know index[n][0:2] holds the indices (matlab indexing) 
 			 into the vertices coordinates. If we start plugging 1 into my_vertices for each index[n][i] (i=0:2), then my_vertices 
 			 will hold which vertices belong to this partition*/
-			my_vertices[iomodel->elements[elements_width*i+0]-1]=1;
-			my_vertices[iomodel->elements[elements_width*i+1]-1]=1;
-			my_vertices[iomodel->elements[elements_width*i+2]-1]=1;
-
-			if(elements_width==6){
-				my_vertices[iomodel->elements[elements_width*i+3]-1]=1;
-				my_vertices[iomodel->elements[elements_width*i+4]-1]=1;
-				my_vertices[iomodel->elements[elements_width*i+5]-1]=1;
+			for(j=0;j<elements_width;j++){
+				my_vertices[iomodel->elements[elements_width*i+j]-1]=1;
 			}
 		}
