Index: /issm/trunk/src/mex/MeshPartition/MeshPartition.cpp
===================================================================
--- /issm/trunk/src/mex/MeshPartition/MeshPartition.cpp	(revision 10230)
+++ /issm/trunk/src/mex/MeshPartition/MeshPartition.cpp	(revision 10231)
@@ -7,5 +7,5 @@
 	%Info needed from model are the following: 
 	%mesh info: 
-	numberofelements,numberofnodes,elements,elements_width
+	numberofelements,numberofvertices,elements,elements_width
 	%Non-extruded 2d mesh info
 	nel2d,nods2d,elements2d,
@@ -13,5 +13,5 @@
 	nel2d_ext,nods2d_ext,elements2d_ext,
 	%Diverse
-	numlayers,dim)
+	numberoflayers,dim)
 
 	output:
@@ -30,23 +30,22 @@
 
 	/* required input: */
-	int dim;
-	int numberofelements;
-	int numberofnodes;
-	double* elements=NULL;
+	int     dim;
+	int     numberofelements;
+	int     numberofvertices;
+	double *elements         = NULL;
 	int     elements_width;
 
 	int numberofelements2d;
-	int numberofnodes2d;
+	int numberofvertices2d;
 	double* elements2d=NULL;
 
-	int numlayers;
+	int numberoflayers;
 	int numareas=1;
 
 	/* output: */
-	int*    int_element_partitioning=NULL;
-	int*    int_node_partitioning   =NULL;
-	double* element_partitioning    =NULL;
-	double* node_partitioning       =NULL;
-
+	int    *int_element_partitioning = NULL;
+	int    *int_node_partitioning    = NULL;
+	double *element_partitioning     = NULL;
+	double *node_partitioning        = NULL;
 
 	/*Boot module: */
@@ -57,23 +56,20 @@
 
 	/*Fetch data: */
-	FetchMatlabData(&dim,mxGetAssignedField(MODEL,0,"dim"));
+	FetchMatlabData(&dim,mxGetAssignedField(MODEL,0,"dimension"));
 	FetchMatlabData(&numberofelements,mxGetAssignedField(MODEL,0,"numberofelements"));
-	FetchMatlabData(&numberofnodes,mxGetAssignedField(MODEL,0,"numberofnodes"));
+	FetchMatlabData(&numberofvertices,mxGetAssignedField(MODEL,0,"numberofvertices"));
 	FetchMatlabData(&elements,NULL,&elements_width,mxGetAssignedField(MODEL,0,"elements"));
 
 	if (dim==3){
-	
 		FetchMatlabData(&numberofelements2d,mxGetAssignedField(MODEL,0,"numberofelements2d"));
-		FetchMatlabData(&numberofnodes2d,mxGetAssignedField(MODEL,0,"numberofnodes2d"));
+		FetchMatlabData(&numberofvertices2d,mxGetAssignedField(MODEL,0,"numberofvertices2d"));
 		FetchMatlabData(&elements2d,NULL,NULL,mxGetAssignedField(MODEL,0,"elements2d"));
-
 	}
-	FetchMatlabData(&numlayers,mxGetAssignedField(MODEL,0,"numlayers"));
+	FetchMatlabData(&numberoflayers,mxGetAssignedField(MODEL,0,"numberoflayers"));
 	FetchMatlabData(&numareas,NUMAREAS);
 
 	/*Run partitioning algorithm based on a "clever" use of the Metis partitioner: */
-	MeshPartitionx(&int_element_partitioning,&int_node_partitioning,numberofelements,numberofnodes,elements,
-		numberofelements2d,numberofnodes2d,elements2d,numlayers,elements_width,dim,numareas);
-
+	MeshPartitionx(&int_element_partitioning,&int_node_partitioning,numberofelements,numberofvertices,elements,
+		numberofelements2d,numberofvertices2d,elements2d,numberoflayers,elements_width,dim,numareas);
 
 	/*Post process node_partitioning and element_partitioning to be in double format. Metis needed them in int* format: */
@@ -83,6 +79,6 @@
 	}
 	
-	node_partitioning=(double*)xmalloc(numberofnodes*sizeof(double));
-	for (i=0;i<numberofnodes;i++){
+	node_partitioning=(double*)xmalloc(numberofvertices*sizeof(double));
+	for (i=0;i<numberofvertices;i++){
 		node_partitioning[i]=(double)int_node_partitioning[i]+1; //Metis indexing from 0, matlab from 1.
 	}
@@ -90,9 +86,8 @@
 	/*Write data:*/
 	WriteMatlabData(ELEMENTPARTITIONING,element_partitioning,numberofelements);
-	WriteMatlabData(NODEPARTITIONING,node_partitioning,numberofnodes);
+	WriteMatlabData(NODEPARTITIONING,node_partitioning,numberofvertices);
 	
 	/*Free ressources:*/
 	//don't! let matlab do it.
-
 
 	/*end module: */
@@ -102,7 +97,6 @@
 void MeshPartitionUsage(void){
 	printf("   usage:\n");
-	printf("   [element_partitioning,node_partitioning]=MeshPartition(model,numareas)");
+	printf("   [element_partitioning,node_partitioning]=MeshPartition(md.mesh,numpartitions)");
 	printf("   where:\n");
-	printf("      model is a @model class object instance,numareas is the number of processors on which partitioning will occur.\n");
 	printf("      element_partitioning is a vector of partitioning area numbers, for every element.\n");
 	printf("      node_partitioning is a vector of partitioning area numbers, for every node.\n");
