Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 12092)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 12093)
@@ -793,6 +793,4 @@
 			./modules/TriMeshx/TriMeshx.h\
 			./modules/TriMeshx/TriMeshx.cpp\
-			./modules/TriMeshRiftsx/TriMeshRiftsx.h\
-			./modules/TriMeshRiftsx/TriMeshRiftsx.cpp\
 			./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h\
 			./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp\
Index: /issm/trunk-jpl/src/c/modules/TriMeshRiftsx/TriMeshRiftsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/TriMeshRiftsx/TriMeshRiftsx.cpp	(revision 12092)
+++ /issm/trunk-jpl/src/c/modules/TriMeshRiftsx/TriMeshRiftsx.cpp	(revision 12093)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area,bool order){
+void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
 
 	/*indexing: */
@@ -48,10 +48,9 @@
 		in.numberofpoints+=contour->nods;
 	}
-	if (rifts){
-		for (i=0;i<rifts->Size();i++){
-			contour=(Contour*)rifts->GetObjectByOffset(i);
-			in.numberofpoints+=contour->nods;
-		}
-	}
+	for (i=0;i<rifts->Size();i++){
+		contour=(Contour*)rifts->GetObjectByOffset(i);
+		in.numberofpoints+=contour->nods;
+	}
+
 	/*number of point attributes: */
 	in.numberofpointattributes=1;
@@ -69,12 +68,10 @@
 		}
 	}
-	if(rifts){
-		for (i=0;i<rifts->Size();i++){
-			contour=(Contour*)rifts->GetObjectByOffset(i);
-			for (j=0;j<contour->nods;j++){
-				in.pointlist[2*counter+0]=contour->x[j];
-				in.pointlist[2*counter+1]=contour->y[j];
-				counter++;
-			}
+	for (i=0;i<rifts->Size();i++){
+		contour=(Contour*)rifts->GetObjectByOffset(i);
+		for (j=0;j<contour->nods;j++){
+			in.pointlist[2*counter+0]=contour->x[j];
+			in.pointlist[2*counter+1]=contour->y[j];
+			counter++;
 		}
 	}
@@ -94,10 +91,8 @@
 		in.numberofsegments+=contour->nods;
 	}
-	if(rifts){
-		for(i=0;i<rifts->Size();i++){
-			contour=(Contour*)rifts->GetObjectByOffset(i);
-			/*for rifts, we have one less segment as we have vertices*/
-			in.numberofsegments+=contour->nods-1;
-		}
+	for(i=0;i<rifts->Size();i++){
+		contour=(Contour*)rifts->GetObjectByOffset(i);
+		/*for rifts, we have one less segment as we have vertices*/
+		in.numberofsegments+=contour->nods-1;
 	}
 	
@@ -122,16 +117,14 @@
 	}
 	counter2=counter;
-	if(rifts){
-		for (i=0;i<rifts->Size();i++){
-			contour=(Contour*)rifts->GetObjectByOffset(i);
-			for (j=0;j<(contour->nods-1);j++){
-				in.segmentlist[2*counter2+0]=counter;
-				in.segmentlist[2*counter2+1]=counter+1;
-				in.segmentmarkerlist[counter2]=2+i;
-				counter2++;
-				counter++;
-			}
-			counter++;
-		}
+	for (i=0;i<rifts->Size();i++){
+		contour=(Contour*)rifts->GetObjectByOffset(i);
+		for (j=0;j<(contour->nods-1);j++){
+			in.segmentlist[2*counter2+0]=counter;
+			in.segmentlist[2*counter2+1]=counter+1;
+			in.segmentmarkerlist[counter2]=2+i;
+			counter2++;
+			counter++;
+		}
+		counter++;
 	}
 	
@@ -196,7 +189,5 @@
 
 	/*Order segments so that their normals point outside the domain: */
-	if(order){
-		OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
-	}
+	OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
 
 	/*Output : */
Index: /issm/trunk-jpl/src/c/modules/TriMeshRiftsx/TriMeshRiftsx.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/TriMeshRiftsx/TriMeshRiftsx.h	(revision 12092)
+++ /issm/trunk-jpl/src/c/modules/TriMeshRiftsx/TriMeshRiftsx.h	(revision 12093)
@@ -11,5 +11,5 @@
 
 /* local prototypes: */
-void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area,bool order);
+void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
 
 #endif  /* _TRIMESHX_H */
Index: /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 12092)
+++ /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 12093)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,double area,bool order){
+void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
 
 	/*indexing: */
@@ -35,5 +35,5 @@
 
 	/*intermediary: */
-	int      counter,backcounter;
+	int      counter,counter2,backcounter;
 	Contour* contour=NULL;
 
@@ -48,4 +48,9 @@
 		in.numberofpoints+=contour->nods;
 	}
