Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 17581)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 17582)
@@ -1316,4 +1316,35 @@
 }
 /*}}}*/
+/*FUNCTION Tria::FSContactMigration{{{*/
+void Tria::FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){
+
+	if(!IsOnBed()) return;
+
+	/*Intermediaries*/
+	IssmDouble* xyz_list = NULL;
+
+	/*Figure out wether element is grounded or floating*/
+	bool grounded = true;
+
+	/* Get node coordinates and dof list: */
+	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+
+	/*Retrieve all inputs we will be needing: */
+	Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input);
+	Input* vx_input=inputs->GetInput(VxEnum);             _assert_(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);             _assert_(vy_input);
+
+	_error_("STOP");
+
+	for(i=0;i<NUMVERTICES;i++){
+		if(grounded) vertexgrounded->SetValue(vertices[i]->Pid(),+1.,INS_VAL);
+		else         vertexfloating->SetValue(vertices[i]->Pid(),+1.,INS_VAL);
+	}
+
+	/*clean up*/
+	xDelete<IssmDouble>(xyz_list);
+
+}
+/*}}}*/
 /*FUNCTION Tria::IsNodeOnShelfFromFlags {{{*/
 bool   Tria::IsNodeOnShelfFromFlags(IssmDouble* flags){
@@ -4264,4 +4295,5 @@
 
 	if(migration_style==ContactEnum){
+		for(i=0;i<NUMVERTICES;i++) phi[i]=phi_ungrounding[vertices[i]->Pid()];
 		this->inputs->AddInput(new TriaInput(MaskGroundediceLevelsetEnum,&phi[0],P1Enum));
 		return;
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 17581)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 17582)
@@ -59,5 +59,5 @@
 		void        Delta18oParameterization(void);
 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
-		void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");};
+		void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating);
 		int         FiniteElement(void);
 		Element*    GetUpperElement(void){_error_("not implemented yet");};
