Index: /issm/trunk-jpl/src/c/classes/Elements/Element.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Element.h	(revision 16832)
+++ /issm/trunk-jpl/src/c/classes/Elements/Element.h	(revision 16833)
@@ -151,4 +151,5 @@
 		virtual int    VelocityInterpolation()=0;
 		virtual int    PressureInterpolation()=0;
+		virtual bool   IsZeroLevelset(int levelset_enum)=0;
 
 		#ifdef _HAVE_RESPONSES_
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 16832)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 16833)
@@ -3539,4 +3539,23 @@
 int Penta::PressureInterpolation(void){
 	return PentaRef::PressureInterpolation();
+}
+/*}}}*/
+/*FUNCTION Penta::IsZeroLevelset{{{*/
+bool Penta::IsZeroLevelset(int levelset_enum){
+
+	bool        iszerols;
+	IssmDouble  ls[NUMVERTICES];
+
+	/*Retrieve all inputs and parameters*/
+	GetInputListOnVertices(&ls[0],levelset_enum);
+
+	/*If the level set is awlays <=0, there is no ice front here*/
+	iszerols = false;
+	if(ls[0]>0. || ls[1]>0. || ls[2]>0.){
+		if(ls[0]*ls[1]<0. || ls[0]*ls[2]<0. || (ls[0]*ls[1]+ls[0]*ls[2]+ls[1]*ls[2]==0.)){
+			iszerols = true;
+		}
+	}
+	return iszerols;
 }
 /*}}}*/
@@ -8730,18 +8749,8 @@
 
 	/*Intermediaries */
-	IssmDouble  ls[NUMVERTICES];
 	IssmDouble  xyz_list[NUMVERTICES][3];
 	bool        isfront;
 
-	/*Retrieve all inputs and parameters*/
-	GetInputListOnVertices(&ls[0],MaskIceLevelsetEnum);
-
-	/*If the level set is awlays <=0, there is no ice front here*/
-	isfront = false;
-	if(ls[0]>0. || ls[1]>0. || ls[2]>0.){
-		if(ls[0]*ls[1]<0. || ls[0]*ls[2]<0. || (ls[0]*ls[1]+ls[0]*ls[2]+ls[1]*ls[2]==0.)){
-			isfront = true;
-		}
-	}
+	isfront=IsZeroLevelset(MaskIceLevelsetEnum);
 
 	/*If no front, return NULL*/
@@ -8835,18 +8844,9 @@
 	/*Intermediaries */
 	int         i;
-	IssmDouble  ls[NUMVERTICES];
 	IssmDouble  xyz_list[NUMVERTICES][3];
 	bool        isfront;
 
 	/*Retrieve all inputs and parameters*/
-	GetInputListOnVertices(&ls[0],MaskIceLevelsetEnum);
-
-	/*If the level set is awlays <=0, there is no ice front here*/
-	isfront = false;
-	if(ls[0]>0. || ls[1]>0. || ls[2]>0.){
-		if(ls[0]*ls[1]<0. || ls[0]*ls[2]<0. || (ls[0]*ls[1]+ls[0]*ls[2]+ls[1]*ls[2]==0.)){
-			isfront = true;
-		}
-	}
+	isfront=IsZeroLevelset(MaskIceLevelsetEnum);
 
 	/*If no front, return NULL*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 16832)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 16833)
@@ -113,4 +113,5 @@
 		IssmDouble PureIceEnthalpy(IssmDouble pressure);
 		int    PressureInterpolation();
+		bool   IsZeroLevelset(int levelset_enum);
 
 		void   ResultInterpolation(int* pinterpolation,int output_enum);
Index: /issm/trunk-jpl/src/c/classes/Elements/Seg.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 16832)
+++ /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 16833)
@@ -146,8 +146,10 @@
 		ElementVector* NewElementVector(int approximation_enum){_error_("not implemented yet");};
 		ElementMatrix* NewElementMatrix(int approximation_enum){_error_("not implemented yet");};
-		void           ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not implemented yet");};
-		void           ViscosityFS(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not implemented");};
-		void           ViscosityHO(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not implemented");};
-		void           ViscositySSA(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not implemented");};
+		void        ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not implemented yet");};
+		void        ViscosityFS(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not implemented");};
+		void        ViscosityHO(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not implemented");};
+		void        ViscositySSA(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not implemented");};
+		bool        IsZeroLevelset(int levelset_enum){_error_("not implemented");};
+
 		#ifdef _HAVE_THERMAL_
 		void UpdateBasalConstraintsEnthalpy(void){_error_("not implemented yet");};
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 16832)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 16833)
@@ -2959,4 +2959,24 @@
 }
 /*}}}*/
+/*FUNCTION Tria::IsZeroLevelset{{{*/
+bool Tria::IsZeroLevelset(int levelset_enum){
+
+	bool iszerols;
+	IssmDouble ls[NUMVERTICES];
+
+	/*Retrieve all inputs and parameters*/
+	GetInputListOnVertices(&ls[0],levelset_enum);
+
+	/*If the level set is awlays <0, there is no ice front here*/
+	iszerols= false;
+	if(ls[0]>0. || ls[1]>0. || ls[2]>0.){
+		if(ls[0]*ls[1]<0. || ls[0]*ls[2]<0. || (ls[0]*ls[1]+ls[0]*ls[2]+ls[1]*ls[2]==0.)){
+			iszerols= true;
+		}
+	}
+
+	return iszerols;
+}
+/*}}}*/
 
 #ifdef _HAVE_RESPONSES_
@@ -3904,18 +3924,9 @@
 	/*Intermediaries */
 	int         i;
-	IssmDouble  ls[NUMVERTICES];
 	IssmDouble  xyz_list[NUMVERTICES][3];
 	bool        isfront;
 
-	/*Retrieve all inputs and parameters*/
-	GetInputListOnVertices(&ls[0],MaskIceLevelsetEnum);
-
 	/*If the level set is awlays <=0, there is no ice front here*/
-	isfront = false;
-	if(ls[0]>0. || ls[1]>0. || ls[2]>0.){
-		if(ls[0]*ls[1]<0. || ls[0]*ls[2]<0. || (ls[0]*ls[1]+ls[0]*ls[2]+ls[1]*ls[2]==0.)){
-			isfront = true;
-		}
-	}
+	isfront=IsZeroLevelset(MaskIceLevelsetEnum);
 
 	/*If no front, return NULL*/
@@ -4189,18 +4200,9 @@
 
 	/*Intermediaries */
-	IssmDouble  ls[NUMVERTICES];
 	IssmDouble  xyz_list[NUMVERTICES][3];
 	bool        isfront;
 
-	/*Retrieve all inputs and parameters*/
-	GetInputListOnVertices(&ls[0],MaskIceLevelsetEnum);
-
-	/*If the level set is awlays <0, there is no ice front here*/
-	isfront = false;
-	if(ls[0]>0. || ls[1]>0. || ls[2]>0.){
-		if(ls[0]*ls[1]<0. || ls[0]*ls[2]<0. || (ls[0]*ls[1]+ls[0]*ls[2]+ls[1]*ls[2]==0.)){
-			isfront = true;
-		}
-	}
+	/*Determine if there is an icefront in this element*/
+	isfront=IsZeroLevelset(MaskIceLevelsetEnum);
 
 	/*If no front, return NULL*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 16832)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 16833)
@@ -135,4 +135,5 @@
 		void        Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finitelement);
 		IssmDouble  TimeAdapt();
+		bool        IsZeroLevelset(int levelset_enum);
 
 		#ifdef _HAVE_RESPONSES_
