Index: sm/trunk/externalpackages/meshpart/Makefile.patch
===================================================================
--- /issm/trunk/externalpackages/meshpart/Makefile.patch	(revision 3011)
+++ 	(revision )
@@ -1,69 +1,0 @@
-27c27,28
-< MATLAB =        /usr/local/libexec/matlab
----
-> #MATLAB =        /usr/local/libexec/matlab
-> MATLAB =        /usr/local/pkgs/matlab-7.8
-30c31,32
-< CHACO =         ../../Chaco-2.0/code
----
-> #CHACO =         ../../Chaco-2.0/code
-> CHACO =         ../../../chaco/src/code
-34,35c36,37
-< #CC =            gcc 
-< CC =            cc 
----
-> CC =            gcc 
-> #CC =            cc 
-37,40c39,46
-< CFLAGS =        -Xa -G -xO4 -xcg92
-< OFLAGS =        -xO4 -xcg92
-< AR =             /usr/ccs/bin/ar rcv   # for solaris 2
-< RANLIB =         /usr/ccs/bin/ranlib   # for solaris 2
----
-> #CFLAGS =        -Xa -G -xO4 -xcg92
-> CFLAGS =        -fPIC -fno-omit-frame-pointer -pthread -fexceptions -DMATLAB
-> #OFLAGS =        -xO4 -xcg92
-> OFLAGS =        -O2
-> #AR =             /usr/ccs/bin/ar rcv   # for solaris 2
-> AR =             /usr/bin/ar rcv
-> #RANLIB =         /usr/ccs/bin/ranlib   # for solaris 2
-> RANLIB =         /usr/bin/ranlib
-45,47d50
-< 		${MLCHACO}/chaco_check_graph.c \
-< 		${MLCHACO}/check_input.c \
-<                 ${MLCHACO}/smalloc.c \
-48a52,54
-> #		${MLCHACO}/chaco_check_graph.c \
-> #		${MLCHACO}/check_input.c \
-> #                ${MLCHACO}/smalloc.c \
-55a62
-> 		${CHACO}/input/check_input.c \
-61a69
-> 		${CHACO}/graph/check_graph.c \
-91a100
-> 		${CHACO}/klvspiff/flow.c \
-97a107
-> 		${CHACO}/klvspiff/flatten.c \
-100c110,111
-< 		${CHACO}/coarsen/makecgraph.c \
----
-> 		${CHACO}/coarsen/makefgraph.c \
-> 		${CHACO}/coarsen/makeccoords.c \
-102d112
-< 		${CHACO}/coarsen/countcedges.c \
-108a119
-> 		${CHACO}/coarsen/maxmatch5.c \
-234a246
-> 		${CHACO}/util/smalloc.c \
-245a258,259
-> #		${CHACO}/main/user_params.c \
-> #		${CHACO}/util/bail.c \
-254a269,272
-> #mlchaco:	${MLFILES.c} chaco.a Makefile
-> #		mex -V4 -output mlchaco ${MLFILES.c} chaco.a -I${CHACO}/main
-> #		mv mlchaco.mex* ${DEST_DIR}
-> 
-256c274
-< 		mex -V4 -output mlchaco ${MLFILES.c} chaco.a -I${CHACO}/main
----
-> 		mex -output mlchaco -largeArrayDims -DMATLAB ${MLFILES.c} chaco.a -I${CHACO}/main
Index: sm/trunk/externalpackages/meshpart/chaco.m.patch
===================================================================
--- /issm/trunk/externalpackages/meshpart/chaco.m.patch	(revision 3011)
+++ 	(revision )
@@ -1,5 +1,0 @@
-145c145,146
-<     vwgts = full(Adiag);
----
-> %     vwgts = full(Adiag);
->     vwgts = full(diag(A));
Index: sm/trunk/externalpackages/meshpart/fiedler.m.patch
===================================================================
--- /issm/trunk/externalpackages/meshpart/fiedler.m.patch	(revision 3011)
+++ 	(revision )
@@ -1,8 +1,0 @@
-61c61,65
-<     p = symmmd(L);
----
->     if exist('symamd')
->         p = symamd(L);
->     else
->         p = symmmd(L);
->     end
Index: /issm/trunk/externalpackages/meshpart/install.sh
===================================================================
--- /issm/trunk/externalpackages/meshpart/install.sh	(revision 3011)
+++ /issm/trunk/externalpackages/meshpart/install.sh	(revision 3012)
@@ -1,28 +1,26 @@
 #!/bin/bash
 
