Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 14647)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 14648)
@@ -253,4 +253,6 @@
 					./modules/VerticesDofx/VerticesDofx.h\
 					./modules/VerticesDofx/VerticesDofx.cpp\
+					./modules/VertexCoordinatesx/VertexCoordinatesx.h\
+					./modules/VertexCoordinatesx/VertexCoordinatesx.cpp\
 					./modules/OutputResultsx/OutputResultsx.h\
 					./modules/OutputResultsx/OutputResultsx.cpp\
Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 14648)
@@ -1542,5 +1542,5 @@
 #endif
 #ifdef _HAVE_GIA_
-void FemModel::Deflection(Vector<IssmDouble>* wg){ /*{{{*/
+void FemModel::Deflection(Vector<IssmDouble>* wg,IssmDouble* x, IssmDouble* y){ /*{{{*/
 
 	int      i;
@@ -1552,7 +1552,7 @@
 	for (i=0;i<elements->Size();i++){
 		element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
-		element->Deflection(wg);
-	}
-}
-/*}}}*/
-#endif
+		element->Deflection(wg,x,y);
+	}
+}
+/*}}}*/
+#endif
Index: /issm/trunk-jpl/src/c/classes/FemModel.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/FemModel.h	(revision 14648)
@@ -94,5 +94,5 @@
 		#endif
 		#ifdef _HAVE_GIA_
-		void Deflection(Vector<IssmDouble>* wg);
+		void Deflection(Vector<IssmDouble>* wg,IssmDouble* x, IssmDouble* y);
 		#endif
 		void SystemMatricesx(Matrix<IssmDouble>** pKff, Matrix<IssmDouble>** pKfs, Vector<IssmDouble>** ppf, Vector<IssmDouble>** pdf, IssmDouble* pkmax);
Index: /issm/trunk-jpl/src/c/classes/objects/Elements/Element.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Elements/Element.h	(revision 14648)
@@ -101,5 +101,5 @@
 
 		#ifdef _HAVE_GIA_
-		virtual void   Deflection(Vector<IssmDouble>* wg)=0;
+		virtual void   Deflection(Vector<IssmDouble>* wg,IssmDouble* x,IssmDouble* y)=0;
 		#endif
 
Index: /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp	(revision 14648)
@@ -3487,7 +3487,6 @@
 #ifdef _HAVE_GIA_
 /*FUNCTION Penta::Deflection {{{*/
-void Penta::Deflection(Vector<IssmDouble>* wg){
-
-	return;
+void Penta::Deflection(Vector<IssmDouble>* wg,IssmDouble* x, IssmDouble* y){
+	_error_("GIA deflection not implemented yet!");
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h	(revision 14648)
@@ -143,5 +143,5 @@
 
 		#ifdef _HAVE_GIA_
-		void   Deflection(Vector<IssmDouble>* wg);
+		void   Deflection(Vector<IssmDouble>* wg,IssmDouble* x,IssmDouble* y);
 		#endif
 
Index: /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp	(revision 14648)
@@ -3041,5 +3041,35 @@
 #ifdef _HAVE_GIA_
 /*FUNCTION Tria::Deflection {{{*/
-void Tria::Deflection(Vector<IssmDouble>* wg){
+void Tria::Deflection(Vector<IssmDouble>* wg,IssmDouble* x, IssmDouble* y){
+
+	int i;
+	int gsize;
+	IssmDouble xi,yi,ri,re,area;
+	IssmDouble x0,y0;
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble he;
+
+	/*how many dofs are we working with here? */
+	gsize=this->nodes[0]->indexing.gsize;
+
+	/*pull thickness average and area: */
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); 
+	if (!thickness_input)_error_("thickness input needed to compute gia deflection!");
+	thickness_input->GetInputAverage(&he);
+	
+	area=this->GetArea();
+
+	/*element radius: */
+	re=sqrt(area/PI);
+
+	/*figure out gravity center of our element: */
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+	x0=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
+	y0=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
+
+	for(i=0;i<gsize;i++){
+		xi=x[i]; yi=y[i];
+		ri=sqrt(pow(xi-x0,2)+pow(yi-y0,2));
+	}
 
 	return;
Index: /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h	(revision 14648)
@@ -141,5 +141,5 @@
 
 		#ifdef _HAVE_GIA_
-		void   Deflection(Vector<IssmDouble>* wg);
+		void   Deflection(Vector<IssmDouble>* wg,IssmDouble* x,IssmDouble* y);
 		#endif
 
Index: /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h	(revision 14648)
@@ -55,4 +55,5 @@
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
 		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
+		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
Index: /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h	(revision 14648)
@@ -60,4 +60,5 @@
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
 		void GetInputAverage(IssmDouble* pvalue);
+		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
Index: /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h	(revision 14648)
@@ -54,4 +54,5 @@
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
+		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
Index: /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h	(revision 14648)
@@ -54,4 +54,5 @@
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
 		void GetInputAverage(IssmDouble* pvalue);
+		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss);
 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss);
Index: /issm/trunk-jpl/src/c/classes/objects/Inputs/Input.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Inputs/Input.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Inputs/Input.h	(revision 14648)
@@ -34,4 +34,5 @@
 		virtual void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss)=0;
 		virtual void GetInputAverage(IssmDouble* pvalue)=0;
