Index: issm/trunk-jpl/src/m/mesh/triangle.py
===================================================================
--- issm/trunk-jpl/src/m/mesh/triangle.py	(revision 23716)
+++ issm/trunk-jpl/src/m/mesh/triangle.py	(revision 24115)
@@ -5,63 +5,66 @@
 from ElementConnectivity import ElementConnectivity
 from Triangle_python import Triangle_python
-import MatlabFuncs as m
 
-def triangle(md,domainname,*args):
-	"""
-	TRIANGLE - create model mesh using the triangle package
 
-	   This routine creates a model mesh using Triangle and a domain outline, to within a certain resolution
-	   where md is a @model object, domainname is the name of an Argus domain outline file, 
-	   and resolution is a characteristic length for the mesh (same unit as the domain outline
-	   unit). Riftname is an optional argument (Argus domain outline) describing rifts.
+def triangle(md, domainname, *args):
+    """
+    TRIANGLE - create model mesh using the triangle package
 
-	   Usage:
-	      md=triangle(md,domainname,resolution)
-	   or md=triangle(md,domainname, resolution, riftname)
+       This routine creates a model mesh using Triangle and a domain outline, to within a certain resolution
+       where md is a @model object, domainname is the name of an Argus domain outline file,
+       and resolution is a characteristic length for the mesh (same unit as the domain outline
+       unit). Riftname is an optional argument (Argus domain outline) describing rifts.
 
-	   Examples:
-	      md=triangle(md,'DomainOutline.exp',1000);
-	      md=triangle(md,'DomainOutline.exp',1000,'Rifts.exp');
-	"""
+       Usage:
+          md=triangle(md,domainname,resolution)
+       or md=triangle(md,domainname, resolution, riftname)
 
-	#Figure out a characteristic area. Resolution is a node oriented concept (ex a 1000m  resolution node would 
-	#be made of 1000*1000 area squares). 
+       Examples:
+          md=triangle(md,'DomainOutline.exp',1000);
+          md=triangle(md,'DomainOutline.exp',1000,'Rifts.exp');
+    """
 
-	if len(args)==1:
-		resolution=args[0]
-		riftname=''
-	if len(args)==2:
-		riftname=args[0]
-		resolution=args[1]
+    #Figure out a characteristic area. Resolution is a node oriented concept (ex a 1000m  resolution node would
+    #be made of 1000*1000 area squares).
 
-	#Check that mesh was not already run, and warn user: 
-	if md.mesh.numberofelements:
-		choice = eval(input('This model already has a mesh. Are you sure you want to go ahead? (y/n)'))
-		if not m.strcmp(choice,'y'):
-			print('no meshing done ... exiting')
-			return None
+    if len(args) == 1:
+        resolution = args[0]
+        riftname = ''
+    if len(args) == 2:
+        riftname = args[0]
+        resolution = args[1]
 
-	area = resolution**2
+    #Check that mesh was not already run, and warn user:
+    if md.mesh.numberofelements:
+        choice = eval(input('This model already has a mesh. Are you sure you want to go ahead? (y/n)'))
+        if choice not in ['y', 'n']:
+            print("bad answer try you should use 'y' or 'n' ... exiting")
+            return None
+        if choice == 'n':
+            print('no meshing done ... exiting')
+            return None
 
-	#Check that file exist (this is a very very common mistake)
-	if not os.path.exists(domainname):
-		raise IOError("file '%s' not found" % domainname)
+    area = resolution**2
 
-	#Mesh using Triangle
-	md.mesh=mesh2d()
-	md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers=Triangle_python(domainname,riftname,area)
-	md.mesh.elements=md.mesh.elements.astype(int)
-	md.mesh.segments=md.mesh.segments.astype(int)
-	md.mesh.segmentmarkers=md.mesh.segmentmarkers.astype(int)
+    #Check that file exist (this is a very very common mistake)
+    if not os.path.exists(domainname):
+        raise IOError("file '%s' not found" % domainname)
 
-	#Fill in rest of fields:
-	md.mesh.numberofelements = np.size(md.mesh.elements,axis=0)
-	md.mesh.numberofvertices = np.size(md.mesh.x)
-	md.mesh.vertexonboundary = np.zeros(md.mesh.numberofvertices,bool)
-	md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1] = True
+    #Mesh using Triangle
+    md.mesh = mesh2d()
+    md.mesh.elements, md.mesh.x, md.mesh.y, md.mesh.segments, md.mesh.segmentmarkers = Triangle_python(domainname, riftname, area)
+    md.mesh.elements = md.mesh.elements.astype(int)
+    md.mesh.segments = md.mesh.segments.astype(int)
+    md.mesh.segmentmarkers = md.mesh.segmentmarkers.astype(int)
 
-	#Now, build the connectivity tables for this mesh.
-	md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)[0]
-	md.mesh.elementconnectivity = ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)[0]
+    #Fill in rest of fields:
+    md.mesh.numberofelements = np.size(md.mesh.elements, axis=0)
+    md.mesh.numberofvertices = np.size(md.mesh.x)
+    md.mesh.vertexonboundary = np.zeros(md.mesh.numberofvertices, bool)
+    md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = True
 
-	return md
+    #Now, build the connectivity tables for this mesh.
+    md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)[0]
+    md.mesh.elementconnectivity = ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)[0]
+
+    return md
