Index: /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp	(revision 11467)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp	(revision 11468)
@@ -1632,5 +1632,5 @@
 
 	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
-	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyBEnum);
+	if (enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum) input=this->matice->inputs->GetInput(enum_type);
 	else input=this->inputs->GetInput(enum_type);
 	//if (!input) _error_("Input %s not found in penta->inputs",EnumToStringx(enum_type)); why error out? if the requested input does not exist, we should still 
@@ -1746,4 +1746,5 @@
 					break;
 				case MaterialsRheologyBbarEnum:
+				case MaterialsRheologyZbarEnum:
 					/*Matice will take care of it*/ break;
 				default:
@@ -2037,5 +2038,10 @@
 
 			/*update input*/
-			this->inputs->AddInput(new PentaP1Input(name,values));
+			if (name==MaterialsRheologyZEnum || name==MaterialsRheologyZbarEnum){
+				matice->inputs->AddInput(new PentaP1Input(name,values));
+			}
+			else{
+				this->inputs->AddInput(new PentaP1Input(name,values));
+			}
 			return;
 
@@ -3199,4 +3205,8 @@
 			*presponse=this->matice->GetBbar();
 			break;
+		case MaterialsRheologyZbarEnum:
+			*presponse=this->matice->GetZbar();
+			break;
+
 		case VelEnum:
 
@@ -6046,4 +6056,7 @@
 	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
 
+	/*Depth Averaging Z*/
+	this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
+
 	/*Call Tria function*/
 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
@@ -6053,4 +6066,7 @@
 	/*Delete B averaged*/
 	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+
+	/*Delete Z averaged*/
+	this->matice->inputs->DeleteInput(MaterialsRheologyZbarEnum);
 
 	/*clean up and return*/
@@ -7487,4 +7503,7 @@
 	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
 
+	/*Depth Averaging Z*/
+	this->InputDepthAverageAtBase(MaterialsRheologyZEnum,MaterialsRheologyZbarEnum,MaterialsEnum);
+
 	/*Call Tria function*/
 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
@@ -7494,4 +7513,7 @@
 	/*Delete B averaged*/
 	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+
+	/*Delete Z averaged*/
+	this->matice->inputs->DeleteInput(MaterialsRheologyZbarEnum);
 
 	/*clean up and return*/