+		virtual void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes)=0;
 		virtual void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss)=0;
 		virtual void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss)=0;
Index: /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.h	(revision 14648)
@@ -55,4 +55,6 @@
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
 		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
+		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
+
 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
Index: /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h	(revision 14648)
@@ -55,4 +55,6 @@
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss);
 		void GetInputAverage(IssmDouble* pvalue);
+		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
+
 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
Index: /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp	(revision 14648)
@@ -247,4 +247,11 @@
 }
 /*}}}*/
+/*FUNCTION TransientInput::GetInputAverages{{{*/
+void TransientInput::GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){
+
+	_error_("not implemented yet!");
+
+}
+/*}}}*/
 
 /*Intermediary*/
Index: /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h	(revision 14648)
@@ -57,4 +57,5 @@
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue);
+		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes);
 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
@@ -81,5 +82,5 @@
 		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
 		void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not supported yet");};
-      void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");};
+		void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");};
 		Input* GetTimeInput(IssmDouble time);
 		/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h	(revision 14648)
@@ -55,4 +55,5 @@
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue);
+		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetVxStrainRate2d(IssmDouble* epsilonvx,IssmDouble* xyz_list, GaussTria* gauss);
 		void GetVyStrainRate2d(IssmDouble* epsilonvy,IssmDouble* xyz_list, GaussTria* gauss);
Index: /issm/trunk-jpl/src/c/classes/objects/Vertex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Vertex.cpp	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Vertex.cpp	(revision 14648)
@@ -212,2 +212,14 @@
 }
 /*}}}*/
+/*FUNCTION Vertex::VertexCoordinates {{{*/
+void  Vertex::VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz){
+
+	if (this->clone==true) return;
+
+	vx->SetValue(this->sid,this->x,INS_VAL);
+	vy->SetValue(this->sid,this->y,INS_VAL);
+	vz->SetValue(this->sid,this->z,INS_VAL);
+
+	return;
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/objects/Vertex.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/objects/Vertex.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/classes/objects/Vertex.h	(revision 14648)
@@ -55,4 +55,5 @@
 		void  SetClone(int* minranks);
 		void  ToXYZ(Matrix<IssmDouble>* matrix);
+		void  VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz);
 };
 #endif  /* _VERTEX_H */
