Index: /issm/trunk/src/c/objects/Icefront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Icefront.cpp	(revision 3510)
+++ /issm/trunk/src/c/objects/Icefront.cpp	(revision 3511)
@@ -112,8 +112,27 @@
 	icefront_b[1]=iomodel->bed[i2-1];
 
-	if ((int)*(iomodel->elements_type+2*element+0)==MacAyealFormulationEnum()){ //this is a collapsed 3d element, icefront will be 2d
-		strcpy(icefront_type,"segment");
-	}
-	else if ((int)*(iomodel->elements_type+2*element+0)==PattynFormulationEnum()){ //this is a real 3d element, icefront will be 3d.
+	if (iomodel->sub_analysis_type==HorizAnalysisEnum()){
+		if ((int)*(iomodel->elements_type+2*element+0)==MacAyealFormulationEnum()){ //this is a collapsed 3d element, icefront will be 2d
+			strcpy(icefront_type,"segment");
+		}
+		else if ((int)*(iomodel->elements_type+2*element+0)==PattynFormulationEnum()){ //this is a real 3d element, icefront will be 3d.
+			strcpy(icefront_type,"quad");
+			i3=(int)*(iomodel->pressureload+segment_width*i+2);
+			i4=(int)*(iomodel->pressureload+segment_width*i+3);
+			icefront_node_ids[2]=i3;
+			icefront_node_ids[3]=i4;
+
+			icefront_h[2]=iomodel->thickness[i3-1];
+			icefront_h[3]=iomodel->thickness[i4-1];
+
+			icefront_b[2]=iomodel->bed[i3-1];
+			icefront_b[3]=iomodel->bed[i4-1];
+		}
+		else{
+			ISSMERROR(exprintf(" element type %i not supported yet",(int)*(iomodel->elements_type+2*element+0)));
+		}
+	}
+	else if (iomodel->sub_analysis_type==StokesAnalysisEnum()){
+		//We have a Stokes element, so we need a 3d Icefront
 		strcpy(icefront_type,"quad");
 		i3=(int)*(iomodel->pressureload+segment_width*i+2);
@@ -128,7 +147,5 @@
 		icefront_b[3]=iomodel->bed[i4-1];
 	}
-	else{
-		ISSMERROR(exprintf(" element type %i not supported yet",(int)*(iomodel->elements_type+2*element+0)));
-	}
+	else ISSMERROR("Not supported yet!");
 
 	this->Init(icefront_type,icefront_fill,icefront_sid,icefront_mparid,icefront_eid,icefront_element_type,icefront_node_ids,icefront_h,icefront_b);
Index: /issm/trunk/src/c/objects/Icefront.h
===================================================================
--- /issm/trunk/src/c/objects/Icefront.h	(revision 3510)
+++ /issm/trunk/src/c/objects/Icefront.h	(revision 3511)
@@ -26,16 +26,16 @@
 		char  type[ICEFRONTSTRING];
 		int   fill;
-		int	  sid;
+		int	sid;
 	
 		/*material: */
-		int mparid; //material id
+		int     mparid; //material id
 		Matpar* matpar; 
-		int   matpar_offset;
+		int     matpar_offset;
 	
 		/*element of icefront: */
-		int 	element_type;
-		int     eid;  //id of element on ice front
+		int 	   element_type;
+		int      eid;  //id of element on ice front
 		Element* element;
-		int     element_offset;
+		int      element_offset;
 
 		/*nodes: */
