Index: /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 11339)
+++ /issm/trunk-jpl/src/c/objects/Elements/Penta.cpp	(revision 11340)
@@ -7432,5 +7432,5 @@
 	switch(approximation){
 		case MacAyealApproximationEnum:
-			_error_("Not supported yet");
+			return CreateJacobianDiagnosticMacayeal2d();
 		case PattynApproximationEnum:
 			return CreateJacobianDiagnosticPattyn();
@@ -7440,4 +7440,27 @@
 			_error_("Approximation %s not supported yet",EnumToStringx(approximation));
 	}
+}
+/*}}}*/
+/*FUNCTION Penta::CreateJacobianDiagnosticMacayeal2d{{{1*/
+ElementMatrix* Penta::CreateJacobianDiagnosticMacayeal2d(void){
+
+	/*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 
+	  bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 
+	  the stiffness matrix. */
+	if (!IsOnBed()) return NULL;
+
+	/*Depth Averaging B*/
+	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
+
+	/*Call Tria function*/
+	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+	ElementMatrix* Ke=tria->CreateJacobianDiagnosticMacayeal();
+	delete tria->matice; delete tria;
+
+	/*Delete B averaged*/
+	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+
+	/*clean up and return*/
+	return Ke;
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk-jpl/src/c/objects/Elements/Penta.h	(revision 11339)
+++ /issm/trunk-jpl/src/c/objects/Elements/Penta.h	(revision 11340)
@@ -236,4 +236,5 @@
 		ElementMatrix* CreateKMatrixDiagnosticVertSurface(void);
 		ElementMatrix* CreateJacobianDiagnosticHoriz(void);
+		ElementMatrix* CreateJacobianDiagnosticMacayeal2d(void);
 		ElementMatrix* CreateJacobianDiagnosticPattyn(void);
 		ElementMatrix* CreateJacobianDiagnosticStokes(void);