Index: /issm/trunk-jpl/src/c/modules/VertexCoordinatesx/CMakeLists.txt
===================================================================
--- /issm/trunk-jpl/src/c/modules/VertexCoordinatesx/CMakeLists.txt	(revision 14648)
+++ /issm/trunk-jpl/src/c/modules/VertexCoordinatesx/CMakeLists.txt	(revision 14648)
@@ -0,0 +1,8 @@
+# Subdirectories {{{
+# }}}
+# Include Directory {{{
+include_directories(AFTER $ENV{ISSM_DIR}/src/c/modules/VerticesDofx)
+# }}}
+# CORE_SOURCES {{{
+set(CORE_SOURCES $ENV{ISSM_DIR}/src/c/modules/VerticesDofx/VerticesDofx.cpp PARENT_SCOPE)
+# }}}
Index: /issm/trunk-jpl/src/c/modules/VertexCoordinatesx/VertexCoordinatesx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/VertexCoordinatesx/VertexCoordinatesx.cpp	(revision 14648)
+++ /issm/trunk-jpl/src/c/modules/VertexCoordinatesx/VertexCoordinatesx.cpp	(revision 14648)
@@ -0,0 +1,58 @@
+/*!\file VertexCoordinatesx
+ * \brief: compute a vector x,y and z of vertex coordinates by 
+ * marching through all our vertices. 
+ */
+
+#include "./VertexCoordinatesx.h"
+
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void VertexCoordinatesx( IssmDouble** px, IssmDouble** py, IssmDouble** pz, Vertices* vertices) {
+
+	/*output: */
+	IssmDouble* x=NULL;
+	IssmDouble* y=NULL;
+	IssmDouble* z=NULL;
+
+	Vector<IssmDouble>* vx=NULL;
+	Vector<IssmDouble>* vy=NULL;
+	Vector<IssmDouble>* vz=NULL;
+
+	/*intermediary: */
+	int  numberofvertices;
+	int  i;
+
+	/*figure out how many vertices we have: */
+	numberofvertices=vertices->NumberOfVertices();
+
+	vx=new Vector<IssmDouble>(numberofvertices);
+	vy=new Vector<IssmDouble>(numberofvertices);
+	vz=new Vector<IssmDouble>(numberofvertices);
+
+	/*march through our vertices: */
+	for(i=0;i<vertices->Size();i++){
+		Vertex* vertex=(Vertex*)vertices->GetObjectByOffset(i);
+		vertex->VertexCoordinates(vx,vy,vz);
+	}
+
+	/*serialize: */
+	x=vx->ToMPISerial();
+	y=vy->ToMPISerial();
+	z=vz->ToMPISerial();
+
+	/*Free ressources: */
+	delete vx;
+	delete vy;
+	delete vz;
+
+	/*output: */
+	if (px)*px=x;
+	else xDelete<IssmDouble>(x);
+	if (py)*py=y;
+	else xDelete<IssmDouble>(y);
+	if (pz)*pz=z;
+	else xDelete<IssmDouble>(z);
+}
Index: /issm/trunk-jpl/src/c/modules/VertexCoordinatesx/VertexCoordinatesx.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/VertexCoordinatesx/VertexCoordinatesx.h	(revision 14648)
+++ /issm/trunk-jpl/src/c/modules/VertexCoordinatesx/VertexCoordinatesx.h	(revision 14648)
@@ -0,0 +1,13 @@
+/*!\file:  VertexCoordinatesx.h
+ */ 
+
+#ifndef _VERTEX_COORDINATESX_H
+#define _VERTEX_COORDINATESX_H
+
+#include "../../Container/Container.h"
+#include "../../classes/objects/objects.h"
+
+/* local prototypes: */
+void VertexCoordinatesx( IssmDouble** px, IssmDouble** py, IssmDouble** pz, Vertices* vertices);
+
+#endif  /* _VERTEX_COORDINATESX_H */
Index: /issm/trunk-jpl/src/c/modules/modules.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/modules.h	(revision 14647)
+++ /issm/trunk-jpl/src/c/modules/modules.h	(revision 14648)
@@ -100,4 +100,5 @@
 #include "./UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h"
 #include "./VerticesDofx/VerticesDofx.h"
+#include "./VertexCoordinatesx/VertexCoordinatesx.h"
 #include "./VecMergex/VecMergex.h"
 #endif
Index: /issm/trunk-jpl/src/c/solutions/gia_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutions/gia_core.cpp	(revision 14647)
+++ /issm/trunk-jpl/src/c/solutions/gia_core.cpp	(revision 14648)
@@ -13,5 +13,8 @@
 void gia_core(FemModel* femmodel){
 	
+	int i;
 	Vector<IssmDouble>*  wg  = NULL;
+	IssmDouble*          x   = NULL;
+	IssmDouble*          y   = NULL;
 
 	/*parameters: */
@@ -33,6 +36,9 @@
 	wg = new Vector<IssmDouble>(gsize);
 
+	/*first, recover x and y vectors from vertices: */
+	VertexCoordinatesx(&x,&y,NULL,femmodel->vertices); //no need for z coordinate
+
 	/*call the main module: */
-	femmodel->Deflection(wg);
+	femmodel->Deflection(wg,x,y);
 	
 	InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,wg); 
