Index: /issm/trunk/src/c/objects/Element.h
===================================================================
--- /issm/trunk/src/c/objects/Element.h	(revision 300)
+++ /issm/trunk/src/c/objects/Element.h	(revision 301)
@@ -38,4 +38,5 @@
 		virtual void  GradjB(Vec grad_g,double* u_g,double* lambda_g,void* inputs,int analysis_type)=0;
         virtual double Misfit(double* u_g,double* u_g_obs,void* inputs,int analysis_type)=0;
+        virtual void  ComputePressure(Vec p_g)=0;
 
 		int           Enum();
Index: /issm/trunk/src/c/objects/Input.cpp
===================================================================
--- /issm/trunk/src/c/objects/Input.cpp	(revision 300)
+++ /issm/trunk/src/c/objects/Input.cpp	(revision 301)
@@ -150,5 +150,5 @@
 
 		/*Get 1d dof of this node: */
-		dof1=node->GetDoflist1();
+		dof1=node->GetDofList1();
 
 		for(j=0;j<ndofin;j++){
Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 300)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 301)
@@ -426,4 +426,7 @@
 }
 
+int   Node::GetDofList1(void){
+	return doflist1[0];
+}
 
 double Node::GetX(){return x[0];}
@@ -488,5 +491,2 @@
 }
 		
-int   Node::GetDoflist1(void){
-	return doflist1[0];
-}
Index: /issm/trunk/src/c/objects/Node.h
===================================================================
--- /issm/trunk/src/c/objects/Node.h	(revision 300)
+++ /issm/trunk/src/c/objects/Node.h	(revision 301)
@@ -66,5 +66,5 @@
 		void  CreateVecSets(Vec pv_g,Vec pv_m,Vec pv_n,Vec pv_f,Vec pv_s);
 		void  GetDofList(int* outdoflist,int* pnumberofdofspernode);
-		int   GetDoflist1(void);
+		int   GetDofList1(void);
 		double GetX();
 		double GetY();
Index: /issm/trunk/src/c/objects/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Penta.cpp	(revision 300)
+++ /issm/trunk/src/c/objects/Penta.cpp	(revision 301)
@@ -947,5 +947,12 @@
 }
 
-
+void  Penta::GetDofList1(int* doflist){
+
+	int i;
+	for(i=0;i<6;i++){
+		doflist[i]=nodes[i]->GetDofList1();
+	}
+
+}
 #undef __FUNCT__ 
 #define __FUNCT__ "Penta::GetStrainRate"
@@ -1753,2 +1760,34 @@
 
 }
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Penta::ComputePressure"
+void  Penta::ComputePressure(Vec pg){
+
+	int i;
+	const int numgrids=6;
+	int doflist[numgrids];
+	double pressure[numgrids];
+	double rho_ice,g;
+	double       xyz_list[numgrids][3];
+		
+	/*Get node data: */
+	GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
+        
+	/*pressure is lithostatic: */
+	//md.pressure=md.rho_ice*md.g*(md.surface-md.z); a la matlab
+
+	/*Get dof list on which we will plug the pressure values: */
+	GetDofList1(&doflist[0]);
+
+	/*pressure is lithostatic: */
+	rho_ice=matpar->GetRhoIce();
+	g=matpar->GetG();
+	for(i=0;i<numgrids;i++){
+		pressure[i]=rho_ice*g*(s[i]-xyz_list[i][2]);
+	}
+	
+	/*plug local pressure values into global pressure vector: */
+	VecSetValues(pg,numgrids,doflist,(const double*)pressure,INSERT_VALUES);
+
+}
Index: /issm/trunk/src/c/objects/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Penta.h	(revision 300)
+++ /issm/trunk/src/c/objects/Penta.h	(revision 301)
@@ -78,4 +78,5 @@
 		void  UpdateFromInputs(void* inputs);
 		void  GetDofList(int* doflist,int* pnumberofdofs);
+		void  GetDofList1(int* doflist);
 		void* GetMatPar();
 		int   GetShelf();
@@ -109,4 +110,5 @@
 		void  GetNodalFunctions(double* l1l2l3l4l5l6, double* gauss_l1l2l3l4);
 		void  VelocityExtrude(Vec ug,double* ug_serial);
+		void  ComputePressure(Vec p_g);
 
 };
Index: /issm/trunk/src/c/objects/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Tria.cpp	(revision 300)
+++ /issm/trunk/src/c/objects/Tria.cpp	(revision 301)
@@ -905,4 +905,13 @@
 }
 
+void  Tria::GetDofList1(int* doflist){
+
+	int i;
+	for(i=0;i<3;i++){
+		doflist[i]=nodes[i]->GetDofList1();
+	}
+
+}
+
 
 #undef __FUNCT__ 
@@ -1742,4 +1751,5 @@
 	/* node data: */
 	const int    numgrids=3;
+	const int    NDOF1=1;
 	const int    NDOF2=2;
 	const int    numdofs=NDOF2*numgrids;
@@ -2366,2 +2376,27 @@
 
 }
+
+#undef __FUNCT__ 
+#define __FUNCT__ "Tria::ComputePressure"
+void  Tria::ComputePressure(Vec pg){
+
+	int i;
+	const int numgrids=3;
+	int doflist[numgrids];
+	double pressure[numgrids];
+	double rho_ice,g;
+
+	/*Get dof list on which we will plug the pressure values: */
+	GetDofList1(&doflist[0]);
+
+	/*pressure is lithostatic: */
+	rho_ice=matpar->GetRhoIce();
+	g=matpar->GetG();
+	for(i=0;i<numgrids;i++){
+		pressure[i]=rho_ice*g*h[i];
+	}
+	
+	/*plug local pressure values into global pressure vector: */
+	VecSetValues(pg,numgrids,doflist,(const double*)pressure,INSERT_VALUES);
+
+}
Index: /issm/trunk/src/c/objects/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Tria.h	(revision 300)
+++ /issm/trunk/src/c/objects/Tria.h	(revision 301)
@@ -69,5 +69,5 @@
 		void  UpdateFromInputs(void* inputs);
 		void  GetDofList(int* doflist,int* pnumberofdofs);
-		
+		void  GetDofList1(int* doflist);
 		void  CreateKMatrixDiagnosticHoriz(Mat Kgg,void* inputs,int analysis_type);
 		void  CreateKMatrixDiagnosticHorizFriction(Mat Kgg,void* inputs,int analysis_type);
@@ -105,4 +105,5 @@
 		void  MaticeConfiguration(Matice* matice,int matice_offset);
 		void  MatparConfiguration(Matpar* matpar,int matpar_offset);
+		void  ComputePressure(Vec p_g);
 
 
