Index: ../trunk-jpl/src/m/classes/mask.m
===================================================================
--- ../trunk-jpl/src/m/classes/mask.m	(revision 18648)
+++ ../trunk-jpl/src/m/classes/mask.m	(revision 18649)
@@ -52,6 +52,10 @@
 			if max(md.mask.ice_levelset)<0,
 				warning('no ice front provided');
 			end
+			icefront=sum(md.mask.ice_levelset(md.mesh.elements)==0,2);
+			if (max(icefront)==3 & strcmp(elementtype(md.mesh),'Tria')) | (max(icefront==6) & strcmp(elementtype(md.mesh),'Penta')),
+				error('At least one element has all nodes on ice front, change md.mask.ice_levelset to fix it')
+			end
 		end % }}}
 		function disp(obj) % {{{
 			disp(sprintf('   masks:'));
Index: ../trunk-jpl/src/m/classes/mask.py
===================================================================
--- ../trunk-jpl/src/m/classes/mask.py	(revision 18648)
+++ ../trunk-jpl/src/m/classes/mask.py	(revision 18649)
@@ -37,6 +37,10 @@
 		if numpy.sum(isice)==0:
 			raise TypeError("no ice present in the domain")
 
+		icefront=numpy.sum(md.mask.ice_levelset[md.mesh.elements]==0,2)
+		if (max(icefront)==3 and m.strcmp(md.mesh.elementtype(),'Tria')) or (max(icefront==6) and m.strcmp(md.mesh.elementtype(),'Penta')):
+			raise TypeError("At least one element has all nodes on ice front, change md.mask.ice_levelset to fix it")
+
 		return md
 	# }}}
 	def marshall(self,md,fid):    # {{{