-#Some cleanup
+# Some cleanup
 rm -rf meshpart
 rm -rf src 
 rm -rf install 
 
-#Create src and install directories
+# Create src and install directories
 mkdir src install 
 
-#Untar 
+# Untar 
 tar -xvzf meshpart-020208.tar.gz
 mkdir meshpart/metis
 tar -xvzf metismex-4.0.tar.gz -C meshpart/metis
+#proto.h in metis library is not patched, at least for metismex, so create a local version
+cp ../metis/install/Lib/proto.h meshpart/metis
 
-#Move meshpart to src directory
+# Move meshpart to src directory
 mv meshpart/* src
 rm -rf meshpart
 
-#Apply patches
-patch src/fiedler.m fiedler.m.patch
-patch src/chaco.m chaco.m.patch
-patch src/meshdemo.m meshdemo.m.patch
-patch src/metis/metismex.c metismex.c.patch
-patch src/chaco/mlchaco.c mlchaco.c.patch
-patch src/chaco/Makefile Makefile.patch
+# Apply patches (all at once)
+# (written by diff -rc src ~/Libs/meshpart > meshpart.patch)
+patch -p0 < meshpart.patch
 
 #Nothing to build for meshpart itself
@@ -30,9 +28,8 @@
 #Build metismex
 cd src/metis
-#proto.h in metis library is not patched, at least for metismex, so create a local version
+#proto.h in metis library is not patched, at least for metismex, so link with local version
 #mex -I../../../metis/install/Lib -L../../../metis/install -lmetis -largeArrayDims metismex.c
-cp ../../../metis/install/Lib/proto.h .
-patch proto.h ../../proto.h.patch
 mex -I. -I../../../metis/install/Lib -L../../../metis/install -lmetis -largeArrayDims metismex.c
+mv metismex.mex* ..
 cd ../..
 
Index: sm/trunk/externalpackages/meshpart/meshdemo.m.patch
===================================================================
--- /issm/trunk/externalpackages/meshpart/meshdemo.m.patch	(revision 3011)
+++ 	(revision )
@@ -1,4 +1,0 @@
-100c100
-< usechaco = 0;
----
-> usechaco = 1;
Index: /issm/trunk/externalpackages/meshpart/meshpart.patch
===================================================================
--- /issm/trunk/externalpackages/meshpart/meshpart.patch	(revision 3012)
+++ /issm/trunk/externalpackages/meshpart/meshpart.patch	(revision 3012)
@@ -0,0 +1,482 @@
+Only in /home/jschierm/Libs/meshpart: adjacency_matrix.m
+diff -rc src/chaco/Makefile /home/jschierm/Libs/meshpart/chaco/Makefile
+*** src/chaco/Makefile	1998-07-06 13:08:26.000000000 -0700
+--- /home/jschierm/Libs/meshpart/chaco/Makefile	2010-02-10 15:20:30.140413675 -0800
+***************
+*** 24,51 ****
+  # See file ../copyright.m for complete copyright and licensing notice.
+  
+  #MATLAB =        /import/matlab
+! MATLAB =        /usr/local/libexec/matlab
+  
+  #CHACO =         /project/sparse/chaco/version2/code
+! CHACO =         ../../Chaco-2.0/code
+  
+  MLCHACO =       .
+  DEST_DIR =      ..
+! #CC =            gcc 
+! CC =            cc 
+  IFLAGS =	-I${MATLAB}/extern/include -I${CHACO}/main
+! CFLAGS =        -Xa -G -xO4 -xcg92
+! OFLAGS =        -xO4 -xcg92
+! AR =             /usr/ccs/bin/ar rcv   # for solaris 2
+! RANLIB =         /usr/ccs/bin/ranlib   # for solaris 2
+  
+  
+  MLFILES.c=	${MLCHACO}/mlchaco.c \
+  		${MLCHACO}/bail.c \
+- 		${MLCHACO}/chaco_check_graph.c \
+- 		${MLCHACO}/check_input.c \
+-                 ${MLCHACO}/smalloc.c \
+                  ${MLCHACO}/user_params.c
+  
+  CHFILES.c=	${CHACO}/main/interface.c \
+  		${CHACO}/main/main.c \
+--- 24,58 ----
+  # See file ../copyright.m for complete copyright and licensing notice.
+  
+  #MATLAB =        /import/matlab
+! #MATLAB =        /usr/local/libexec/matlab
+! MATLAB =        /usr/local/pkgs/matlab-7.6
+  
+  #CHACO =         /project/sparse/chaco/version2/code
+! #CHACO =         ../../Chaco-2.0/code
+! #CHACO =         ../../Chaco-2.2/code
+! CHACO =         ../../../chaco/src/code
+  
+  MLCHACO =       .
+  DEST_DIR =      ..
+! CC =            gcc 
+! #CC =            cc 
+  IFLAGS =	-I${MATLAB}/extern/include -I${CHACO}/main
+! #CFLAGS =        -Xa -G -xO4 -xcg92
+! CFLAGS =        -fPIC -fno-omit-frame-pointer -pthread -fexceptions -DMATLAB
+! #OFLAGS =        -xO4 -xcg92
+! OFLAGS =        -O2
+! #AR =             /usr/ccs/bin/ar rcv   # for solaris 2
+! AR =             /usr/bin/ar rcv   # for solaris 2
+! #RANLIB =         /usr/ccs/bin/ranlib   # for solaris 2
+! RANLIB =         /usr/bin/ranlib   # for solaris 2
+  
+  
+  MLFILES.c=	${MLCHACO}/mlchaco.c \
+  		${MLCHACO}/bail.c \
+                  ${MLCHACO}/user_params.c
++ #		${MLCHACO}/chaco_check_graph.c \
++ #		${MLCHACO}/check_input.c \
++ #                ${MLCHACO}/smalloc.c \
+  
+  CHFILES.c=	${CHACO}/main/interface.c \
+  		${CHACO}/main/main.c \
+***************
+*** 53,64 ****
+--- 60,73 ----
+  		${CHACO}/submain/divide.c \
+  		${CHACO}/submain/submain.c \
+  		${CHACO}/input/input_assign.c \
++ 		${CHACO}/input/check_input.c \
+  		${CHACO}/input/input.c \
+  		${CHACO}/input/input_geom.c \
+  		${CHACO}/input/input_graph.c \
+  		${CHACO}/input/read_params.c \
+  		${CHACO}/input/reflect_input.c \
+  		${CHACO}/input/read_val.c \
++ 		${CHACO}/graph/check_graph.c \
+  		${CHACO}/graph/free_graph.c \
+  		${CHACO}/graph/reformat.c \
+  		${CHACO}/graph/subgraph.c \
+***************
+*** 89,111 ****
+  		${CHACO}/klvspiff/coarsen_klv.c \
+  		${CHACO}/klvspiff/countup_vtx_sep.c \
+  		${CHACO}/klvspiff/find_bndy.c \
+  		${CHACO}/klvspiff/klv_init.c \
+  		${CHACO}/klvspiff/klvspiff.c \
+  		${CHACO}/klvspiff/make_bpgraph.c \
+  		${CHACO}/klvspiff/make_sep_list.c \
+  		${CHACO}/klvspiff/matching.c \
+  		${CHACO}/klvspiff/nway_klv.c \
+  		${CHACO}/coarsen/coarsen.c \
+  		${CHACO}/coarsen/interpolate.c \
+! 		${CHACO}/coarsen/makecgraph.c \
+  		${CHACO}/coarsen/coarsen1.c \
+- 		${CHACO}/coarsen/countcedges.c \
+  		${CHACO}/coarsen/makev2cv.c \
+  		${CHACO}/coarsen/maxmatch.c \
+  		${CHACO}/coarsen/maxmatch1.c \
+  		${CHACO}/coarsen/maxmatch2.c  \
+  		${CHACO}/coarsen/maxmatch3.c \
+  		${CHACO}/coarsen/maxmatch4.c \
+  		${CHACO}/connect/add_edges.c \
+  		${CHACO}/connect/connected.c \
+  		${CHACO}/connect/find_edges.c \
+--- 98,123 ----
+  		${CHACO}/klvspiff/coarsen_klv.c \
+  		${CHACO}/klvspiff/countup_vtx_sep.c \
+  		${CHACO}/klvspiff/find_bndy.c \
++ 		${CHACO}/klvspiff/flow.c \
+  		${CHACO}/klvspiff/klv_init.c \
+  		${CHACO}/klvspiff/klvspiff.c \
+  		${CHACO}/klvspiff/make_bpgraph.c \
+  		${CHACO}/klvspiff/make_sep_list.c \
+  		${CHACO}/klvspiff/matching.c \
+  		${CHACO}/klvspiff/nway_klv.c \
++ 		${CHACO}/klvspiff/flatten.c \
+  		${CHACO}/coarsen/coarsen.c \
+  		${CHACO}/coarsen/interpolate.c \
+! 		${CHACO}/coarsen/makefgraph.c \
+! 		${CHACO}/coarsen/makeccoords.c \
+  		${CHACO}/coarsen/coarsen1.c \
+  		${CHACO}/coarsen/makev2cv.c \
+  		${CHACO}/coarsen/maxmatch.c \
+  		${CHACO}/coarsen/maxmatch1.c \
+  		${CHACO}/coarsen/maxmatch2.c  \
+  		${CHACO}/coarsen/maxmatch3.c \
+  		${CHACO}/coarsen/maxmatch4.c \
++ 		${CHACO}/coarsen/maxmatch5.c \
+  		${CHACO}/connect/add_edges.c \
+  		${CHACO}/connect/connected.c \
+  		${CHACO}/connect/find_edges.c \
+***************
+*** 232,237 ****
+--- 244,250 ----
+  		${CHACO}/util/normalize.c \
+  		${CHACO}/util/mergesort.c \
+  		${CHACO}/util/randomize.c \
++ 		${CHACO}/util/smalloc.c \
+  		${CHACO}/util/scadd.c \
+  		${CHACO}/util/seconds.c \
+  		${CHACO}/util/setvec.c \
+***************
+*** 243,248 ****
+--- 256,263 ----
+  		${CHACO}/util/vecout.c \
+  		${CHACO}/util/vecran.c \
+  		${CHACO}/util/vecscale.c 
++ #		${CHACO}/main/user_params.c \
++ #		${CHACO}/util/bail.c \
+  
+  MLFILES.o=      $(MLFILES.c:.c=.o)
+  
+***************
+*** 252,259 ****
+  #		${MATLAB}/bin/cmex CC='gcc -G' -lm ${OFLAGS} ${MLFILES.o} chaco.a; \
+  #                 mv mlchaco.mex* ${DEST_DIR}
+  
+  mlchaco:	${MLFILES.c} chaco.a Makefile
+! 		mex -V4 -output mlchaco ${MLFILES.c} chaco.a -I${CHACO}/main
+  		mv mlchaco.mex* ${DEST_DIR}
+  
+  chaco.a:        ${CHFILES.o}
+--- 267,278 ----
+  #		${MATLAB}/bin/cmex CC='gcc -G' -lm ${OFLAGS} ${MLFILES.o} chaco.a; \
+  #                 mv mlchaco.mex* ${DEST_DIR}
+  
++ #mlchaco:	${MLFILES.c} chaco.a Makefile
++ #		mex -V4 -output mlchaco ${MLFILES.c} chaco.a -I${CHACO}/main
++ #		mv mlchaco.mex* ${DEST_DIR}
++ 
+  mlchaco:	${MLFILES.c} chaco.a Makefile
+! 		mex -output mlchaco -largeArrayDims -DMATLAB ${MLFILES.c} chaco.a -I${CHACO}/main
+  		mv mlchaco.mex* ${DEST_DIR}
+  
+  chaco.a:        ${CHFILES.o}
+Only in /home/jschierm/Libs/meshpart/chaco: Makefile_old
+Only in /home/jschierm/Libs/meshpart/chaco: Makefile_old2
+diff -rc src/chaco/mlchaco.c /home/jschierm/Libs/meshpart/chaco/mlchaco.c
+*** src/chaco/mlchaco.c	1999-07-23 12:19:09.000000000 -0700
+--- /home/jschierm/Libs/meshpart/chaco/mlchaco.c	2009-07-29 15:22:23.507525662 -0700
+***************
+*** 32,37 ****
+--- 32,38 ----
+  #include <stdio.h>
+  #include "mex.h"
+  #include <sys/times.h>
++ #include <time.h>      /*  CLOCKS_PER_SEC  */
+  
+  /* Aliases for input and output arguments */
+  #define A_in               prhs[0]
+***************
+*** 53,64 ****
+  #define map_out            plhs[0]
+  
+  
+! void mexFunction(    
+!     int         nlhs,           /* number of expected outputs */
+!     Matrix      *plhs[],        /* matrix pointer array returning outputs */
+!     int         nrhs,           /* number of inputs */
+!     Matrix      *prhs[]         /* matrix pointer array for inputs */
+!     )
+  {
+      /* Arguments to Chaco "interface" routine: */
+  
+--- 54,65 ----
+  #define map_out            plhs[0]
+  
+  
+! void mexFunction(
+!     int           nlhs,           /* number of expected outputs */
+!     mxArray       *plhs[],        /* array of pointers to output arguments */
+!     int           nrhs,           /* number of inputs */
+!     const mxArray *prhs[]         /* array of pointers to input arguments */
+! )
+  {
+      /* Arguments to Chaco "interface" routine: */
+  
+***************
+*** 85,90 ****
+--- 86,92 ----
+   
+      int    i, m, nedges, geodims, failure;
+      double *p;
++     mwIndex *mwstart,*mwadjacency;
+  
+      double *Tout ;			/* time: added by Tim Davis */
+      struct tms t1 ;
+***************
+*** 101,109 ****
+         to the various types Chaco wants.                            */
+  
+      nvtxs = mxGetN(A_in);
+!     start = mxGetJc(A_in);
+      nedges = start[nvtxs];
+!     adjacency = mxGetIr(A_in);
+      if (mxGetN(vwgts_in)) {
+          vwgts = (int *) mxCalloc(nvtxs, sizeof(int));
+          p = mxGetPr(vwgts_in);
+--- 103,119 ----
+         to the various types Chaco wants.                            */
+  
+      nvtxs = mxGetN(A_in);
+! /*    start = mxGetJc(A_in);*/
+!     mwstart = mxGetJc(A_in);
+!     start = mxMalloc((mxGetN(A_in)+1)*sizeof(int));
+!     for (i=0; i<(mxGetN(A_in)+1); i++)
+!         start[i]= (int)mwstart[i];
+      nedges = start[nvtxs];
+! /*    adjacency = mxGetIr(A_in);*/
+!     mwadjacency = mxGetIr(A_in);
+!     adjacency = mxMalloc(mxGetNzmax(A_in)*sizeof(int));
+!     for (i=0; i<mxGetNzmax(A_in); i++)
+!         adjacency[i]= (int)mwadjacency[i];
+      if (mxGetN(vwgts_in)) {
+          vwgts = (int *) mxCalloc(nvtxs, sizeof(int));
+          p = mxGetPr(vwgts_in);
+***************
+*** 128,135 ****
+          z = (float *) mxCalloc(nvtxs, sizeof(float));
+          for (i = 0; i < nvtxs; z[i++] = (float) *p++);
+      } else z = NULL;
+!     outassignname = NULL;
+!     outfilename = NULL;
+      assignment = (short *) mxCalloc(nvtxs, sizeof(short));
+      if (mxGetN(assignment_in)) {
+          p = mxGetPr(assignment_in);
+--- 138,147 ----
+          z = (float *) mxCalloc(nvtxs, sizeof(float));
+          for (i = 0; i < nvtxs; z[i++] = (float) *p++);
+      } else z = NULL;
+! /*    outassignname = NULL;
+!     outfilename = NULL;*/
+!     outassignname = "chaco_assign.txt";
+!     outfilename = "chaco_out.txt";
+      assignment = (short *) mxCalloc(nvtxs, sizeof(short));
+      if (mxGetN(assignment_in)) {
+          p = mxGetPr(assignment_in);
+***************
+*** 166,188 ****
+  
+      if (nlhs > 1)
+      {
+! 	plhs [1] = mxCreateFull (1, 1, REAL) ;
+  	Tout = mxGetPr (plhs [1]) ;
+  	Tout [0] =
+  	((double) (t2.tms_utime + t2.tms_stime - t1.tms_utime - t1.tms_stime)) /
+! 	((double) CLK_TCK) ;
+      }
+  
+      /* Copy the mapping vector into a Matlab matrix. */
+  
+      if (!failure) {
+!         map_out = mxCreateFull(1,nvtxs,REAL);
+          p = mxGetPr(map_out);
+          for (i = 0; i < nvtxs; *p++ = (double) assignment[i++]);
+      }
+  
+      /* Free what we allocated */
+     
+      if (vwgts != NULL) mxFree((char *) vwgts);
+      if (ewgts != NULL) mxFree((char *) ewgts);
+      if (x != NULL) mxFree((char *) x);
+--- 178,202 ----
+  
+      if (nlhs > 1)
+      {
+! 	plhs [1] = mxCreateDoubleMatrix (1, 1, mxREAL) ;
+  	Tout = mxGetPr (plhs [1]) ;
+  	Tout [0] =
+  	((double) (t2.tms_utime + t2.tms_stime - t1.tms_utime - t1.tms_stime)) /
+! 	((double) CLOCKS_PER_SEC) ;
+      }
+  
+      /* Copy the mapping vector into a Matlab matrix. */
+  
+      if (!failure) {
+!         map_out = mxCreateDoubleMatrix(1,nvtxs,mxREAL);
+          p = mxGetPr(map_out);
+          for (i = 0; i < nvtxs; *p++ = (double) assignment[i++]);
+      }
+  
+      /* Free what we allocated */
+     
++     if (start != NULL) mxFree((char *) start);
++     if (adjacency != NULL) mxFree((char *) adjacency);
+      if (vwgts != NULL) mxFree((char *) vwgts);
+      if (ewgts != NULL) mxFree((char *) ewgts);
+      if (x != NULL) mxFree((char *) x);
+Only in /home/jschierm/Libs/meshpart/chaco: mlchaco_jes_notes.txt
+Only in /home/jschierm/Libs/meshpart/chaco: mlchaco_old.c
+Only in /home/jschierm/Libs/meshpart/chaco: mlchaco_README.txt
+diff -rc src/chaco.m /home/jschierm/Libs/meshpart/chaco.m
+*** src/chaco.m	1999-07-23 12:13:26.000000000 -0700
+--- /home/jschierm/Libs/meshpart/chaco.m	2009-07-29 14:58:33.872207593 -0700
+***************
+*** 142,148 ****
+  global_method = method(1);
+  local_method = method(2);
+  if method(3)
+!     vwgts = full(Adiag);
+      totalvwgt = sum(vwgts);
+  else
+      vwgts = [];
+--- 142,149 ----
+  global_method = method(1);
+  local_method = method(2);
+  if method(3)
+! %     vwgts = full(Adiag);
+!     vwgts = full(diag(A));
+      totalvwgt = sum(vwgts);
+  else
+      vwgts = [];
+Only in /home/jschierm/Libs/meshpart: chaco_old.m
+diff -rc src/fiedler.m /home/jschierm/Libs/meshpart/fiedler.m
+*** src/fiedler.m	1996-02-23 10:03:20.000000000 -0800
+--- /home/jschierm/Libs/meshpart/fiedler.m	2009-07-13 14:25:59.000000000 -0700
+***************
+*** 58,64 ****
+      lambda = 1;
+      shift = -eps^.25;
+      I = speye(n);
+!     p = symmmd(L);
+      L = L(p,p);
+      R = chol(L-shift*I);
+      Rt = R';
+--- 58,68 ----
+      lambda = 1;
+      shift = -eps^.25;
+      I = speye(n);
+!     if exist('symamd')
+!         p = symamd(L);
+!     else
+!         p = symmmd(L);
+!     end
+      L = L(p,p);
+      R = chol(L-shift*I);
+      Rt = R';
+Only in /home/jschierm/Libs/meshpart: fiedler_old.m
+diff -rc src/meshdemo.m /home/jschierm/Libs/meshpart/meshdemo.m
+*** src/meshdemo.m	2002-02-08 07:38:21.000000000 -0800
+--- /home/jschierm/Libs/meshpart/meshdemo.m	2009-07-15 15:43:09.303210082 -0700
+***************
+*** 97,103 ****
+  disp(' Hit space to continue ...');
+  pause;
+  
+! usechaco = 0;
+  if usechaco
+  disp(' ');
+  disp(' Next is multilevel Kernighan-Lin partitioning, which first partitions');
+--- 97,103 ----
+  disp(' Hit space to continue ...');
+  pause;
+  
+! usechaco = 1;
+  if usechaco
+  disp(' ');
+  disp(' Next is multilevel Kernighan-Lin partitioning, which first partitions');
+Only in /home/jschierm/Libs/meshpart: meshdemo_old.m
+Only in /home/jschierm/Libs/meshpart: meshpart_notes_jes.txt
+Only in /home/jschierm/Libs/meshpart: meshpart_README.txt
+diff -rc src/metis/metismex.c /home/jschierm/Libs/meshpart/metis/metismex.c
+*** src/metis/metismex.c	2009-07-13 14:37:08.000000000 -0700
+--- /home/jschierm/Libs/meshpart/metis/metismex.c	2009-07-14 15:07:30.187491787 -0700
+***************
+*** 92,98 ****
+  void convertMatrix (const mxArray *A, idxtype **xadj, idxtype **adjncy,
+                      idxtype **vwgt, idxtype **adjwgt)
+  {
+!     int i, j, jbar, n, nnz, *jc, *ir;
+      double *pr;
+  
+      /* Find MATLAB's matrix structure */
+--- 92,100 ----
+  void convertMatrix (const mxArray *A, idxtype **xadj, idxtype **adjncy,
+                      idxtype **vwgt, idxtype **adjwgt)
+  {
+! /*    int i, j, jbar, n, nnz, *jc, *ir;*/
+!     int i, j, jbar, n, nnz;
+!     mwIndex *jc, *ir;
+      double *pr;
+  
+      /* Find MATLAB's matrix structure */
+diff -rc src/metis/proto.h /home/jschierm/Libs/meshpart/metis/proto.h
+*** src/metis/proto.h	2009-09-22 17:24:29.402085000 -0700
+--- /home/jschierm/Libs/meshpart/metis/proto.h	2010-02-10 14:28:26.558752000 -0800
+***************
+*** 230,237 ****
+  void QUADNODALMETIS(int, int, idxtype *, idxtype *, idxtype *adjncy);
+  
+  /* meshpart.c */
+! extern "C" void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+! extern "C" void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+  
+  /* mfm.c */
+  void MocFM_2WayEdgeRefine(CtrlType *, GraphType *, float *, int);
+--- 230,240 ----
+  void QUADNODALMETIS(int, int, idxtype *, idxtype *, idxtype *adjncy);
+  
+  /* meshpart.c */
+! /*extern "C" void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);*/
+! /*extern "C" void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);*/
+! 
+! void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+! void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+  
+  /* mfm.c */
+  void MocFM_2WayEdgeRefine(CtrlType *, GraphType *, float *, int);
+***************
+*** 459,465 ****
+  void srand48(long);
+  int ispow2(int);
+  void InitRandom(int);
+! int log2(int);
+  
+  
+  
+--- 462,468 ----
+  void srand48(long);
+  int ispow2(int);
+  void InitRandom(int);
+! /*int log2(int);*/
+  
+  
+  
+Only in src: metismex.dll
+Only in src: metismex.m
+Only in /home/jschierm/Libs/meshpart: metismex.mexa64
+Only in src: metismex.mexsol
+Only in /home/jschierm/Libs/meshpart: metismex_notes_jes.txt
+Only in /home/jschierm/Libs/meshpart: metismex_old.c
+Only in /home/jschierm/Libs/meshpart: metismex_README.txt
+Only in /home/jschierm/Libs/meshpart: mlchaco.mexa64
+Only in /home/jschierm/Libs/meshpart: User_Params
Index: sm/trunk/externalpackages/meshpart/metismex.c.patch
===================================================================
--- /issm/trunk/externalpackages/meshpart/metismex.c.patch	(revision 3011)
+++ 	(revision )
@@ -1,6 +1,0 @@
-95c95,97
-<     int i, j, jbar, n, nnz, *jc, *ir;
----
-> /*    int i, j, jbar, n, nnz, *jc, *ir;*/
->     int i, j, jbar, n, nnz;
->     mwIndex *jc, *ir;
Index: sm/trunk/externalpackages/meshpart/mlchaco.c.patch
===================================================================
--- /issm/trunk/externalpackages/meshpart/mlchaco.c.patch	(revision 3011)
+++ 	(revision )
@@ -1,57 +1,0 @@
-34a35
-> #include <time.h>      /*  CLOCKS_PER_SEC  */
-56,61c57,62
-< void mexFunction(    
-<     int         nlhs,           /* number of expected outputs */
-<     Matrix      *plhs[],        /* matrix pointer array returning outputs */
-<     int         nrhs,           /* number of inputs */
-<     Matrix      *prhs[]         /* matrix pointer array for inputs */
-<     )
----
-> void mexFunction(
->     int           nlhs,           /* number of expected outputs */
->     mxArray       *plhs[],        /* array of pointers to output arguments */
->     int           nrhs,           /* number of inputs */
->     const mxArray *prhs[]         /* array of pointers to input arguments */
-> )
-87a89
->     mwIndex *mwstart,*mwadjacency;
-104c106,110
-<     start = mxGetJc(A_in);
----
-> /*    start = mxGetJc(A_in);*/
->     mwstart = mxGetJc(A_in);
->     start = mxMalloc((mxGetN(A_in)+1)*sizeof(int));
->     for (i=0; i<(mxGetN(A_in)+1); i++)
->         start[i]= (int)mwstart[i];
-106c112,116
-<     adjacency = mxGetIr(A_in);
----
-> /*    adjacency = mxGetIr(A_in);*/
->     mwadjacency = mxGetIr(A_in);
->     adjacency = mxMalloc(mxGetNzmax(A_in)*sizeof(int));
->     for (i=0; i<mxGetNzmax(A_in); i++)
->         adjacency[i]= (int)mwadjacency[i];
-131,132c141,144
-<     outassignname = NULL;
-<     outfilename = NULL;
----
-> /*    outassignname = NULL;
->     outfilename = NULL;*/
->     outassignname = "chaco_assign.txt";
->     outfilename = "chaco_out.txt";
-169c181
-< 	plhs [1] = mxCreateFull (1, 1, REAL) ;
----
-> 	plhs [1] = mxCreateDoubleMatrix (1, 1, mxREAL) ;
-173c185
-< 	((double) CLK_TCK) ;
----
-> 	((double) CLOCKS_PER_SEC) ;
-179c191
-<         map_out = mxCreateFull(1,nvtxs,REAL);
----
->         map_out = mxCreateDoubleMatrix(1,nvtxs,mxREAL);
-185a198,199
->     if (start != NULL) mxFree((char *) start);
->     if (adjacency != NULL) mxFree((char *) adjacency);
Index: sm/trunk/externalpackages/meshpart/proto.h.patch
===================================================================
--- /issm/trunk/externalpackages/meshpart/proto.h.patch	(revision 3011)
+++ 	(revision )
@@ -1,13 +1,0 @@
-233,234c233,237
-< extern "C" void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
-< extern "C" void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
----
-> /*extern "C" void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);*/
-> /*extern "C" void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);*/
-> 
-> void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
-> void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
-462c465
-< int log2(int);
----
-> /*int log2(int);*/
