Index: /issm/trunk/src/c/objects/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Penta.cpp	(revision 3612)
+++ /issm/trunk/src/c/objects/Penta.cpp	(revision 3613)
@@ -529,4 +529,12 @@
 		CreateKMatrixPrognostic( Kgg,inputs,analysis_type,sub_analysis_type);
 	}
+	else if (analysis_type==BalancedthicknessAnalysisEnum){
+
+		CreateKMatrixBalancedthickness( Kgg,inputs,analysis_type,sub_analysis_type);
+	}
+	else if (analysis_type==BalancedvelocitiesAnalysisEnum){
+
+		CreateKMatrixBalancedvelocities( Kgg,inputs,analysis_type,sub_analysis_type);
+	}
 	else if (analysis_type==ThermalAnalysisEnum){
 
@@ -540,4 +548,46 @@
 		ISSMERROR("%s%i%s\n","analysis: ",analysis_type," not supported yet");
 	}
+
+}
+/*}}}*/
+/*FUNCTION CreateKMatrixBalancedthickness {{{1*/
+
+void  Penta::CreateKMatrixBalancedthickness(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type){
+
+	/*Collapsed formulation: */
+	Tria*  tria=NULL;
+
+	/*If on water, skip: */
+	if(this->properties.onwater)return;
+
+	/*Is this element on the bed? :*/
+	if(!this->properties.onbed)return;
+
+	/*Spawn Tria element from the base of the Penta: */
+	tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
+	tria->CreateKMatrix(Kgg,inputs, analysis_type,sub_analysis_type);
+	delete tria;
+	return;
+
+}
+/*}}}*/
+/*FUNCTION CreateKMatrixBalancedvelocities {{{1*/
+
+void  Penta::CreateKMatrixBalancedvelocities(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type){
+
+	/*Collapsed formulation: */
+	Tria*  tria=NULL;
+
+	/*If on water, skip: */
+	if(this->properties.onwater)return;
+
+	/*Is this element on the bed? :*/
+	if(!this->properties.onbed)return;
+
+	/*Spawn Tria element from the base of the Penta: */
+	tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
+	tria->CreateKMatrix(Kgg,inputs, analysis_type,sub_analysis_type);
+	delete tria;
+	return;
 
 }
@@ -1567,4 +1617,12 @@
 		CreatePVectorPrognostic( pg,inputs,analysis_type,sub_analysis_type);
 	}
+	else if (analysis_type==BalancedthicknessAnalysisEnum){
+
+		CreatePVectorPrognostic( pg,inputs,analysis_type,sub_analysis_type);
+	}
+	else if (analysis_type==BalancedvelocitiesAnalysisEnum){
+
+		CreatePVectorPrognostic( pg,inputs,analysis_type,sub_analysis_type);
+	}
 	else if (analysis_type==ThermalAnalysisEnum){
 
@@ -1579,4 +1637,44 @@
 	}	
 
+}
+/*}}}*/
+/*FUNCTION CreatePVectorBalancedthickness {{{1*/
+
+void Penta::CreatePVectorBalancedthickness( Vec pg, void* inputs, int analysis_type,int sub_analysis_type){
+
+	/*Collapsed formulation: */
+	Tria*  tria=NULL;
+
+	/*If on water, skip: */
+	if(this->properties.onwater)return;
+
+	/*Is this element on the bed? :*/
+	if(!this->properties.onbed)return;
+
+	/*Spawn Tria element from the base of the Penta: */
+	tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
+	tria->CreatePVector(pg,inputs, analysis_type,sub_analysis_type);
+	delete tria;
+	return;
+}
+/*}}}*/
+/*FUNCTION CreatePVectorBalancedvelocities {{{1*/
+
+void Penta::CreatePVectorBalancedvelocities( Vec pg, void* inputs, int analysis_type,int sub_analysis_type){
+
+	/*Collapsed formulation: */
+	Tria*  tria=NULL;
+
+	/*If on water, skip: */
+	if(this->properties.onwater)return;
+
+	/*Is this element on the bed? :*/
+	if(!this->properties.onbed)return;
+
+	/*Spawn Tria element from the base of the Penta: */
+	tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
+	tria->CreatePVector(pg,inputs, analysis_type,sub_analysis_type);
+	delete tria;
+	return;
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Penta.h	(revision 3612)
+++ /issm/trunk/src/c/objects/Penta.h	(revision 3613)
@@ -107,4 +107,8 @@
 		void  CreateKMatrixPrognostic(Mat Kgg,int analysis_type,int sub_analysis_type);
 		void  CreatePVectorPrognostic( Vec pg,  int analysis_type,int sub_analysis_type);
+		void  CreateKMatrixBalancedthickness(Mat Kgg,void* vinputs,int analysis_type,int sub_analysis_type);
+		void  CreatePVectorBalancedthickness( Vec pg, void* vinputs, int analysis_type,int sub_analysis_type);
+		void  CreateKMatrixBalancedvelocities(Mat Kgg,void* vinputs,int analysis_type,int sub_analysis_type);
+		void  CreatePVectorBalancedvelocities( Vec pg, void* vinputs, int analysis_type,int sub_analysis_type);
 
 		void  CreateKMatrixDiagnosticStokes( Mat Kgg,  int analysis_type,int sub_analysis_type);