+	for (i=0;i<rifts->Size();i++){
+		contour=(Contour*)rifts->GetObjectByOffset(i);
+		in.numberofpoints+=contour->nods;
+	}
+
 	/*number of point attributes: */
 	in.numberofpointattributes=1;
@@ -63,7 +68,15 @@
 		}
 	}
+	for (i=0;i<rifts->Size();i++){
+		contour=(Contour*)rifts->GetObjectByOffset(i);
+		for (j=0;j<contour->nods;j++){
+			in.pointlist[2*counter+0]=contour->x[j];
+			in.pointlist[2*counter+1]=contour->y[j];
+			counter++;
+		}
+	}
 	
 	/*fill in the point attribute list: */
-	in.pointattributelist = (REAL *) xmalloc(in.numberofpoints * in.numberofpointattributes * sizeof(REAL));
+	in.pointattributelist = (REAL*)xmalloc(in.numberofpoints*in.numberofpointattributes*sizeof(REAL));
 	for (i=0;i<in.numberofpoints;i++) in.pointattributelist[i] = 0.0;
 	
@@ -77,4 +90,9 @@
 		contour=(Contour*)domain->GetObjectByOffset(i);
 		in.numberofsegments+=contour->nods;
+	}
+	for(i=0;i<rifts->Size();i++){
+		contour=(Contour*)rifts->GetObjectByOffset(i);
+		/*for rifts, we have one less segment as we have vertices*/
+		in.numberofsegments+=contour->nods-1;
 	}
 	
@@ -97,4 +115,16 @@
 		 counter++;
 		 backcounter=counter;
+	}
+	counter2=counter;
+	for (i=0;i<rifts->Size();i++){
+		contour=(Contour*)rifts->GetObjectByOffset(i);
+		for (j=0;j<(contour->nods-1);j++){
+			in.segmentlist[2*counter2+0]=counter;
+			in.segmentlist[2*counter2+1]=counter+1;
+			in.segmentmarkerlist[counter2]=2+i;
+			counter2++;
+			counter++;
+		}
+		counter++;
 	}
 	
@@ -159,7 +189,5 @@
 
 	/*Order segments so that their normals point outside the domain: */
-	if(order){
-		OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
-	}
+	OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
 
 	/*Output : */
Index: /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h	(revision 12092)
+++ /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h	(revision 12093)
@@ -7,10 +7,9 @@
 
 #include "string.h"
-
 #include "../../Container/Container.h"
 #include "../../objects/objects.h"
 
 /* local prototypes: */
-void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,double area,bool order);
+void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
 
 #endif  /* _TRIMESHX_H */
Index: /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 12092)
+++ /issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 12093)
@@ -14,5 +14,4 @@
 
 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole=true){
-
 	
 	/*indexing: */
@@ -128,28 +127,28 @@
 DataSet* DomainOutlineRead(char* domainname,bool whole=true){
 
-	/*indexing: */
-	int i;
-
 	/*intermediary: */
-	int nprof;
-	int* profnvertices=NULL;
-	double** pprofx=NULL;
-	double** pprofy=NULL;
-
-	Contour* contour=NULL;
+	int       nprof;
+	int      *profnvertices = NULL;
+	double  **pprofx        = NULL;
+	double  **pprofy        = NULL;
+	Contour  *contour       = NULL;
 
 	/*output: */
 	DataSet* domain=NULL;
 
-	/*get domain outline from intermediary function:*/
-	DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname,whole);
+	/*If domainname is an empty string, return empty dataset*/
+	if (strcmp(domainname,"")==0){
+		nprof=0;
+	}
+	else{
+		DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname,whole);
+	}
 
 	/*now create dataset of contours: */
 	domain=new DataSet(0);
 
-	for(i=0;i<nprof;i++){
+	for(int i=0;i<nprof;i++){
 		domain->AddObject(new Contour(i,profnvertices[i],pprofx[i],pprofy[i],1));
 	}
-
 	return domain;
 }
