Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4433)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4434)
@@ -355,4 +355,7 @@
 	else if (analysis_type==DiagnosticHorizAnalysisEnum){
 		InputUpdateFromSolutionDiagnosticHoriz( solution);
+	}
+	else if (analysis_type==DiagnosticHutterAnalysisEnum){
+		InputUpdateFromSolutionDiagnosticHutter( solution);
 	}
 	else if (analysis_type==DiagnosticVertAnalysisEnum){
@@ -1944,4 +1947,85 @@
 /*FUNCTION Penta::InputUpdateFromSolutionDiagnosticHoriz {{{1*/
 void  Penta::InputUpdateFromSolutionDiagnosticHoriz(double* solution){
+	
+	int i;
+
+	const int    numvertices=6;
+	const int    numdofpervertex=2;
+	const int    numdof=numdofpervertex*numvertices;
+	
+	int          doflist[numdof];
+	double       values[numdof];
+	double       vx[numvertices];
+	double       vy[numvertices];
+	double       vz[numvertices];
+	double       vel[numvertices];
+	int          dummy;
+	double       pressure[numvertices];
+	double       surface[numvertices];
+	double       rho_ice,g;
+	double       xyz_list[numvertices][3];
+	double       gauss[numvertices][numvertices]={{1,0,0,0},{0,1,0,0},{0,0,1,0},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
+	
+	Input*       VzInput=NULL;
+	double*      VzPtr=NULL;
+
+	/*Get dof list: */
+	GetDofList(&doflist[0],&dummy);
+
+	/*Get node data: */
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, numvertices);
+
+	/*Use the dof list to index into the solution vector: */
+	for(i=0;i<numdof;i++){
+		values[i]=solution[doflist[i]];
+	}
+
+	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+	for(i=0;i<numvertices;i++){
+		vx[i]=values[i*numdofpervertex+0];
+		vy[i]=values[i*numdofpervertex+1];
+	}
+
+	/*Get Vz*/
+	VzInput=inputs->GetInput(VzEnum);
+	if (VzInput){
+		if (VzInput->Enum()!=PentaVertexInputEnum){
+			ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(VzInput->Enum()));
+		}
+		VzInput->GetValuesPtr(&VzPtr,&dummy);
+		for(i=0;i<numvertices;i++) vz[i]=VzPtr[i];
+	}
+	else{
+		for(i=0;i<numvertices;i++) vz[i]=0.0;
+	}
+
+	/*Now Compute vel*/
+	for(i=0;i<numvertices;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+
+	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D, 
+	 *so the pressure is just the pressure at the z elevation: */
+	rho_ice=matpar->GetRhoIce();
+	g=matpar->GetG();
+	inputs->GetParameterValues(&surface[0],&gauss[0][0],6,SurfaceEnum);
+	
+	for(i=0;i<numvertices;i++){
+		pressure[i]=rho_ice*g*(surface[i]-xyz_list[i][2]);
+	}
+	/*Now, we have to move the previous Vx and Vy inputs  to old 
+	 * status, otherwise, we'll wipe them off: */
+	this->inputs->ChangeEnum(VxEnum,VxOldEnum);
+	this->inputs->ChangeEnum(VyEnum,VyOldEnum);
+	this->inputs->ChangeEnum(PressureEnum,PressureOldEnum);
+
+	/*Add vx and vy as inputs to the tria element: */
+	this->inputs->AddInput(new PentaVertexInput(VxEnum,vx));
+	this->inputs->AddInput(new PentaVertexInput(VyEnum,vy));
+	this->inputs->AddInput(new TriaVertexInput(VelEnum,vel));
+	this->inputs->AddInput(new PentaVertexInput(PressureEnum,pressure));
+}
+
+/*}}}*/
+/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticHutter {{{1*/
+void  Penta::InputUpdateFromSolutionDiagnosticHutter(double* solution){
 	
 	int i;
Index: /issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.h	(revision 4433)
+++ /issm/trunk/src/c/objects/Elements/Penta.h	(revision 4434)
@@ -171,4 +171,5 @@
 		void    InputUpdateFromSolutionBalancedvelocities( double* solutiong);
 		void    InputUpdateFromSolutionDiagnosticHoriz( double* solutiong);
+		void    InputUpdateFromSolutionDiagnosticHutter( double* solutiong);
 		void    InputUpdateFromSolutionDiagnosticVert( double* solutiong);
 		void    InputUpdateFromSolutionDiagnosticStokes( double* solutiong);
