Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4393)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4394)
@@ -2142,25 +2142,130 @@
 /*FUNCTION Penta::InputUpdateFromBedSlopeXCompute {{{1*/
 void  Penta::InputUpdateFromBedSlopeXCompute(double* solution){
-	ISSMERROR(" not supported yet!");
+
+	int i;
+
+	const int    numvertices=6;
+	const int    numdofpervertex=1;
+	const int    numdof=numdofpervertex*numvertices;
+
+	int          doflist[numdof];
+	double       values[numdof];
+
+	int          dummy;
+
+	/*Get dof list: */
+	GetDofList(&doflist[0],&dummy);
+
+	/*Use the dof list to index into the solution vector: */
+	for(i=0;i<numdof;i++){
+		values[i]=solution[doflist[i]];
+	}
+
+	/*Add bedslopex as inputs to the tria element: */
+	this->inputs->AddInput(new PentaVertexInput(BedSlopeXEnum,values));
 }
 /*}}}*/
 /*FUNCTION Penta::InputUpdateFromBedSlopeYCompute {{{1*/
 void  Penta::InputUpdateFromBedSlopeYCompute(double* solution){
-	ISSMERROR(" not supported yet!");
+
+	int i;
+
+	const int    numvertices=6;
+	const int    numdofpervertex=1;
+	const int    numdof=numdofpervertex*numvertices;
+
+	int          doflist[numdof];
+	double       values[numdof];
+
+	int          dummy;
+
+	/*Get dof list: */
+	GetDofList(&doflist[0],&dummy);
+
+	/*Use the dof list to index into the solution vector: */
+	for(i=0;i<numdof;i++){
+		values[i]=solution[doflist[i]];
+	}
+
+	/*Add bedslopey as inputs to the tria element: */
+	this->inputs->AddInput(new PentaVertexInput(BedSlopeYEnum,values));
 }
 /*}}}*/
 /*FUNCTION Penta::InputUpdateFromSurfaceSlopeXCompute {{{1*/
 void  Penta::InputUpdateFromSurfaceSlopeXCompute(double* solution){
-	ISSMERROR(" not supported yet!");
+
+	int i;
+
+	const int    numvertices=6;
+	const int    numdofpervertex=1;
+	const int    numdof=numdofpervertex*numvertices;
+
+	int          doflist[numdof];
+	double       values[numdof];
+
+	int          dummy;
+
+	/*Get dof list: */
+	GetDofList(&doflist[0],&dummy);
+
+	/*Use the dof list to index into the solution vector: */
+	for(i=0;i<numdof;i++){
+		values[i]=solution[doflist[i]];
+	}
+
+	/*Add surfaceslopex as inputs to the tria element: */
+	this->inputs->AddInput(new PentaVertexInput(SurfaceSlopeXEnum,values));
 }
 /*}}}*/
 /*FUNCTION Penta::InputUpdateFromSurfaceSlopeYCompute {{{1*/
 void  Penta::InputUpdateFromSurfaceSlopeYCompute(double* solution){
-	ISSMERROR(" not supported yet!");
+
+	int i;
+
+	const int    numvertices=6;
+	const int    numdofpervertex=1;
+	const int    numdof=numdofpervertex*numvertices;
+
+	int          doflist[numdof];
+	double       values[numdof];
+
+	int          dummy;
+
+	/*Get dof list: */
+	GetDofList(&doflist[0],&dummy);
+
+	/*Use the dof list to index into the solution vector: */
+	for(i=0;i<numdof;i++){
+		values[i]=solution[doflist[i]];
+	}
+
+	/*Add surfaceslopey as inputs to the tria element: */
+	this->inputs->AddInput(new PentaVertexInput(SurfaceSlopeYEnum,values));
 }
 /*}}}*/
 /*FUNCTION Penta::InputUpdateFromSolutionPrognostic {{{1*/
 void  Penta::InputUpdateFromSolutionPrognostic(double* solution){
-	ISSMERROR(" not supported yet!");
+
+	int i;
+
+	const int    numvertices=6;
+	const int    numdofpervertex=1;
+	const int    numdof=numdofpervertex*numvertices;
+
+	int          doflist[numdof];
+	double       values[numdof];
+
+	int          dummy;
+
+	/*Get dof list: */
+	GetDofList(&doflist[0],&dummy);
+
+	/*Use the dof list to index into the solution vector: */
+	for(i=0;i<numdof;i++){
+		values[i]=solution[doflist[i]];
+	}
+
+	/*Add thickness as inputs to the tria element: */
+	this->inputs->AddInput(new PentaVertexInput(ThicknessEnum,values));
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 4393)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 4394)
@@ -340,4 +340,7 @@
 	}
 	else if (analysis_type==DiagnosticHorizAnalysisEnum){
+		InputUpdateFromSolutionDiagnosticHoriz( solution);
+	}
+	else if (analysis_type==DiagnosticHutterAnalysisEnum){
 		InputUpdateFromSolutionDiagnosticHoriz( solution);
 	}
@@ -5502,4 +5505,82 @@
 }
 /*}}}*/
+/*FUNCTION Tria::InputUpdateFromSolutionDiagnosticHutter {{{1*/
+void  Tria::InputUpdateFromSolutionDiagnosticHutter(double* solution){
+	
+	int i;
+
+	const int    numvertices=3;
+	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];
+	double       pressure[numvertices];
+	double       thickness[numvertices];
+	double       rho_ice,g;
+	double       gauss[numvertices][numvertices]={{1,0,0},{0,1,0},{0,0,1}};
+
+	int          dummy;
+	Input*       VzInput=NULL;
+	double*      VzPtr=NULL;
+	
+	/*Get dof list: */
+	GetDofList(&doflist[0],&dummy);
+
+	/*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()!=TriaVertexInputEnum){
+			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 2D, 
+	 *so the pressure is just the pressure at the bedrock: */
+	rho_ice=matpar->GetRhoIce();
+	g=matpar->GetG();
+	inputs->GetParameterValues(&thickness[0],&gauss[0][0],3,ThicknessEnum);
+	
+	for(i=0;i<numvertices;i++){
+		pressure[i]=rho_ice*g*thickness[i];
+	}
+
+	/*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 TriaVertexInput(VxEnum,vx));
+	this->inputs->AddInput(new TriaVertexInput(VyEnum,vy));
+	this->inputs->AddInput(new TriaVertexInput(VelEnum,vel));
+	this->inputs->AddInput(new TriaVertexInput(PressureEnum,pressure));
+
+}
+/*}}}*/
 /*FUNCTION Tria::InputUpdateFromSolutionBedSlopeX {{{1*/
 void  Tria::InputUpdateFromSolutionBedSlopeX(double* solution){
@@ -5617,5 +5698,4 @@
 	int          doflist[numdof];
 	double       values[numdof];
-	double       thickness[numvertices];
 
 	int          dummy;
Index: /issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.h	(revision 4393)
+++ /issm/trunk/src/c/objects/Elements/Tria.h	(revision 4394)
@@ -155,4 +155,5 @@
 		void	  InputUpdateFromSolutionAdjoint( double* solution);
 		void	  InputUpdateFromSolutionDiagnosticHoriz( double* solution);
+		void	  InputUpdateFromSolutionDiagnosticHutter( double* solution);
 		void	  InputUpdateFromSolutionBedSlopeX( double* solution);
 		void	  InputUpdateFromSolutionBedSlopeY( double* solution);