Index: /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 12092)
+++ /issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp	(revision 12093)
@@ -8,17 +8,18 @@
 	
 	/* input: */
-	char*  domainname=NULL;
-	double area;
-	bool   order;
+	char   *domainname = NULL;
+	char   *riftsname  = NULL;
+	double  area;
 
 	/*intermediary: */
-	DataSet* domain=NULL;
+	DataSet *domain = NULL;
+	DataSet *rifts  = NULL;
 
 	/* output: */
-	Matrix* index=NULL;
-	Vector* x=NULL;
-	Vector* y=NULL;
-	Matrix* segments=NULL;
-	Vector* segmentmarkerlist=NULL;
+	Matrix *index             = NULL;
+	Vector *x                 = NULL;
+	Vector *y                 = NULL;
+	Matrix *segments          = NULL;
+	Vector *segmentmarkerlist = NULL;
 
 	/*Boot module: */
@@ -30,13 +31,14 @@
 	/*Fetch data needed for meshing: */
 	FetchData(&domainname,DOMAINOUTLINE);
+	FetchData(&riftsname,RIFTSOUTLINE);
 	FetchData(&area,AREA);
-	FetchData(&order,ORDER);
 
 	/*Read domain outline: */
-	domain=DomainOutlineRead(domainname,false);
+	domain = DomainOutlineRead(domainname,false);
+	rifts  = DomainOutlineRead(riftsname,false);
 
 	/*call x core: */
-	TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain,area,order);
-	
+	TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain,rifts,area);
+
 	/*write outputs: */
 	WriteData(INDEX,index);
@@ -48,4 +50,5 @@
 	/*free ressources: */
 	delete domain;
+	delete rifts;
 	xdelete_module(&index);
 	xdelete_module(&x);
@@ -61,11 +64,9 @@
 {
 	printf("\n");
-	printf("   usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,area,ordered) \n");
+	printf("   usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,rifts,area) \n");
 	printf("      where: index,x,y defines a triangulation, segments is an array made \n");
 	printf("      of exterior segments to the mesh domain outline, segmentmarkers is an array flagging each segment, \n");
 	printf("      outlinefilename an Argus domain outline file, \n");
 	printf("      area is the maximum area desired for any element of the resulting mesh, \n");
-	printf("      and ordered is a bool that determines whether segments are output in the \n");
-	printf("      order they are made by Triangle (ie none), or ordered counter clockwise around the domain outline.\n");
 	printf("\n");
 }
Index: /issm/trunk-jpl/src/modules/TriMesh/TriMesh.h
===================================================================
--- /issm/trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 12092)
+++ /issm/trunk-jpl/src/modules/TriMesh/TriMesh.h	(revision 12093)
@@ -31,6 +31,6 @@
 /* serial input macros: */
 #define DOMAINOUTLINE  (mxArray *)prhs[0]
-#define AREA           (mxArray *)prhs[1]
-#define ORDER          (mxArray *)prhs[2]
+#define RIFTSOUTLINE   (mxArray *)prhs[1]
+#define AREA           (mxArray *)prhs[2]
 /* serial output macros: */
 #define INDEX             (mxArray**)&plhs[0]
@@ -44,6 +44,6 @@
 /* serial input macros: */
 #define DOMAINOUTLINE PyTuple_GetItem(args,0)
-#define AREA          PyTuple_GetItem(args,1)
-#define ORDER         PyTuple_GetItem(args,2)
+#define RIFTSOUTLINE  PyTuple_GetItem(args,1)
+#define AREA          PyTuple_GetItem(args,2)
 /* serial output macros: */
 #define INDEX             output,0
Index: /issm/trunk-jpl/src/modules/matlab/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/modules/matlab/Makefile.am	(revision 12092)
+++ /issm/trunk-jpl/src/modules/matlab/Makefile.am	(revision 12093)
@@ -35,5 +35,4 @@
 				TriaSearch\
 				TriMesh\
-				TriMeshRifts\
 				TriMeshProcessRifts\
 				Xy2ll
@@ -156,7 +155,4 @@
 			  ../TriMesh/TriMesh.h
 
-TriMeshRifts_SOURCES = ../TriMeshRifts/TriMeshRifts.cpp\
-			  ../TriMeshRifts/TriMeshRifts.h
-
 TriMeshProcessRifts_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\
 			  ../TriMeshProcessRifts/TriMeshProcessRifts.h
