Index: /issm/trunk-jpl/src/c/modules/ElementConnectivityx/ElementConnectivityx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ElementConnectivityx/ElementConnectivityx.cpp	(revision 14008)
+++ /issm/trunk-jpl/src/c/modules/ElementConnectivityx/ElementConnectivityx.cpp	(revision 14009)
@@ -15,7 +15,7 @@
 #include "../../EnumDefinitions/EnumDefinitions.h"
 
-int hascommondedge(double* element1,double* element2);
+int hascommondedge(int* element1,int* element2);
 
-void	ElementConnectivityx( double** pelementconnectivity, double* elements, int nel, double* nodeconnectivity, int nods, int width){
+void ElementConnectivityx(int** pelementconnectivity,int* elements, int nels,int* nodeconnectivity, int nods, int width){
 
 	int i,j,k,n;
@@ -23,6 +23,5 @@
 	/*intermediary: */
 	int    maxels;
-	double element;
-	double connectedelement;
+	int  connectedelement;
 	int    connectedelementindex;
 	int    node;
@@ -30,44 +29,41 @@
 	int    num_elements;
 
-	/*output: */
-	double* elementconnectivity=NULL;
-
 	/*maxels: */
 	maxels=width-1;
+
 	/*Allocate connectivity: */
-	elementconnectivity=xNewZeroInit<double>(nel*3);
+	int* elementconnectivity=xNewZeroInit<int>(nels*3);
 
 	/*Go through all elements, and for each element, go through its nodes, to get the neighbouring elements. 
 	 * Once we get the neighbouring elements, figure out if they share a segment with the current element. If so, 
 	 * plug them in the connectivity, unless they are already there.: */
+	for(n=0;n<nels;n++){
 
-	for(n=0;n<nel;n++){
-
-		element=(double)(n+1); //matlab indexing
+		//element=n+1; //matlab indexing
 
 		for(i=0;i<3;i++){
 
-			node=(int)*(elements+n*3+i); //already matlab indexed, elements comes directly from the workspace.
+			node=elements[n*3+i]; //already matlab indexed, elements comes directly from the workspace.
 			index=node-1;
 
-			num_elements=(int)*(nodeconnectivity+width*index+maxels); //retrieve number of elements already  plugged into the connectivity of this node.
+			num_elements=nodeconnectivity[width*index+maxels]; //retrieve number of elements already  plugged into the connectivity of this node.
 
 			for(j=0;j<num_elements;j++){
 
 				/*for each element connected to node, figure out if it has a commond edge with element: */
-				connectedelement=*(nodeconnectivity+width*index+j);
-				connectedelementindex=(int)(connectedelement-1); //go from matlab indexing to c indexing.
+				connectedelement=nodeconnectivity[width*index+j];
+				connectedelementindex=connectedelement-1; //go from matlab indexing to c indexing.
 
-				if(hascommondedge(elements+n*3+0,elements+connectedelementindex*3+0)){
+				if(hascommondedge(&elements[n*3+0],&elements[connectedelementindex*3+0])){
 					/*Ok, this connected element has a commond edge  with element, plug it into elementconnectivity, unless 
 					 *it is already there: */
 
 					for(k=0;k<3;k++){
-						if (*(elementconnectivity+3*n+k)==0){
-							*(elementconnectivity+3*n+k)=connectedelement;
+						if(elementconnectivity[3*n+k]==0){
+							elementconnectivity[3*n+k]=connectedelement;
 							break;
 						}
 						else{
-							if(connectedelement==*(elementconnectivity+3*n+k))break;
+							if(connectedelement==elementconnectivity[3*n+k]) break;
 						}
 					}
@@ -81,16 +77,15 @@
 }
 
-int hascommondedge(double* element1,double* element2){
+int hascommondedge(int* el1,int* el2){
 
-	int i,j;
-	int count;
-
-	count=0;
-	for(i=0;i<3;i++){
-		for(j=0;j<3;j++){
-			if (*(element1+i)==*(element2+j))count++;
+	int count=0;
+	for(int i=0;i<3;i++){
+		for(int j=0;j<3;j++){
+			if(el1[i]==el2[j]) count++;
 		}
 	}
-	if (count==2)return 1;
-	else return 0;
+	if(count==2)
+	 return 1;
+	else
+	 return 0;
 }
Index: /issm/trunk-jpl/src/c/modules/ElementConnectivityx/ElementConnectivityx.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/ElementConnectivityx/ElementConnectivityx.h	(revision 14008)
+++ /issm/trunk-jpl/src/c/modules/ElementConnectivityx/ElementConnectivityx.h	(revision 14009)
@@ -7,5 +7,5 @@
 
 /* local prototypes: */
-void	ElementConnectivityx( double** pelementconnectivity, double* elements, int nel, double* nodeconnectivity, int nods, int width);
+void	ElementConnectivityx(int** pelementconnectivity,int* elements,int nels,int* nodeconnectivity, int nods, int width);
 
 #endif  /* _ELEMENTCONNECTIVITYX_H */
Index: /issm/trunk-jpl/src/wrappers/ElementConnectivity/ElementConnectivity.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/ElementConnectivity/ElementConnectivity.cpp	(revision 14008)
+++ /issm/trunk-jpl/src/wrappers/ElementConnectivity/ElementConnectivity.cpp	(revision 14009)
@@ -13,11 +13,11 @@
 
 	/*inputs: */
-	double* elements=NULL;
-	double* nodeconnectivity=NULL;
-	int     nel,nods;
-	int     width;
+	int* elements=NULL;
+	int* nodeconnectivity=NULL;
+	int  nels,nods;
+	int  width;
 
 	/*outputs: */
-	double* elementconnectivity=NULL;
+	int* elementconnectivity=NULL;
 
 	/*Boot module: */
@@ -28,12 +28,12 @@
         
 	/*Input datasets: */
-	FetchData(&elements,&nel,NULL,ELEMENTS);
+	FetchData(&elements,&nels,NULL,ELEMENTS);
 	FetchData(&nodeconnectivity,&nods,&width,NODECONNECTIVITY);
 
 	/*!Generate internal degree of freedom numbers: */
-	ElementConnectivityx(&elementconnectivity, elements,nel, nodeconnectivity, nods, width);
+	ElementConnectivityx(&elementconnectivity,elements,nels,nodeconnectivity,nods,width);
 
 	/*write output datasets: */
-	WriteData(ELEMENTCONNECTIVITY,elementconnectivity,nel,3);
+	WriteData(ELEMENTCONNECTIVITY,elementconnectivity,nels,3);
 
 	/*end module: */
