Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5262)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5263)
@@ -2100,11 +2100,11 @@
 
 	/* node data: */
-	const int    numgrids=6; // Pattyn numgrids
-	const int    numdof=2*numgrids;
-	const int    numgrids2=3; //MacAyeal numgrids
-	const int    numdof2=2*numgrids2;
-	double       xyz_list[numgrids][3];
-	int*         doflist=NULL;
-	int*         doflist2=NULL;
+	const int    numgridsm=3;  //MacAyealnumgrids
+	const int    numdofm=2*numgridsm;
+	const int    numgridsp=6; //Pattyn numgrids
+	const int    numdofp=2*numgridsp;
+	double       xyz_list[numgridsp][3];
+	int*         doflistm=NULL;
+	int*         doflistp=NULL;
 
 	/* 3d gaussian points: */
@@ -2142,7 +2142,7 @@
 
 	/* matrices: */
-	double B[3][numdof];
-	double Bprime[3][numdof2];
-	double L[2][numdof];
+	double B[3][numdofp];
+	double Bprime[3][numdofm];
+	double L[2][numdofp];
 	double D[3][3]={0.0};            // material matrix, simple scalar matrix.
 	double D_scalar;
@@ -2151,6 +2151,6 @@
 
 	/* local element matrices: */
-	double Ke_gg[numdof][numdof2]={0.0}; //local element stiffness matrix 
-	double Ke_gg_gaussian[numdof][numdof2]; //stiffness matrix evaluated at the gaussian point.
+	double Ke_gg[numdofp][numdofm]={0.0}; //local element stiffness matrix 
+	double Ke_gg_gaussian[numdofp][numdofm]; //stiffness matrix evaluated at the gaussian point.
 	double Jdet;
 
@@ -2191,7 +2191,7 @@
 
 	/* Get node coordinates and dof list: */
-	GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
-	GetDofList(&doflist);  //Pattyn dof list
-	GetDofList(&doflist2); //MacAyeal dof list
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, numgridsp);
+	tria->GetDofList(&doflistm,MacAyealApproximationEnum);  //Pattyn dof list
+	GetDofList(&doflistp,PattynApproximationEnum); //MacAyeal dof list
 
 	/*Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore 
@@ -2251,12 +2251,12 @@
 
 			/*  Do the triple product tB*D*Bprime: */
-			TripleMultiply( &B[0][0],3,numdof,1,
+			TripleMultiply( &B[0][0],3,numdofp,1,
 						&D[0][0],3,3,0,
-						&Bprime[0][0],3,numdof2,0,
+						&Bprime[0][0],3,numdofm,0,
 						&Ke_gg_gaussian[0][0],0);
 
 			/* Add the Ke_gg_gaussian, and optionally Ke_gg_gaussian onto Ke_gg: */
-			for( i=0; i<numdof; i++){
-				for(j=0;j<numdof2; j++){
+			for( i=0; i<numdofp; i++){
+				for(j=0;j<numdofm; j++){
 					Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
 				}
@@ -2267,6 +2267,6 @@
 	/*Add Ke_gg to global matrix Kgg: */
 	// one need to be transposed
-	MatSetValues(Kgg,numdof,doflist,numdof2,doflist2,(const double*)Ke_gg,ADD_VALUES);
-	MatSetValues(Kgg,numdof2,doflist2,numdof,doflist,(const double*)Ke_gg,ADD_VALUES);
+	MatSetValues(Kgg,numdofp,doflistp,numdofm,doflistm,(const double*)Ke_gg,ADD_VALUES);
+	MatSetValues(Kgg,numdofm,doflistm,numdofp,doflistp,(const double*)Ke_gg,ADD_VALUES);
 
 	//Deal with 2d friction at the bedrock interface
@@ -2293,5 +2293,6 @@
 	xfree((void**)&third_gauss_area_coord2d);
 	xfree((void**)&gauss_weights2d);
-	xfree((void**)&doflist);
+	xfree((void**)&doflistm);
+	xfree((void**)&doflistp);
 }
 /*}}}*/
@@ -2524,5 +2525,5 @@
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
-	GetDofList(&doflist);
+	GetDofList(&doflist,PattynApproximationEnum);
 
 	/*Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore 
@@ -3753,5 +3754,5 @@
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
-	GetDofList(&doflist);
+	GetDofList(&doflist,PattynApproximationEnum);
 
 	/*Get gaussian points and weights :*/
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5262)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5263)
@@ -2927,5 +2927,5 @@
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
-	GetDofList(&doflist);
+	GetDofList(&doflist,MacAyealApproximationEnum);
 
 	/* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
@@ -4265,5 +4265,5 @@
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
-	GetDofList(&doflist);
+	GetDofList(&doflist,MacAyealApproximationEnum);
 
 
