Index: /issm/trunk-jpl/src/m/classes/model/model.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/model/model.py	(revision 14210)
+++ /issm/trunk-jpl/src/m/classes/model/model.py	(revision 14211)
@@ -45,4 +45,5 @@
 from ElementConnectivity import *
 from contourenvelope import *
+from PythonFuncs import *
 #}}}
 
@@ -407,5 +408,5 @@
 				md2.diagnostic.icefront[:,2]=Pnode[md1.diagnostic.icefront[:,2].astype(int)-1]
 				md2.diagnostic.icefront[:,3]=Pnode[md1.diagnostic.icefront[:,3].astype(int)-1]
-			md2.diagnostic.icefront=md2.diagnostic.icefront[numpy.nonzero(numpy.logical_and(numpy.logical_and(md2.diagnostic.icefront[:,0],md2.diagnostic.icefront[:,1]),md2.diagnostic.icefront[:,-1]))[0],:]
+			md2.diagnostic.icefront=md2.diagnostic.icefront[numpy.nonzero(logical_and_n(md2.diagnostic.icefront[:,0],md2.diagnostic.icefront[:,1],md2.diagnostic.icefront[:,-1]))[0],:]
 
 		#Results fields
Index: /issm/trunk-jpl/src/m/geometry/FlagElements.py
===================================================================
--- /issm/trunk-jpl/src/m/geometry/FlagElements.py	(revision 14210)
+++ /issm/trunk-jpl/src/m/geometry/FlagElements.py	(revision 14211)
@@ -4,4 +4,5 @@
 from ContourToMesh import *
 from MatlabFuncs import *
+from PythonFuncs import *
 
 def FlagElements(md,region):
@@ -43,5 +44,5 @@
 				raise RuntimeError("FlagElements.py calling basinzoom.py is not complete.")
 				xlim,ylim=basinzoom('basin',region)
-				flag_nodes=numpy.logical_and(numpy.logical_and(md.mesh.x<xlim[1],md.mesh.x>xlim[0]),numpy.logical_and(md.mesh.y<ylim[1],md.mesh.y>ylim[0]))
+				flag_nodes=logical_and_n(md.mesh.x<xlim[1],md.mesh.x>xlim[0],md.mesh.y<ylim[1],md.mesh.y>ylim[0])
 				flag=numpy.prod(flag_nodes[md.mesh.elements],axis=1).astype(bool)
 			else:
Index: /issm/trunk-jpl/src/m/mesh/ElementsFromEdge.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/ElementsFromEdge.py	(revision 14210)
+++ /issm/trunk-jpl/src/m/mesh/ElementsFromEdge.py	(revision 14211)
@@ -1,3 +1,4 @@
 import numpy
+from PythonFuncs import *
 
 def ElementsFromEdge(elements,A,B):
@@ -12,14 +13,10 @@
 
 	edgeelements=numpy.nonzero(\
-		numpy.logical_or( \
-		numpy.logical_or( \
-		numpy.logical_or(numpy.logical_and(elements[:,0]==A,elements[:,1]==B), \
-						 numpy.logical_and(elements[:,0]==A,elements[:,2]==B)) \
-		, \
-		numpy.logical_or(numpy.logical_and(elements[:,1]==A,elements[:,2]==B), \
-						 numpy.logical_and(elements[:,1]==A,elements[:,0]==B)) \
-		), \
-		numpy.logical_or(numpy.logical_and(elements[:,2]==A,elements[:,0]==B), \
-						 numpy.logical_and(elements[:,2]==A,elements[:,1]==B)) \
+		logical_or_n(numpy.logical_and(elements[:,0]==A,elements[:,1]==B), \
+					 numpy.logical_and(elements[:,0]==A,elements[:,2]==B), \
+					 numpy.logical_and(elements[:,1]==A,elements[:,2]==B), \
+					 numpy.logical_and(elements[:,1]==A,elements[:,0]==B), \
+					 numpy.logical_and(elements[:,2]==A,elements[:,0]==B), \
+					 numpy.logical_and(elements[:,2]==A,elements[:,1]==B), \
 		))[0]+1
 
Index: /issm/trunk-jpl/src/m/miscellaneous/PythonFuncs.py
===================================================================
--- /issm/trunk-jpl/src/m/miscellaneous/PythonFuncs.py	(revision 14211)
+++ /issm/trunk-jpl/src/m/miscellaneous/PythonFuncs.py	(revision 14211)
@@ -0,0 +1,24 @@
+def logical_and_n(*arg):
+	from numpy import logical_and
+
+	if len(arg):
+		result=arg[0]
+		for item in arg[1:]:
+			result=logical_and(result,item)
+		return result
+
+	else:
+		return None
+
+def logical_or_n(*arg):
+	from numpy import logical_or
+
+	if len(arg):
+		result=arg[0]
+		for item in arg[1:]:
+			result=logical_or(result,item)
+		return result
+
+	else:
+		return None
+
Index: /issm/trunk-jpl/src/m/parameterization/setflowequation.py
===================================================================
--- /issm/trunk-jpl/src/m/parameterization/setflowequation.py	(revision 14210)
+++ /issm/trunk-jpl/src/m/parameterization/setflowequation.py	(revision 14211)
@@ -3,4 +3,5 @@
 from pairoptions import *
 from MatlabFuncs import *
+from PythonFuncs import *
 from FlagElements import *
 
@@ -50,9 +51,9 @@
 	#Flag the elements that have not been flagged as filltype
 	if   strcmpi(filltype,'hutter'):
-		hutterflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(macayealflag,pattynflag)))]=True
+		hutterflag[numpy.nonzero(numpy.logical_not(logical_or_n(macayealflag,pattynflag)))]=True
 	elif strcmpi(filltype,'macayeal'):
-		macayealflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(pattynflag,stokesflag))))]=True
+		macayealflag[numpy.nonzero(numpy.logical_not(logical_or_n(hutterflag,pattynflag,stokesflag)))]=True
 	elif strcmpi(filltype,'pattyn'):
-		pattynflag[numpy.nonzero(numpy.logical_not(numpy.logical_or(hutterflag,numpy.logical_or(macayealflag,stokesflag))))]=True
+		pattynflag[numpy.nonzero(numpy.logical_not(logical_or_n(hutterflag,macayealflag,stokesflag)))]=True
 
 	#check that each element has at least one flag
@@ -69,5 +70,5 @@
 	#Check that no pattyn or stokes for 2d mesh
 	if md.mesh.dimension==2:
-		if numpy.any(numpy.logical_or(l1l2flag,stokesflag,pattynflag)):
+		if numpy.any(logical_or_n(l1l2flag,stokesflag,pattynflag)):
 			raise TypeError("stokes and pattyn elements not allowed in 2d mesh, extrude it first")
 
