[petsc-dev] DMDA_*PERIODIC and DMDA_XYZGHOSTED

Ethan Coon ecoon at lanl.gov
Thu Mar 10 17:36:03 CST 2011




> >
> > Hmm, I didn't add the dd->idx, so I'm suprised it wasn't free'd already.
> > I also wasn't sure when/if to log the memory, since it seemed to be in
> > there for some stuff and not for others in the previous code.
> >
> 
> You should just log it in the DM object, just uncomment the line in
> the 2D and 3D setup code
> 

Ok, done.

> > With the copy (your next email) to the IS, shouldn't that changeset leak
> > memory?  I think it also needs a PetscFree(idx) then as well...
> >
> 
> My two patches are cumulative... Take into account that DMDestroy_DA
> applies to 1/2/3D, while the setup code is different. The free(idx) at
> the common destoy() should be enough (provided you use COPY_VALUES for
> the 1D code)
> 

Ah, I see my confusion... previously the memory had been shared with the
da->l2gmap, and so it was destroyed by that.  I missed the fact that
your second change was in da1.  This passes valgrind's memcheck.  Thanks
for clearing that up, Lisandro.

This patch does the change from DMDAPeriodicType -> DMDABoundaryType and
deals with Lisandro's memory fixes.

The one thing I didn't change is the name of the DMDASetPeriodicity()
method, which I wasn't sure what to go to.

Ethan



> >
> > Will get these fixes in,
> >
> 
> With both patches applied, petsc4py testsuite pass cleanly (and mem
> leaks seems to go away). So I'm more or less confident on your (huge)
> changes + my (tiny) fixes
> 
> 

-- 
------------------------------------
Ethan Coon
Post-Doctoral Researcher
Applied Mathematics - T-5
Los Alamos National Laboratory
505-665-8289

http://www.ldeo.columbia.edu/~ecoon/
------------------------------------
-------------- next part --------------
removed hardcoded DMDAXPeriodic check, DMDAPeriodicType --> DMDABoundaryType, updated changes dev webpage

diff -r 3923fa35e382 bin/matlab/classes/matlabheader.h
--- a/bin/matlab/classes/matlabheader.h	Thu Mar 10 15:03:35 2011 -0600
+++ b/bin/matlab/classes/matlabheader.h	Thu Mar 10 16:31:28 2011 -0700
@@ -91,7 +91,7 @@
 mxArray* MatSeqAIJToMatlab(Mat);
 
 typedef PetscPointer DM;
-typedef int DMDAPeriodicType;
+typedef int DMDABoundaryType;
 typedef int DMDAStencilType;
 int DMCreate(MPI_Comm,DM*);
 int DMSetType(DM,const char*);
@@ -103,14 +103,14 @@
 int DMView(DM,PetscViewer);
 int DMSetFunctionMatlab(DM,const char*);
 int DMSetJacobianMatlab(DM,const char*);
-int DMDASetPeriodicity(DM, DMDAPeriodicType);
+int DMDASetPeriodicity(DM, DMDABoundaryType);
 int DMDASetDof(DM, int);
 int DMSetUp(DM);
 int DMDASetStencilWidth(DM, int);
 int DMDASetStencilType(DM, DMDAStencilType);
 int DMCreateGlobalVector(DM,Vec*);
 int DMGetMatrix(DM,const char*,Mat*);
-int DMDAGetInfo(DM,int*,int*,int*,int*,int*,int*,int*,int*,int*,DMDAPeriodicType*,DMDAStencilType*);
+int DMDAGetInfo(DM,int*,int*,int*,int*,int*,int*,int*,int*,int*,DMDABoundaryType*,DMDAStencilType*);
 
 typedef PetscPointer PC;
 int PCCreate(MPI_Comm,PC *);
diff -r 3923fa35e382 conf/adic.init
--- a/conf/adic.init	Thu Mar 10 15:03:35 2011 -0600
+++ b/conf/adic.init	Thu Mar 10 16:31:28 2011 -0700
@@ -23,7 +23,7 @@
 	KSP           = "typedef int KSP;"
 	SNES           = "typedef int SNES;"
 	SNESConvergedReason           = "typedef int SNESConvergedReason;"
-	DAPeriodicType = "typedef int DMDAPeriodicType;"
+	DAPeriodicType = "typedef int DMDABoundaryType;"
 	DAStencilType  = "typedef int DMDAStencilType;"
         ISColoring     = "typedef int ISColoring;"
 	PetscBool      = "typedef int PetscBool ;"
diff -r 3923fa35e382 conf/adicmf.init
--- a/conf/adicmf.init	Thu Mar 10 15:03:35 2011 -0600
+++ b/conf/adicmf.init	Thu Mar 10 16:31:28 2011 -0700
@@ -24,7 +24,7 @@
 	KSP           = "typedef int KSP;"
 	SNES           = "typedef int SNES;"
 	SNESConvergedReason           = "typedef int SNESConvergedReason;"
-	DAPeriodicType = "typedef int DMDAPeriodicType;"
+	DAPeriodicType = "typedef int DMDABoundaryType;"
 	DAStencilType  = "typedef int DMDAStencilType;"
         ISColoring     = "typedef int ISColoring;"
 	PetscBool      = "typedef int PetscBool ;"
diff -r 3923fa35e382 conf/adicmfb.init
--- a/conf/adicmfb.init	Thu Mar 10 15:03:35 2011 -0600
+++ b/conf/adicmfb.init	Thu Mar 10 16:31:28 2011 -0700
@@ -24,7 +24,7 @@
 	KSP           = "typedef int KSP;"
 	SNES           = "typedef int SNES;"
 	SNESConvergedReason           = "typedef int SNESConvergedReason;"
-	DAPeriodicType = "typedef int DMDAPeriodicType;"
+	DAPeriodicType = "typedef int DMDABoundaryType;"
 	DAStencilType  = "typedef int DMDAStencilType;"
         ISColoring     = "typedef int ISColoring;"
 	PetscBool      = "typedef int PetscBool ;"
diff -r 3923fa35e382 include/finclude/ftn-custom/petscdm.h90
--- a/include/finclude/ftn-custom/petscdm.h90	Thu Mar 10 15:03:35 2011 -0600
+++ b/include/finclude/ftn-custom/petscdm.h90	Thu Mar 10 16:31:28 2011 -0700
@@ -22,7 +22,7 @@
         PetscInt ::       xm,ym,zm
         PetscInt ::       gxs,gys,gzs
         PetscInt ::       gxm,gym,gzm
-        DMDAPeriodicType :: pt
+        DMDABoundaryType :: pt
         DMDAStencilType  :: st
         DM_HIDE ::        da
       end type DMDALocalInfof90
diff -r 3923fa35e382 include/finclude/petscdmdef.h
--- a/include/finclude/petscdmdef.h	Thu Mar 10 15:03:35 2011 -0600
+++ b/include/finclude/petscdmdef.h	Thu Mar 10 16:31:28 2011 -0700
@@ -13,7 +13,7 @@
 #define DM PetscFortranAddr
 #endif
 #define DMMG PetscFortranAddr
-#define DMDAPeriodicType PetscEnum
+#define DMDABoundaryType PetscEnum
 #define DMDAStencilType PetscEnum
 #define DMDADirection PetscEnum
 
diff -r 3923fa35e382 include/petscdm.h
--- a/include/petscdm.h	Thu Mar 10 15:03:35 2011 -0600
+++ b/include/petscdm.h	Thu Mar 10 16:31:28 2011 -0700
@@ -54,7 +54,7 @@
 M*/
 
 /*E
-    DMDAPeriodicType - Is the domain periodic or ghosted in one or more directions
+    DMDABoundaryType - Is the domain periodic or ghosted in one or more directions
 
    Level: beginner
 
@@ -79,9 +79,9 @@
   DMDA_XZPERIODIC = 0x33,
   DMDA_YZPERIODIC = 0x3c,
   DMDA_XYZPERIODIC = 0x3f,
-  DMDA_XYZGHOSTED = 0x15} DMDAPeriodicType;
+  DMDA_XYZGHOSTED = 0x15} DMDABoundaryType;
 
-extern const char *DMDAPeriodicTypes[];
+extern const char *DMDABoundaryTypes[];
 
 /*E
     DMDAInterpolationType - Defines the type of interpolation that will be returned by 
@@ -109,9 +109,9 @@
 extern PetscErrorCode   DMDASetElementType(DM,DMDAElementType);
 extern PetscErrorCode   DMDAGetElementType(DM,DMDAElementType*);
 
-#define DMDAXPeriodic(pt) ((pt) & 0x2) /* (DMDA_XPERIODIC ^ DMDA_XGHOSTED)) */
-#define DMDAYPeriodic(pt) ((pt) & 0x8) /* (DMDA_YPERIODIC ^ DMDA_YGHOSTED)) */
-#define DMDAZPeriodic(pt) ((pt) & 0x20) /* (DMDA_ZPERIODIC ^ DMDA_ZGHOSTED)) */
+#define DMDAXPeriodic(pt) ((pt) & (DMDA_XPERIODIC ^ DMDA_XGHOSTED))
+#define DMDAYPeriodic(pt) ((pt) & (DMDA_YPERIODIC ^ DMDA_YGHOSTED))
+#define DMDAZPeriodic(pt) ((pt) & (DMDA_ZPERIODIC ^ DMDA_ZGHOSTED))
 #define DMDAXGhosted(pt) ((pt) & DMDA_XGHOSTED)
 #define DMDAYGhosted(pt) ((pt) & DMDA_YGHOSTED)
 #define DMDAZGhosted(pt) ((pt) & DMDA_ZGHOSTED)
@@ -125,9 +125,9 @@
 extern PetscErrorCode  DMDACreate(MPI_Comm,DM*);
 extern PetscErrorCode  DMDASetDim(DM,PetscInt);
 extern PetscErrorCode  DMDASetSizes(DM,PetscInt,PetscInt,PetscInt);
-extern PetscErrorCode     DMDACreate1d(MPI_Comm,DMDAPeriodicType,PetscInt,PetscInt,PetscInt,const PetscInt[],DM *);
-extern PetscErrorCode     DMDACreate2d(MPI_Comm,DMDAPeriodicType,DMDAStencilType,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,const PetscInt[],const PetscInt[],DM*);
-extern PetscErrorCode     DMDACreate3d(MPI_Comm,DMDAPeriodicType,DMDAStencilType,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,const PetscInt[],const PetscInt[],const PetscInt[],DM*);
+extern PetscErrorCode     DMDACreate1d(MPI_Comm,DMDABoundaryType,PetscInt,PetscInt,PetscInt,const PetscInt[],DM *);
+extern PetscErrorCode     DMDACreate2d(MPI_Comm,DMDABoundaryType,DMDAStencilType,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,const PetscInt[],const PetscInt[],DM*);
+extern PetscErrorCode     DMDACreate3d(MPI_Comm,DMDABoundaryType,DMDAStencilType,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,const PetscInt[],const PetscInt[],const PetscInt[],DM*);
 extern PetscErrorCode  DMSetOptionsPrefix(DM,const char []);
 extern PetscErrorCode  DMSetVecType(DM,const VecType);
 
@@ -142,7 +142,7 @@
 extern PetscErrorCode     DMDALoad(PetscViewer,PetscInt,PetscInt,PetscInt,DM *);
 extern PetscErrorCode     DMDAGetCorners(DM,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*);
 extern PetscErrorCode     DMDAGetGhostCorners(DM,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*);
-extern PetscErrorCode     DMDAGetInfo(DM,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,DMDAPeriodicType*,DMDAStencilType*);
+extern PetscErrorCode     DMDAGetInfo(DM,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,DMDABoundaryType*,DMDAStencilType*);
 extern PetscErrorCode     DMDAGetProcessorSubset(DM,DMDADirection,PetscInt,MPI_Comm*);
 extern PetscErrorCode     DMDAGetProcessorSubsets(DM,DMDADirection,MPI_Comm*);
 
@@ -166,7 +166,7 @@
 extern PetscErrorCode     DMDASetFieldName(DM,PetscInt,const char[]);
 extern PetscErrorCode     DMDAGetFieldName(DM,PetscInt,const char**);
 
-extern PetscErrorCode  DMDASetPeriodicity(DM, DMDAPeriodicType);
+extern PetscErrorCode  DMDASetPeriodicity(DM, DMDABoundaryType);
 extern PetscErrorCode  DMDASetDof(DM, int);
 extern PetscErrorCode  DMDASetStencilWidth(DM, PetscInt);
 extern PetscErrorCode  DMDASetOwnershipRanges(DM,const PetscInt[],const PetscInt[],const PetscInt[]);
@@ -279,7 +279,7 @@
   PetscInt       xm,ym,zm;    /* number of grid points on this processor, excluding ghosts */
   PetscInt       gxs,gys,gzs;    /* starting point of this processor including ghosts */
   PetscInt       gxm,gym,gzm;    /* number of grid points on this processor including ghosts */
-  DMDAPeriodicType pt;
+  DMDABoundaryType pt;
   DMDAStencilType  st;
   DM             da;
 } DMDALocalInfo;
diff -r 3923fa35e382 include/private/daimpl.h
--- a/include/private/daimpl.h	Thu Mar 10 15:03:35 2011 -0600
+++ b/include/private/daimpl.h	Thu Mar 10 16:31:28 2011 -0700
@@ -17,7 +17,7 @@
                                                    values above already scaled by w */
   PetscInt            *idx,Nl;               /* local to global map */
   PetscInt            base;                  /* global number of 1st local node */
-  DMDAPeriodicType      wrap;                  /* indicates type of periodic boundaries */
+  DMDABoundaryType      wrap;                  /* indicates type of periodic boundaries */
   VecScatter          gtol,ltog,ltol;        /* scatters, see below for details */
   DMDAStencilType       stencil_type;          /* stencil, either box or star */
   PetscInt            dim;                   /* DMDA dimension (1,2, or 3) */
diff -r 3923fa35e382 src/characteristic/examples/tutorials/ex1.c
--- a/src/characteristic/examples/tutorials/ex1.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/characteristic/examples/tutorials/ex1.c	Thu Mar 10 16:31:28 2011 -0700
@@ -33,7 +33,7 @@
 } Parameter;
 
 typedef struct gridinfo_s {
-  DMDAPeriodicType periodic;
+  DMDABoundaryType periodic;
   DMDAStencilType  stencil;
   int            ni,nj,dof,stencil_width,mglevels;
   PetscReal      dx,dz;
diff -r 3923fa35e382 src/characteristic/examples/tutorials/ex2.c
--- a/src/characteristic/examples/tutorials/ex2.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/characteristic/examples/tutorials/ex2.c	Thu Mar 10 16:31:28 2011 -0700
@@ -37,7 +37,7 @@
 } Parameter;
 
 typedef struct gridinfo_s {
-  DMDAPeriodicType periodic;
+  DMDABoundaryType periodic;
   DMDAStencilType  stencil;
   int            ni,nj,dof,stencil_width,mglevels;
   PetscReal      dx,dz;
diff -r 3923fa35e382 src/characteristic/examples/tutorials/ex4.c
--- a/src/characteristic/examples/tutorials/ex4.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/characteristic/examples/tutorials/ex4.c	Thu Mar 10 16:31:28 2011 -0700
@@ -54,7 +54,7 @@
 } Parameter;
 
 typedef struct gridinfo_s {
-  DMDAPeriodicType periodic;
+  DMDABoundaryType periodic;
   DMDAStencilType  stencil;
   int            ni,nj,dof,stencil_width,mglevels;
   PassiveScalar  dx,dz;
diff -r 3923fa35e382 src/characteristic/impls/da/slda.c
--- a/src/characteristic/impls/da/slda.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/characteristic/impls/da/slda.c	Thu Mar 10 16:31:28 2011 -0700
@@ -110,7 +110,7 @@
    ----------------------------------------------------------------------------------------*/
 PetscErrorCode DMDAMapCoordsToPeriodicDomain(DM da, PetscScalar *x, PetscScalar *y)
 {
-  DMDAPeriodicType periodic_type;
+  DMDABoundaryType periodic_type;
   PetscInt       dim, gx, gy;
   PetscErrorCode ierr;
 
diff -r 3923fa35e382 src/characteristic/interface/characteristic.c
--- a/src/characteristic/interface/characteristic.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/characteristic/interface/characteristic.c	Thu Mar 10 16:31:28 2011 -0700
@@ -321,7 +321,7 @@
   Vec                     velocityLocal, velocityLocalOld;
   Vec                     fieldLocal;
   DMDALocalInfo             info;
-  DMDAPeriodicType          periodic_type;
+  DMDABoundaryType          periodic_type;
   PetscScalar             **solArray;
   void                    *velocityArray;
   void                    *velocityArrayOld;
@@ -788,7 +788,7 @@
 /* [center, left, top-left, top, top-right, right, bottom-right, bottom, bottom-left] */
 PetscErrorCode DMDAGetNeighborsRank(DM da, PetscMPIInt neighbors[])
 {
-  DMDAPeriodicType periodic_type;
+  DMDABoundaryType periodic_type;
   PetscBool      IPeriodic = PETSC_FALSE, JPeriodic = PETSC_FALSE;
   MPI_Comm       comm;
   PetscMPIInt    rank;
diff -r 3923fa35e382 src/dm/examples/tests/ex10.c
--- a/src/dm/examples/tests/ex10.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex10.c	Thu Mar 10 16:31:28 2011 -0700
@@ -30,7 +30,7 @@
   ierr = PetscOptionsGetInt(PETSC_NULL,"-periodic",&wrap,PETSC_NULL);CHKERRQ(ierr); 
 
   /* Create distributed array and get vectors */
-  ierr = DMDACreate1d(PETSC_COMM_WORLD,(DMDAPeriodicType)wrap,M,dof,s,PETSC_NULL,&da);CHKERRQ(ierr);
+  ierr = DMDACreate1d(PETSC_COMM_WORLD,(DMDABoundaryType)wrap,M,dof,s,PETSC_NULL,&da);CHKERRQ(ierr);
   ierr = DMDASetUniformCoordinates(da,0.0,1.0,0.0,0.0,0.0,0.0);CHKERRQ(ierr);
   for (i=0; i<dof; i++) {
     sprintf(fname,"Field %d",(int)i);
diff -r 3923fa35e382 src/dm/examples/tests/ex11.c
--- a/src/dm/examples/tests/ex11.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex11.c	Thu Mar 10 16:31:28 2011 -0700
@@ -31,7 +31,7 @@
   ierr = PetscOptionsGetInt(PETSC_NULL,"-periodic",&wrap,PETSC_NULL);CHKERRQ(ierr); 
 
   /* Create distributed array and get vectors */
-  ierr = DMDACreate2d(PETSC_COMM_WORLD,(DMDAPeriodicType)wrap,DMDA_STENCIL_BOX,M,N,PETSC_DECIDE,
+  ierr = DMDACreate2d(PETSC_COMM_WORLD,(DMDABoundaryType)wrap,DMDA_STENCIL_BOX,M,N,PETSC_DECIDE,
                     PETSC_DECIDE,dof,s,PETSC_NULL,PETSC_NULL,&da);CHKERRQ(ierr);
   ierr = DMDASetUniformCoordinates(da,0.0,1.0,0.0,1.0,0.0,0.0);CHKERRQ(ierr);
   for (i=0; i<dof; i++) {
diff -r 3923fa35e382 src/dm/examples/tests/ex15.c
--- a/src/dm/examples/tests/ex15.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex15.c	Thu Mar 10 16:31:28 2011 -0700
@@ -13,7 +13,7 @@
   Vec            v_c,v_f;
   Mat            I;
   PetscScalar    one = 1.0;
-  DMDAPeriodicType pt = DMDA_NONPERIODIC;
+  DMDABoundaryType pt = DMDA_NONPERIODIC;
  
   ierr = PetscInitialize(&argc,&argv,(char*)0,help);CHKERRQ(ierr); 
 
diff -r 3923fa35e382 src/dm/examples/tests/ex2.c
--- a/src/dm/examples/tests/ex2.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex2.c	Thu Mar 10 16:31:28 2011 -0700
@@ -9,7 +9,7 @@
 {
   PetscMPIInt    rank;
   PetscInt       M = 13,s=1,dof=1;
-  DMDAPeriodicType wrap = DMDA_XPERIODIC;
+  DMDABoundaryType wrap = DMDA_XPERIODIC;
   PetscErrorCode ierr;
   DM             da;
   PetscViewer    viewer;
@@ -27,7 +27,7 @@
 
   /* Readoptions */
   ierr = PetscOptionsGetInt(PETSC_NULL,"-M",&M,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsGetEnum(PETSC_NULL,"-wrap",DMDAPeriodicTypes,(PetscEnum*)&wrap,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsGetEnum(PETSC_NULL,"-wrap",DMDABoundaryTypes,(PetscEnum*)&wrap,PETSC_NULL);CHKERRQ(ierr);
   ierr = PetscOptionsGetInt(PETSC_NULL,"-dof",&dof,PETSC_NULL);CHKERRQ(ierr); 
   ierr = PetscOptionsGetInt(PETSC_NULL,"-s",&s,PETSC_NULL);CHKERRQ(ierr); 
 
diff -r 3923fa35e382 src/dm/examples/tests/ex21.c
--- a/src/dm/examples/tests/ex21.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex21.c	Thu Mar 10 16:31:28 2011 -0700
@@ -13,7 +13,7 @@
   PetscViewer vv;
   Vec ac,af;
   PetscInt periodicity;
-  DMDAPeriodicType pt;
+  DMDABoundaryType pt;
 
   PetscFunctionBegin;
   periodicity = 0;
diff -r 3923fa35e382 src/dm/examples/tests/ex23.c
--- a/src/dm/examples/tests/ex23.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex23.c	Thu Mar 10 16:31:28 2011 -0700
@@ -11,7 +11,7 @@
   PetscInt       N = 6,m=PETSC_DECIDE,n=PETSC_DECIDE,p=PETSC_DECIDE,M=8,dof=1,stencil_width=1,P=5,pt = 0,st = 0;
   PetscErrorCode ierr;
   PetscBool      flg2,flg3;
-  DMDAPeriodicType periodic = DMDA_NONPERIODIC;
+  DMDABoundaryType periodic = DMDA_NONPERIODIC;
   DMDAStencilType  stencil_type = DMDA_STENCIL_STAR;
   DM             da;
   Vec            global1,global2,global3,global4;
@@ -28,7 +28,7 @@
   ierr = PetscOptionsGetInt(PETSC_NULL,"-dof",&dof,PETSC_NULL);CHKERRQ(ierr); 
   ierr = PetscOptionsGetInt(PETSC_NULL,"-stencil_width",&stencil_width,PETSC_NULL);CHKERRQ(ierr); 
   ierr = PetscOptionsGetInt(PETSC_NULL,"-periodic",&pt,PETSC_NULL);CHKERRQ(ierr); 
-  periodic = (DMDAPeriodicType) pt;
+  periodic = (DMDABoundaryType) pt;
   ierr = PetscOptionsGetInt(PETSC_NULL,"-stencil_type",&st,PETSC_NULL);CHKERRQ(ierr); 
   stencil_type = (DMDAStencilType) st;
 
diff -r 3923fa35e382 src/dm/examples/tests/ex33.c
--- a/src/dm/examples/tests/ex33.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex33.c	Thu Mar 10 16:31:28 2011 -0700
@@ -12,7 +12,7 @@
   PetscInt       stencil_width=1,pt=0,st=0;
   PetscErrorCode ierr;
   PetscBool      flg2,flg3,isbinary,mpiio;
-  DMDAPeriodicType periodic = DMDA_NONPERIODIC;
+  DMDABoundaryType periodic = DMDA_NONPERIODIC;
   DMDAStencilType  stencil_type = DMDA_STENCIL_STAR;
   DM             da,da2;
   Vec            global1,global2;
@@ -34,7 +34,7 @@
   ierr = PetscOptionsGetInt(PETSC_NULL,"-dof",&dof,PETSC_NULL);CHKERRQ(ierr); 
   ierr = PetscOptionsGetInt(PETSC_NULL,"-stencil_width",&stencil_width,PETSC_NULL);CHKERRQ(ierr); 
   ierr = PetscOptionsGetInt(PETSC_NULL,"-periodic",&pt,PETSC_NULL);CHKERRQ(ierr); 
-  periodic = (DMDAPeriodicType) pt;
+  periodic = (DMDABoundaryType) pt;
   ierr = PetscOptionsGetInt(PETSC_NULL,"-stencil_type",&st,PETSC_NULL);CHKERRQ(ierr); 
   stencil_type = (DMDAStencilType) st;
 
diff -r 3923fa35e382 src/dm/examples/tests/ex4.c
--- a/src/dm/examples/tests/ex4.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex4.c	Thu Mar 10 16:31:28 2011 -0700
@@ -14,7 +14,7 @@
   PetscInt       Xs,Xm,Ys,Ym,iloc,*iglobal,*ltog;
   PetscInt       *lx = PETSC_NULL,*ly = PETSC_NULL;
   PetscBool      testorder = PETSC_FALSE,flg;
-  DMDAPeriodicType wrap = DMDA_NONPERIODIC;
+  DMDABoundaryType wrap = DMDA_NONPERIODIC;
   DM             da;
   PetscViewer    viewer;
   Vec            local,global;
diff -r 3923fa35e382 src/dm/examples/tests/ex6.c
--- a/src/dm/examples/tests/ex6.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex6.c	Thu Mar 10 16:31:28 2011 -0700
@@ -17,7 +17,7 @@
   PetscViewer    viewer;
   Vec            local,global;
   PetscScalar    value;
-  DMDAPeriodicType wrap = DMDA_NONPERIODIC;
+  DMDABoundaryType wrap = DMDA_NONPERIODIC;
   DMDAStencilType  stencil_type = DMDA_STENCIL_BOX;
   AO             ao;
   PetscBool      flg = PETSC_FALSE;
diff -r 3923fa35e382 src/dm/examples/tests/ex7.c
--- a/src/dm/examples/tests/ex7.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex7.c	Thu Mar 10 16:31:28 2011 -0700
@@ -11,7 +11,7 @@
   PetscInt       M=8,dof=1,stencil_width=1,i,start,end,P=5,N = 6,m=PETSC_DECIDE,n=PETSC_DECIDE,p=PETSC_DECIDE,pt = 0,st = 0;
   PetscErrorCode ierr;
   PetscBool      flg = PETSC_FALSE,flg2,flg3;
-  DMDAPeriodicType periodic;
+  DMDABoundaryType periodic;
   DMDAStencilType  stencil_type;
   DM             da;
   Vec            local,global,local_copy;
@@ -28,7 +28,7 @@
   ierr = PetscOptionsGetInt(PETSC_NULL,"-dof",&dof,PETSC_NULL);CHKERRQ(ierr); 
   ierr = PetscOptionsGetInt(PETSC_NULL,"-stencil_width",&stencil_width,PETSC_NULL);CHKERRQ(ierr); 
   ierr = PetscOptionsGetInt(PETSC_NULL,"-periodic",&pt,PETSC_NULL);CHKERRQ(ierr); 
-  periodic = (DMDAPeriodicType) pt;
+  periodic = (DMDABoundaryType) pt;
   ierr = PetscOptionsGetInt(PETSC_NULL,"-stencil_type",&st,PETSC_NULL);CHKERRQ(ierr); 
   stencil_type = (DMDAStencilType) st;
 
diff -r 3923fa35e382 src/dm/examples/tests/ex8.c
--- a/src/dm/examples/tests/ex8.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tests/ex8.c	Thu Mar 10 16:31:28 2011 -0700
@@ -88,7 +88,7 @@
   DM             da;
   Vec            local,global,vslice;
   PetscScalar    value;
-  DMDAPeriodicType wrap = DMDA_XYPERIODIC;
+  DMDABoundaryType wrap = DMDA_XYPERIODIC;
   DMDAStencilType  stencil_type = DMDA_STENCIL_BOX;
   VecScatter     scatter;
 
diff -r 3923fa35e382 src/dm/examples/tutorials/ex1.c
--- a/src/dm/examples/tutorials/ex1.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tutorials/ex1.c	Thu Mar 10 16:31:28 2011 -0700
@@ -44,7 +44,7 @@
   PetscViewer    viewer;
   Vec            local,global;
   PetscScalar    value;
-  DMDAPeriodicType ptype = DMDA_NONPERIODIC;
+  DMDABoundaryType ptype = DMDA_NONPERIODIC;
   DMDAStencilType  stype = DMDA_STENCIL_BOX;
 #if defined(PETSC_HAVE_MATLAB_ENGINE)
   PetscViewer    mviewer;
diff -r 3923fa35e382 src/dm/examples/tutorials/ex12.c
--- a/src/dm/examples/tutorials/ex12.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tutorials/ex12.c	Thu Mar 10 16:31:28 2011 -0700
@@ -20,7 +20,7 @@
   PetscBool      flg = PETSC_FALSE;
   DM             da;
   Vec            global1,global2,global3;
-  DMDAPeriodicType ptype = DMDA_NONPERIODIC;
+  DMDABoundaryType ptype = DMDA_NONPERIODIC;
   DMDAStencilType  stype = DMDA_STENCIL_BOX;
 
   ierr = PetscInitialize(&argc,&argv,(char*)0,help);CHKERRQ(ierr); 
diff -r 3923fa35e382 src/dm/examples/tutorials/ex2.c
--- a/src/dm/examples/tutorials/ex2.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tutorials/ex2.c	Thu Mar 10 16:31:28 2011 -0700
@@ -15,7 +15,7 @@
   PetscViewer    viewer;
   Vec            localall,global;
   PetscScalar    value,*vlocal;
-  DMDAPeriodicType ptype = DMDA_NONPERIODIC;
+  DMDABoundaryType ptype = DMDA_NONPERIODIC;
   DMDAStencilType  stype = DMDA_STENCIL_BOX;
   VecScatter     tolocalall,fromlocalall;
   PetscInt       start,end;
diff -r 3923fa35e382 src/dm/examples/tutorials/ex3.c
--- a/src/dm/examples/tutorials/ex3.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tutorials/ex3.c	Thu Mar 10 16:31:28 2011 -0700
@@ -109,7 +109,7 @@
   PetscInt       M = 5,N = 4,P = 3, m = PETSC_DECIDE,n = PETSC_DECIDE,p = PETSC_DECIDE,dim = 1;
   PetscErrorCode ierr;
   DM             dac,daf;
-  DMDAPeriodicType ptype = DMDA_NONPERIODIC;
+  DMDABoundaryType ptype = DMDA_NONPERIODIC;
   DMDAStencilType  stype = DMDA_STENCIL_BOX;
   Mat            A;
 
diff -r 3923fa35e382 src/dm/examples/tutorials/ex5.c
--- a/src/dm/examples/tutorials/ex5.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/examples/tutorials/ex5.c	Thu Mar 10 16:31:28 2011 -0700
@@ -15,7 +15,7 @@
   PetscViewer    viewer;
   Vec            local,global;
   PetscScalar    value;
-  DMDAPeriodicType ptype = DMDA_NONPERIODIC;
+  DMDABoundaryType ptype = DMDA_NONPERIODIC;
   DMDAStencilType  stype = DMDA_STENCIL_BOX;
   PetscScalar    *lv;
 
diff -r 3923fa35e382 src/dm/impls/da/da.c
--- a/src/dm/impls/da/da.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/da.c	Thu Mar 10 16:31:28 2011 -0700
@@ -107,9 +107,9 @@
   Level: intermediate
 
 .keywords:  distributed array, periodicity
-.seealso: DMDACreate(), DMDestroy(), DMDA, DMDAPeriodicType
+.seealso: DMDACreate(), DMDestroy(), DMDA, DMDABoundaryType
 @*/
-PetscErrorCode  DMDASetPeriodicity(DM da, DMDAPeriodicType ptype)
+PetscErrorCode  DMDASetPeriodicity(DM da, DMDABoundaryType ptype)
 {
   DM_DA *dd = (DM_DA*)da->data;
 
diff -r 3923fa35e382 src/dm/impls/da/da1.c
--- a/src/dm/impls/da/da1.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/da1.c	Thu Mar 10 16:31:28 2011 -0700
@@ -6,9 +6,9 @@
 
 #include "private/daimpl.h"     /*I  "petscdm.h"   I*/
 
-const char *DMDAPeriodicTypes[] = {"NONPERIODIC","XPERIODIC","YPERIODIC","XYPERIODIC",
+const char *DMDABoundaryTypes[] = {"NONPERIODIC","XPERIODIC","YPERIODIC","XYPERIODIC",
                                    "XYZPERIODIC","XZPERIODIC","YZPERIODIC","ZPERIODIC",
-                                   "XYZGHOSTED","DMDAPeriodicType","DMDA_",0};
+                                   "XYZGHOSTED","DMDABoundaryType","DMDA_",0};
 
 #undef __FUNCT__  
 #define __FUNCT__ "DMView_DA_1d"
@@ -137,7 +137,7 @@
   const PetscInt         s     = dd->s;
   const PetscInt         sDist = s*dof;  /* absolute stencil distance */
   const PetscInt         *lx    = dd->lx;
-  const DMDAPeriodicType wrap  = dd->wrap;
+  const DMDABoundaryType wrap  = dd->wrap;
   MPI_Comm               comm;
   Vec                    local, global;
   VecScatter             ltog, gtol;
@@ -297,7 +297,7 @@
   */
   for (i=0; i<Xe-IXe; i++) {idx[nn++] = -1; } /* pad with -1s if needed for ghosted case*/
 
-  ierr = ISLocalToGlobalMappingCreate(comm,nn,idx,PETSC_OWN_POINTER,&da->ltogmap);CHKERRQ(ierr);
+  ierr = ISLocalToGlobalMappingCreate(comm,nn,idx,PETSC_COPY_VALUES,&da->ltogmap);CHKERRQ(ierr);
   ierr = ISLocalToGlobalMappingBlock(da->ltogmap,dd->w,&da->ltogmapb);CHKERRQ(ierr);
   ierr = PetscLogObjectParent(da,da->ltogmap);CHKERRQ(ierr);
 
@@ -350,7 +350,7 @@
           DMDAGetInfo(), DMCreateGlobalVector(), DMCreateLocalVector(), DMDACreateNaturalVector(), DMDALoad(), DMDAGetOwnershipRanges()
 
 @*/
-PetscErrorCode  DMDACreate1d(MPI_Comm comm, DMDAPeriodicType wrap, PetscInt M, PetscInt dof, PetscInt s, const PetscInt lx[], DM *da)
+PetscErrorCode  DMDACreate1d(MPI_Comm comm, DMDABoundaryType wrap, PetscInt M, PetscInt dof, PetscInt s, const PetscInt lx[], DM *da)
 {
   PetscErrorCode ierr;
   PetscMPIInt    size;
diff -r 3923fa35e382 src/dm/impls/da/da2.c
--- a/src/dm/impls/da/da2.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/da2.c	Thu Mar 10 16:31:28 2011 -0700
@@ -1236,7 +1236,7 @@
   PetscInt               n            = dd->n;
   const PetscInt         dof          = dd->w;
   const PetscInt         s            = dd->s;
-  const DMDAPeriodicType wrap         = dd->wrap;
+  const DMDABoundaryType wrap         = dd->wrap;
   const DMDAStencilType  stencil_type = dd->stencil_type;
   PetscInt               *lx           = dd->lx;
   PetscInt               *ly           = dd->ly;
@@ -1245,7 +1245,7 @@
   PetscInt               xs,xe,ys,ye,x,y,Xs,Xe,Ys,Ye,start,end,IXs,IXe,IYs,IYe;
   PetscInt               up,down,left,right,i,n0,n1,n2,n3,n5,n6,n7,n8,*idx,nn,*idx_cpy;
   const PetscInt         *idx_full;
-  PetscInt               xbase,*bases,*ldims,j,x_t,y_t,s_t,base,count,count_dbg;
+  PetscInt               xbase,*bases,*ldims,j,x_t,y_t,s_t,base,count;
   PetscInt               s_x,s_y; /* s proportionalized to w */
   PetscInt               sn0 = 0,sn2 = 0,sn6 = 0,sn8 = 0;
   Vec                    local,global;
@@ -1393,7 +1393,7 @@
   ierr = VecGetOwnershipRange(global,&start,&end);CHKERRQ(ierr);
   ierr = ISCreateStride(comm,x*y*dof,start,1,&to);CHKERRQ(ierr);
 
-  count_dbg = x*y;
+  count = x*y;
   ierr = PetscMalloc(x*y*sizeof(PetscInt),&idx);CHKERRQ(ierr);
   left = xs - Xs; right = left + x;
   down = ys - Ys; up = down + y;
@@ -1403,10 +1403,6 @@
       idx[count++] = i*(Xe-Xs) + j;
     }
   }
-  if (count != count_dbg) {
-    SETERRQ(((PetscObject)da)->comm, PETSC_ERR_SUP,"count != count_dbg");
-    PetscFunctionReturn(1);
-  }
 
   ierr = ISCreateBlock(comm,dof,count,idx,PETSC_OWN_POINTER,&from);CHKERRQ(ierr);
   ierr = VecScatterCreate(local,from,global,to,&ltog);CHKERRQ(ierr);
@@ -1417,8 +1413,8 @@
   /* global to local must include ghost points within the domain,
      but not ghost points outside the domain that aren't periodic */
   if (stencil_type == DMDA_STENCIL_BOX) {
-    count_dbg = (IXe-IXs)*(IYe-IYs);
-    ierr  = PetscMalloc(count_dbg*sizeof(PetscInt),&idx);CHKERRQ(ierr);
+    count = (IXe-IXs)*(IYe-IYs);
+    ierr  = PetscMalloc(count*sizeof(PetscInt),&idx);CHKERRQ(ierr);
 
     left = IXs - Xs; right = left + (IXe-IXs);
     down = IYs - Ys; up = down + (IYe-IYs);
@@ -1428,10 +1424,6 @@
         idx[count++] = j + i*(Xe-Xs);
       }
     }
-    if (count != count_dbg) {
-      SETERRQ(((PetscObject)da)->comm, PETSC_ERR_SUP,"count != count_dbg");
-      PetscFunctionReturn(1);
-    }
     ierr = ISCreateBlock(comm,dof,count,idx,PETSC_OWN_POINTER,&to);CHKERRQ(ierr);
 
   } else {
@@ -1445,8 +1437,8 @@
             | bottom  |
             -----------
          Xs xs        xe Xe */
-    count_dbg = (ys-IYs)*x + y*(IXe-IXs) + (IYe-ye)*x;
-    ierr  = PetscMalloc(count_dbg*sizeof(PetscInt),&idx);CHKERRQ(ierr);
+    count = (ys-IYs)*x + y*(IXe-IXs) + (IYe-ye)*x;
+    ierr  = PetscMalloc(count*sizeof(PetscInt),&idx);CHKERRQ(ierr);
 
     left = xs - Xs; right = left + x;
     down = ys - Ys; up = down + y;
@@ -1469,10 +1461,6 @@
         idx[count++] = j + i*(Xe-Xs);
       }
     }
-    if (count != count_dbg) {
-      SETERRQ(((PetscObject)da)->comm, PETSC_ERR_SUP,"count != count_dbg");
-      PetscFunctionReturn(1);
-    }
     ierr = ISCreateBlock(comm,dof,count,idx,PETSC_OWN_POINTER,&to);CHKERRQ(ierr);
   }
 
@@ -1725,16 +1713,11 @@
      Set the local to global ordering in the global vector, this allows use
      of VecSetValuesLocal().
   */
-  if (nn != (Xe-Xs)*(Ye-Ys)) {
-    SETERRQ(((PetscObject)da)->comm, PETSC_ERR_SUP,"nn != count_dbg");
-    PetscFunctionReturn(1);
-  }
   ierr = ISCreateBlock(comm,dof,nn,idx,PETSC_OWN_POINTER,&ltogis);CHKERRQ(ierr);
   ierr = PetscMalloc(nn*dof*sizeof(PetscInt),&idx_cpy);CHKERRQ(ierr);
-  /*  ierr = PetscLogObjectMemory(da,nn*dof*sizeof(PetscInt));CHKERRQ(ierr);*/
+  ierr = PetscLogObjectMemory(da,nn*dof*sizeof(PetscInt));CHKERRQ(ierr);
   ierr = ISGetIndices(ltogis, &idx_full);
   ierr = PetscMemcpy(idx_cpy,idx_full,nn*dof*sizeof(PetscInt));CHKERRQ(ierr);
-  CHKMEMQ;
   ierr = ISRestoreIndices(ltogis, &idx_full);
   ierr = ISLocalToGlobalMappingCreateIS(ltogis,&da->ltogmap);CHKERRQ(ierr);
   ierr = PetscLogObjectParent(da,da->ltogmap);CHKERRQ(ierr);
@@ -1818,7 +1801,7 @@
           DMDAGetInfo(), DMCreateGlobalVector(), DMCreateLocalVector(), DMDACreateNaturalVector(), DMDALoad(), DMDAGetOwnershipRanges()
 
 @*/
-PetscErrorCode  DMDACreate2d(MPI_Comm comm,DMDAPeriodicType wrap,DMDAStencilType stencil_type,
+PetscErrorCode  DMDACreate2d(MPI_Comm comm,DMDABoundaryType wrap,DMDAStencilType stencil_type,
                           PetscInt M,PetscInt N,PetscInt m,PetscInt n,PetscInt dof,PetscInt s,const PetscInt lx[],const PetscInt ly[],DM *da)
 {
   PetscErrorCode ierr;
diff -r 3923fa35e382 src/dm/impls/da/da3.c
--- a/src/dm/impls/da/da3.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/da3.c	Thu Mar 10 16:31:28 2011 -0700
@@ -173,7 +173,7 @@
   PetscInt               p            = dd->p;
   const PetscInt         dof          = dd->w;
   const PetscInt         s            = dd->s;
-  const DMDAPeriodicType wrap         = dd->wrap;
+  const DMDABoundaryType wrap         = dd->wrap;
   const DMDAStencilType  stencil_type = dd->stencil_type;
   PetscInt               *lx           = dd->lx;
   PetscInt               *ly           = dd->ly;
@@ -186,7 +186,7 @@
   const PetscInt         *idx_full;
   PetscInt               n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n14;
   PetscInt               n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26;
-  PetscInt               *bases,*ldims,base,x_t,y_t,z_t,s_t,count,count_dbg,s_x,s_y,s_z;
+  PetscInt               *bases,*ldims,base,x_t,y_t,z_t,s_t,count,s_x,s_y,s_z;
   PetscInt               sn0 = 0,sn1 = 0,sn2 = 0,sn3 = 0,sn5 = 0,sn6 = 0,sn7 = 0;
   PetscInt               sn8 = 0,sn9 = 0,sn11 = 0,sn15 = 0,sn24 = 0,sn25 = 0,sn26 = 0;
   PetscInt               sn17 = 0,sn18 = 0,sn19 = 0,sn20 = 0,sn21 = 0,sn23 = 0;
@@ -377,7 +377,7 @@
   ierr = VecGetOwnershipRange(global,&start,&end);CHKERRQ(ierr);
   ierr = ISCreateStride(comm,x*y*z*dof,start,1,&to);CHKERRQ(ierr);
 
-  count_dbg = x*y*z;
+  count = x*y*z;
   ierr = PetscMalloc(x*y*z*sizeof(PetscInt),&idx);CHKERRQ(ierr);
   left   = xs - Xs; right = left + x;
   bottom = ys - Ys; top = bottom + y;
@@ -391,10 +391,6 @@
     }
   }
 
-  if (count != count_dbg) {
-    SETERRQ(((PetscObject)da)->comm, PETSC_ERR_SUP,"count != count_dbg");
-    PetscFunctionReturn(1);
-  }
   ierr = ISCreateBlock(comm,dof,count,idx,PETSC_OWN_POINTER,&from);CHKERRQ(ierr);
   ierr = VecScatterCreate(local,from,global,to,&ltog);CHKERRQ(ierr);
   ierr = PetscLogObjectParent(da,ltog);CHKERRQ(ierr);
@@ -404,8 +400,8 @@
   /* global to local must include ghost points within the domain,
      but not ghost points outside the domain that aren't periodic */
   if (stencil_type == DMDA_STENCIL_BOX) {
-    count_dbg = (IXe-IXs)*(IYe-IYs)*(IZe-IZs);
-    ierr  = PetscMalloc(count_dbg*sizeof(PetscInt),&idx);CHKERRQ(ierr);
+    count = (IXe-IXs)*(IYe-IYs)*(IZe-IZs);
+    ierr  = PetscMalloc(count*sizeof(PetscInt),&idx);CHKERRQ(ierr);
 
     left   = IXs - Xs; right = left + (IXe-IXs);
     bottom = IYs - Ys; top = bottom + (IYe-IYs);
@@ -418,16 +414,12 @@
         }
       }
     }
-    if (count != count_dbg) {
-      SETERRQ(((PetscObject)da)->comm, PETSC_ERR_SUP,"count != count_dbg");
-      PetscFunctionReturn(1);
-    }
     ierr = ISCreateBlock(comm,dof,count,idx,PETSC_OWN_POINTER,&to);CHKERRQ(ierr);
 
   } else {
     /* This is way ugly! We need to list the funny cross type region */
-    count_dbg = ((ys-IYs) + (IYe-ye))*x*z + ((xs-IXs) + (IXe-xe))*y*z + ((zs-IZs) + (IZe-ze))*x*y + x*y*z;
-    ierr   = PetscMalloc(count_dbg*sizeof(PetscInt),&idx);CHKERRQ(ierr);
+    count = ((ys-IYs) + (IYe-ye))*x*z + ((xs-IXs) + (IXe-xe))*y*z + ((zs-IZs) + (IZe-ze))*x*y + x*y*z;
+    ierr   = PetscMalloc(count*sizeof(PetscInt),&idx);CHKERRQ(ierr);
 
     left   = xs - Xs; right = left + x;
     bottom = ys - Ys; top = bottom + y;
@@ -460,10 +452,6 @@
         for (k=left; k<right; k++) idx[count++] = (i*(Ye-Ys) + j)*(Xe-Xs) + k;
       }
     }
-    if (count != count_dbg) {
-      SETERRQ(((PetscObject)da)->comm, PETSC_ERR_SUP,"count != count_dbg");
-      PetscFunctionReturn(1);
-    }
     ierr = ISCreateBlock(comm,dof,count,idx,PETSC_OWN_POINTER,&to);CHKERRQ(ierr);
   }
 
@@ -1264,16 +1252,11 @@
      Set the local to global ordering in the global vector, this allows use
      of VecSetValuesLocal().
   */
-  if (nn != (Xe-Xs)*(Ye-Ys)*(Ze-Zs)) {
-    SETERRQ(((PetscObject)da)->comm, PETSC_ERR_SUP,"nn != count_dbg");
-    PetscFunctionReturn(1);
-  }
   ierr = ISCreateBlock(comm,dof,nn,idx,PETSC_OWN_POINTER,&ltogis);CHKERRQ(ierr);
   ierr = PetscMalloc(nn*dof*sizeof(PetscInt),&idx_cpy);CHKERRQ(ierr);
-  /* ierr = PetscLogObjectMemory(da,nn*dof*sizeof(PetscInt));CHKERRQ(ierr); */
+  ierr = PetscLogObjectMemory(da,nn*dof*sizeof(PetscInt));CHKERRQ(ierr);
   ierr = ISGetIndices(ltogis, &idx_full);
   ierr = PetscMemcpy(idx_cpy,idx_full,nn*dof*sizeof(PetscInt));CHKERRQ(ierr);
-  CHKMEMQ;
   ierr = ISRestoreIndices(ltogis, &idx_full);
   ierr = ISLocalToGlobalMappingCreateIS(ltogis,&da->ltogmap);CHKERRQ(ierr);
   ierr = PetscLogObjectParent(da,da->ltogmap);CHKERRQ(ierr);
@@ -1361,7 +1344,7 @@
           DMDAGetInfo(), DMCreateGlobalVector(), DMCreateLocalVector(), DMDACreateNaturalVector(), DMDALoad(), DMDAGetOwnershipRanges()
 
 @*/
-PetscErrorCode  DMDACreate3d(MPI_Comm comm,DMDAPeriodicType wrap,DMDAStencilType stencil_type,PetscInt M,
+PetscErrorCode  DMDACreate3d(MPI_Comm comm,DMDABoundaryType wrap,DMDAStencilType stencil_type,PetscInt M,
                PetscInt N,PetscInt P,PetscInt m,PetscInt n,PetscInt p,PetscInt dof,PetscInt s,const PetscInt lx[],const PetscInt ly[],const PetscInt lz[],DM *da)
 {
   PetscErrorCode ierr;
diff -r 3923fa35e382 src/dm/impls/da/dacorn.c
--- a/src/dm/impls/da/dacorn.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/dacorn.c	Thu Mar 10 16:31:28 2011 -0700
@@ -152,7 +152,7 @@
     ierr = MPI_Comm_size(((PetscObject)da)->comm,&size);CHKERRQ(ierr);
     if (dd->dim == 1) {
       PetscInt            s,m,*lc,l;
-      DMDAPeriodicType pt;
+      DMDABoundaryType pt;
       ierr = DMDAGetInfo(da,0,&m,0,0,0,0,0,0,&s,&pt,0);CHKERRQ(ierr);
       ierr = DMDAGetCorners(da,0,0,0,&l,0,0);CHKERRQ(ierr);
       ierr = PetscMalloc(size*sizeof(PetscInt),&lc);CHKERRQ(ierr);
@@ -161,7 +161,7 @@
       ierr = PetscFree(lc);CHKERRQ(ierr);
     } else if (dd->dim == 2) {
       PetscInt            i,s,m,*lc,*ld,l,k,n,M,N;
-      DMDAPeriodicType pt;
+      DMDABoundaryType pt;
       ierr = DMDAGetInfo(da,0,&m,&n,0,&M,&N,0,0,&s,&pt,0);CHKERRQ(ierr);
       ierr = DMDAGetCorners(da,0,0,0,&l,&k,0);CHKERRQ(ierr);
       ierr = PetscMalloc2(size,PetscInt,&lc,size,PetscInt,&ld);CHKERRQ(ierr);
@@ -176,7 +176,7 @@
       ierr = PetscFree2(lc,ld);CHKERRQ(ierr);
     } else if (dd->dim == 3) {
       PetscInt            i,s,m,*lc,*ld,*le,l,k,q,n,M,N,P,p;
-      DMDAPeriodicType pt;
+      DMDABoundaryType pt;
       ierr = DMDAGetInfo(da,0,&m,&n,&p,&M,&N,&P,0,&s,&pt,0);CHKERRQ(ierr);
       ierr = DMDAGetCorners(da,0,0,0,&l,&k,&q);CHKERRQ(ierr);
       ierr = PetscMalloc3(size,PetscInt,&lc,size,PetscInt,&ld,size,PetscInt,&le);CHKERRQ(ierr);
diff -r 3923fa35e382 src/dm/impls/da/dadestroy.c
--- a/src/dm/impls/da/dadestroy.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/dadestroy.c	Thu Mar 10 16:31:28 2011 -0700
@@ -106,6 +106,7 @@
     ierr = AODestroy(dd->ao);CHKERRQ(ierr);
   }
 
+  ierr = PetscFree(dd->idx);CHKERRQ(ierr);
   ierr = PetscFree(dd->lx);CHKERRQ(ierr);
   ierr = PetscFree(dd->ly);CHKERRQ(ierr);
   ierr = PetscFree(dd->lz);CHKERRQ(ierr);
diff -r 3923fa35e382 src/dm/impls/da/dainterp.c
--- a/src/dm/impls/da/dainterp.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/dainterp.c	Thu Mar 10 16:31:28 2011 -0700
@@ -53,7 +53,7 @@
   PetscInt         i_c,i_start_c,i_start_ghost_c,cols[2],dof;
   PetscScalar      v[2],x,*coors = 0,*ccoors;
   Mat              mat;
-  DMDAPeriodicType pt;
+  DMDABoundaryType pt;
   Vec              vcoors,cvcoors;
   DM_DA            *ddc = (DM_DA*)dac->data, *ddf = (DM_DA*)daf->data;
   
@@ -191,7 +191,7 @@
   PetscInt         i_c,i_start_c,i_start_ghost_c,cols[2],dof;
   PetscScalar      v[2],x;
   Mat              mat;
-  DMDAPeriodicType pt;
+  DMDABoundaryType pt;
   
   PetscFunctionBegin;
   ierr = DMDAGetInfo(dac,0,&Mx,0,0,0,0,0,0,0,&pt,0);CHKERRQ(ierr);
@@ -264,7 +264,7 @@
   PetscMPIInt      size_c,size_f,rank_f;
   PetscScalar      v[4],x,y;
   Mat              mat;
-  DMDAPeriodicType pt;
+  DMDABoundaryType pt;
   DMDACoor2d       **coors = 0,**ccoors;
   Vec              vcoors,cvcoors;
   DM_DA            *ddc = (DM_DA*)dac->data, *ddf = (DM_DA*)daf->data;
@@ -504,7 +504,7 @@
   PetscMPIInt      size_c,size_f,rank_f;
   PetscScalar      v[4];
   Mat              mat;
-  DMDAPeriodicType pt;
+  DMDABoundaryType pt;
 
   PetscFunctionBegin;
   ierr = DMDAGetInfo(dac,0,&Mx,&My,0,0,0,0,0,0,&pt,0);CHKERRQ(ierr);
@@ -615,7 +615,7 @@
   PetscMPIInt      size_c,size_f,rank_f;
   PetscScalar      v[8];
   Mat              mat;
-  DMDAPeriodicType pt;
+  DMDABoundaryType pt;
   
   PetscFunctionBegin;
   ierr = DMDAGetInfo(dac,0,&Mx,&My,&Mz,0,0,0,0,0,&pt,0);CHKERRQ(ierr);
@@ -735,7 +735,7 @@
   PetscInt         l_start_ghost_c,p_ghost_c,l_c,*dnz,*onz;
   PetscScalar      v[8],x,y,z;
   Mat              mat;
-  DMDAPeriodicType pt;
+  DMDABoundaryType pt;
   DMDACoor3d       ***coors = 0,***ccoors;
   Vec              vcoors,cvcoors;
   DM_DA            *ddc = (DM_DA*)dac->data, *ddf = (DM_DA*)daf->data;
@@ -1023,7 +1023,7 @@
 {
   PetscErrorCode   ierr;
   PetscInt         dimc,Mc,Nc,Pc,mc,nc,pc,dofc,sc,dimf,Mf,Nf,Pf,mf,nf,pf,doff,sf;
-  DMDAPeriodicType wrapc,wrapf;
+  DMDABoundaryType wrapc,wrapf;
   DMDAStencilType  stc,stf;
   DM_DA            *ddc = (DM_DA*)dac->data;
 
@@ -1081,7 +1081,7 @@
   PetscInt         row,i_start_ghost,j_start_ghost,mx,m_c,my,nc,ratioi,ratioj;
   PetscInt         i_start_c,j_start_c,n_c,i_start_ghost_c,j_start_ghost_c;
   PetscInt         *cols;
-  DMDAPeriodicType pt;
+  DMDABoundaryType pt;
   Vec              vecf,vecc;
   IS               isf;
 
@@ -1152,7 +1152,7 @@
   PetscInt         row,nc,dof;
   PetscInt         *idx_c,*idx_f;
   PetscInt         *cols;
-  DMDAPeriodicType pt;
+  DMDABoundaryType pt;
   Vec              vecf,vecc;
   IS               isf;
 
@@ -1226,7 +1226,7 @@
 {
   PetscErrorCode   ierr;
   PetscInt         dimc,Mc,Nc,Pc,mc,nc,pc,dofc,sc,dimf,Mf,Nf,Pf,mf,nf,pf,doff,sf;
-  DMDAPeriodicType wrapc,wrapf;
+  DMDABoundaryType wrapc,wrapf;
   DMDAStencilType  stc,stf;
 
   PetscFunctionBegin;
@@ -1262,7 +1262,7 @@
   PetscErrorCode   ierr;
   PetscInt         dimc,Mc,Nc,Pc,mc,nc,pc,dofc,sc;
   PetscInt         dimf,Mf,Nf,Pf,mf,nf,pf,doff,sf;
-  DMDAPeriodicType wrapc,wrapf;
+  DMDABoundaryType wrapc,wrapf;
   DMDAStencilType  stc,stf;
   PetscInt         i,j,l;
   PetscInt         i_start,j_start,l_start, m_f,n_f,p_f;
diff -r 3923fa35e382 src/dm/impls/da/daload.c
--- a/src/dm/impls/da/daload.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/daload.c	Thu Mar 10 16:31:28 2011 -0700
@@ -45,11 +45,11 @@
   if (nmax != 8) SETERRQ1(((PetscObject)viewer)->comm,PETSC_ERR_FILE_UNEXPECTED,"Wrong number of items in DMDA information in file: %D",nmax);
 
   if (info[0] == 1) {
-    ierr = DMDACreate1d(comm,(DMDAPeriodicType) info[7],info[1],info[4],info[5],0,da);CHKERRQ(ierr);
+    ierr = DMDACreate1d(comm,(DMDABoundaryType) info[7],info[1],info[4],info[5],0,da);CHKERRQ(ierr);
   } else if (info[0] == 2) {
-    ierr = DMDACreate2d(comm,(DMDAPeriodicType) info[7],(DMDAStencilType) info[6],info[1],info[2],M,N,info[4],info[5],0,0,da);CHKERRQ(ierr);
+    ierr = DMDACreate2d(comm,(DMDABoundaryType) info[7],(DMDAStencilType) info[6],info[1],info[2],M,N,info[4],info[5],0,0,da);CHKERRQ(ierr);
   } else if (info[0] == 3) {
-    ierr = DMDACreate3d(comm,(DMDAPeriodicType) info[7],(DMDAStencilType) info[6],info[1],info[2],info[3],M,N,P,info[4],info[5],0,0,0,da);CHKERRQ(ierr);
+    ierr = DMDACreate3d(comm,(DMDABoundaryType) info[7],(DMDAStencilType) info[6],info[1],info[2],info[3],M,N,P,info[4],info[5],0,0,0,da);CHKERRQ(ierr);
   } else SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_FILE_UNEXPECTED,"Dimension in info file is not 1, 2, or 3 it is %D",info[0]);
 
   for (i=0; i<info[4]; i++) {
diff -r 3923fa35e382 src/dm/impls/da/daview.c
--- a/src/dm/impls/da/daview.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/daview.c	Thu Mar 10 16:31:28 2011 -0700
@@ -17,7 +17,7 @@
   PetscMPIInt      rank;
   PetscInt         dim,m,n,p,dof,swidth;
   DMDAStencilType  stencil;
-  DMDAPeriodicType periodic;
+  DMDABoundaryType periodic;
   mxArray          *mx;
   const char       *fnames[] = {"dimension","m","n","p","dof","stencil_width","periodicity","stencil_type"};
 
@@ -51,7 +51,7 @@
   PetscInt         i,dim,m,n,p,dof,swidth,M,N,P;
   size_t           j,len;
   DMDAStencilType  stencil;
-  DMDAPeriodicType periodic;
+  DMDABoundaryType periodic;
   MPI_Comm         comm;
   DM_DA            *dd = (DM_DA*)da->data;
 
@@ -176,7 +176,7 @@
 
 .seealso: DMView(), DMDAGetCorners(), DMDAGetLocalInfo()
 @*/
-PetscErrorCode  DMDAGetInfo(DM da,PetscInt *dim,PetscInt *M,PetscInt *N,PetscInt *P,PetscInt *m,PetscInt *n,PetscInt *p,PetscInt *dof,PetscInt *s,DMDAPeriodicType *wrap,DMDAStencilType *st)
+PetscErrorCode  DMDAGetInfo(DM da,PetscInt *dim,PetscInt *M,PetscInt *N,PetscInt *P,PetscInt *m,PetscInt *n,PetscInt *p,PetscInt *dof,PetscInt *s,DMDABoundaryType *wrap,DMDAStencilType *st)
 {
   DM_DA *dd = (DM_DA*)da->data;
 
diff -r 3923fa35e382 src/dm/impls/da/fdda.c
--- a/src/dm/impls/da/fdda.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/fdda.c	Thu Mar 10 16:31:28 2011 -0700
@@ -131,7 +131,7 @@
 {
   PetscErrorCode   ierr;
   PetscInt         dim,m,n,p,nc;
-  DMDAPeriodicType wrap;
+  DMDABoundaryType wrap;
   MPI_Comm         comm;
   PetscMPIInt      size;
   PetscBool        isBAIJ;
@@ -221,7 +221,7 @@
   PetscInt               xs,ys,nx,ny,i,j,ii,gxs,gys,gnx,gny,m,n,M,N,dim,s,k,nc,col;
   PetscInt               ncolors;
   MPI_Comm               comm;
-  DMDAPeriodicType       wrap;
+  DMDABoundaryType       wrap;
   DMDAStencilType        st;
   ISColoringValue        *colors;
   DM_DA                  *dd = (DM_DA*)da->data;
@@ -301,7 +301,7 @@
   PetscInt          xs,ys,nx,ny,i,j,gxs,gys,gnx,gny,m,n,p,dim,s,k,nc,col,zs,gzs,ii,l,nz,gnz,M,N,P;
   PetscInt          ncolors;
   MPI_Comm          comm;
-  DMDAPeriodicType  wrap;
+  DMDABoundaryType  wrap;
   DMDAStencilType   st;
   ISColoringValue   *colors;
   DM_DA             *dd = (DM_DA*)da->data;
@@ -383,7 +383,7 @@
   PetscInt          xs,nx,i,i1,gxs,gnx,l,m,M,dim,s,nc,col;
   PetscInt          ncolors;
   MPI_Comm          comm;
-  DMDAPeriodicType  wrap;
+  DMDABoundaryType  wrap;
   ISColoringValue   *colors;
   DM_DA             *dd = (DM_DA*)da->data;
 
@@ -447,7 +447,7 @@
   PetscInt          xs,ys,nx,ny,i,j,ii,gxs,gys,gnx,gny,m,n,dim,s,k,nc;
   PetscInt          ncolors;
   MPI_Comm          comm;
-  DMDAPeriodicType  wrap;
+  DMDABoundaryType  wrap;
   ISColoringValue   *colors;
   DM_DA             *dd = (DM_DA*)da->data;
 
@@ -762,7 +762,7 @@
   PetscInt               lstart,lend,pstart,pend,*dnz,*onz;
   MPI_Comm               comm;
   PetscScalar            *values;
-  DMDAPeriodicType       wrap;
+  DMDABoundaryType       wrap;
   ISLocalToGlobalMapping ltog,ltogb;
   DMDAStencilType        st;
   DM_DA                  *dd = (DM_DA*)da->data;
@@ -871,7 +871,7 @@
   PetscInt               ifill_col,*ofill = dd->ofill, *dfill = dd->dfill;
   MPI_Comm               comm;
   PetscScalar            *values;
-  DMDAPeriodicType       wrap;
+  DMDABoundaryType       wrap;
   ISLocalToGlobalMapping ltog,ltogb;
   DMDAStencilType        st;
 
@@ -999,7 +999,7 @@
   PetscInt               istart,iend,jstart,jend,kstart,kend,zs,nz,gzs,gnz,ii,jj,kk;
   MPI_Comm               comm;
   PetscScalar            *values;
-  DMDAPeriodicType       wrap;
+  DMDABoundaryType       wrap;
   ISLocalToGlobalMapping ltog,ltogb;
   DMDAStencilType        st;
   DM_DA                  *dd = (DM_DA*)da->data;
@@ -1115,7 +1115,7 @@
   PetscInt               m,dim,s,*cols = PETSC_NULL,nc,*rows = PETSC_NULL,col,cnt,l;
   PetscInt               istart,iend;
   PetscScalar            *values;
-  DMDAPeriodicType       wrap;
+  DMDABoundaryType       wrap;
   ISLocalToGlobalMapping ltog,ltogb;
   DM_DA                  *dd = (DM_DA*)da->data;
 
@@ -1181,7 +1181,7 @@
   PetscInt               istart,iend,jstart,jend,ii,jj;
   MPI_Comm               comm;
   PetscScalar            *values;
-  DMDAPeriodicType       wrap;
+  DMDABoundaryType       wrap;
   DMDAStencilType        st;
   ISLocalToGlobalMapping ltog,ltogb;
   DM_DA                  *dd = (DM_DA*)da->data;
@@ -1276,7 +1276,7 @@
   PetscInt               istart,iend,jstart,jend,kstart,kend,zs,nz,gzs,gnz,ii,jj,kk;
   MPI_Comm               comm;
   PetscScalar            *values;
-  DMDAPeriodicType       wrap;
+  DMDABoundaryType       wrap;
   DMDAStencilType        st;
   ISLocalToGlobalMapping ltog,ltogb;
   DM_DA                  *dd = (DM_DA*)da->data;
@@ -1408,7 +1408,7 @@
   PetscInt               istart,iend,jstart,jend,ii,jj;
   MPI_Comm               comm;
   PetscScalar            *values;
-  DMDAPeriodicType       wrap;
+  DMDABoundaryType       wrap;
   DMDAStencilType        st;
   ISLocalToGlobalMapping ltog,ltogb;
   DM_DA                  *dd = (DM_DA*)da->data;
@@ -1507,7 +1507,7 @@
   PetscInt               istart,iend,jstart,jend,kstart,kend,zs,nz,gzs,gnz,ii,jj,kk;
   MPI_Comm               comm;
   PetscScalar            *values;
-  DMDAPeriodicType       wrap;
+  DMDABoundaryType       wrap;
   DMDAStencilType        st;
   ISLocalToGlobalMapping ltog,ltogb;
   DM_DA                  *dd = (DM_DA*)da->data;
@@ -1624,7 +1624,7 @@
   PetscInt               ifill_col,*dfill = dd->dfill,*ofill = dd->ofill;
   MPI_Comm               comm;
   PetscScalar            *values;
-  DMDAPeriodicType       wrap;
+  DMDABoundaryType       wrap;
   ISLocalToGlobalMapping ltog,ltogb;
   DMDAStencilType        st;
 
diff -r 3923fa35e382 src/dm/impls/da/ftn-custom/zda1f.c
--- a/src/dm/impls/da/ftn-custom/zda1f.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/ftn-custom/zda1f.c	Thu Mar 10 16:31:28 2011 -0700
@@ -10,7 +10,7 @@
 
 EXTERN_C_BEGIN
 
-void PETSC_STDCALL dmdacreate1d_(MPI_Comm *comm,DMDAPeriodicType *wrap,PetscInt *M,PetscInt *w,PetscInt *s,
+void PETSC_STDCALL dmdacreate1d_(MPI_Comm *comm,DMDABoundaryType *wrap,PetscInt *M,PetscInt *w,PetscInt *s,
                  PetscInt *lc,DM *inra,PetscErrorCode *ierr)
 {
  CHKFORTRANNULLINTEGER(lc);
diff -r 3923fa35e382 src/dm/impls/da/ftn-custom/zda2f.c
--- a/src/dm/impls/da/ftn-custom/zda2f.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/ftn-custom/zda2f.c	Thu Mar 10 16:31:28 2011 -0700
@@ -112,7 +112,7 @@
 
 /************************************************/
 
-void PETSC_STDCALL dmdacreate2d_(MPI_Comm *comm,DMDAPeriodicType *wrap,DMDAStencilType
+void PETSC_STDCALL dmdacreate2d_(MPI_Comm *comm,DMDABoundaryType *wrap,DMDAStencilType
                   *stencil_type,PetscInt *M,PetscInt *N,PetscInt *m,PetscInt *n,PetscInt *w,
                   PetscInt *s,PetscInt *lx,PetscInt *ly,DM *inra,PetscErrorCode *ierr)
 {
diff -r 3923fa35e382 src/dm/impls/da/ftn-custom/zda3f.c
--- a/src/dm/impls/da/ftn-custom/zda3f.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/ftn-custom/zda3f.c	Thu Mar 10 16:31:28 2011 -0700
@@ -10,7 +10,7 @@
 
 EXTERN_C_BEGIN
 
-void PETSC_STDCALL dmdacreate3d_(MPI_Comm *comm,DMDAPeriodicType *wrap,DMDAStencilType 
+void PETSC_STDCALL dmdacreate3d_(MPI_Comm *comm,DMDABoundaryType *wrap,DMDAStencilType 
                  *stencil_type,PetscInt *M,PetscInt *N,PetscInt *P,PetscInt *m,PetscInt *n,PetscInt *p,
                  PetscInt *w,PetscInt *s,PetscInt *lx,PetscInt *ly,PetscInt *lz,DM *inra,PetscErrorCode *ierr)
 {
diff -r 3923fa35e382 src/dm/impls/da/ftn-custom/zdaviewf.c
--- a/src/dm/impls/da/ftn-custom/zdaviewf.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/ftn-custom/zdaviewf.c	Thu Mar 10 16:31:28 2011 -0700
@@ -10,7 +10,7 @@
 
 EXTERN_C_BEGIN
 void PETSC_STDCALL dmdagetinfo_(DM *da,PetscInt *dim,PetscInt *M,PetscInt *N,PetscInt *P,PetscInt *m,PetscInt *n,PetscInt *p,PetscInt *w,PetscInt *s,
-                DMDAPeriodicType *wrap,DMDAStencilType *st,PetscErrorCode *ierr)
+                DMDABoundaryType *wrap,DMDAStencilType *st,PetscErrorCode *ierr)
 {
   CHKFORTRANNULLINTEGER(dim);
   CHKFORTRANNULLINTEGER(M);
diff -r 3923fa35e382 src/dm/impls/da/gr1.c
--- a/src/dm/impls/da/gr1.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/gr1.c	Thu Mar 10 16:31:28 2011 -0700
@@ -28,7 +28,7 @@
 {
   MPI_Comm         comm;
   DM               cda;
-  DMDAPeriodicType periodic;
+  DMDABoundaryType periodic;
   Vec              xcoor;
   PetscScalar      *coors;
   PetscReal        hx,hy,hz_;
@@ -112,7 +112,7 @@
   MPI_Comm          comm;
   PetscDrawAxis     axis;
   Vec               xcoor;
-  DMDAPeriodicType  periodic;
+  DMDABoundaryType  periodic;
 
   PetscFunctionBegin;
   ierr = PetscViewerDrawGetDraw(v,0,&draw);CHKERRQ(ierr);
diff -r 3923fa35e382 src/dm/impls/da/gr2.c
--- a/src/dm/impls/da/gr2.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/gr2.c	Thu Mar 10 16:31:28 2011 -0700
@@ -83,7 +83,7 @@
   PetscBool          isnull,useports = PETSC_FALSE;
   MPI_Comm           comm;
   Vec                xlocal,xcoor,xcoorl;
-  DMDAPeriodicType   periodic;
+  DMDABoundaryType   periodic;
   DMDAStencilType    st;
   ZoomCtx            zctx;
   PetscDrawViewPorts *ports;
diff -r 3923fa35e382 src/dm/impls/da/hypre/mhyp.c
--- a/src/dm/impls/da/hypre/mhyp.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/dm/impls/da/hypre/mhyp.c	Thu Mar 10 16:31:28 2011 -0700
@@ -398,7 +398,7 @@
   Mat_HYPREStruct *ex = (Mat_HYPREStruct*) mat->data;
   PetscInt         dim,dof,sw[3],nx,ny,nz;
   int              ilower[3],iupper[3],ssize,i;
-  DMDAPeriodicType   p;
+  DMDABoundaryType   p;
   DMDAStencilType    st;
 
   PetscFunctionBegin;
@@ -838,7 +838,7 @@
   Mat_HYPRESStruct *ex = (Mat_HYPRESStruct*) mat->data;
   PetscInt          dim,dof,sw[3],nx,ny,nz;
   int               ilower[3],iupper[3],ssize,i;
-  DMDAPeriodicType    p;
+  DMDABoundaryType    p;
   DMDAStencilType     st;
   int               nparts= 1; /* assuming only one part */
   int               part  = 0;
diff -r 3923fa35e382 src/docs/tex/manual/part2.tex
--- a/src/docs/tex/manual/part2.tex	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/docs/tex/manual/part2.tex	Thu Mar 10 16:31:28 2011 -0700
@@ -543,7 +543,7 @@
 One creates a distributed array communication data structure 
 in two dimensions with the command 
 \begin{tabbing}
-  DMDACreate2d(MPI\_Comm comm,DMDAPeriodicType wrap,DMDAStencilType st,int M,\\
+  DMDACreate2d(MPI\_Comm comm,DMDABoundaryType wrap,DMDAStencilType st,int M,\\
              int N,int m,int n,int dof,int s,int *lx,int *ly,DM *da);
 \end{tabbing}
 The  \sindex{array, distributed} arguments
@@ -591,15 +591,15 @@
 The commands for creating distributed array communication data structures
 in one and three dimensions are analogous:
 \begin{tabbing}
-  DMDACreate1d(MPI\_Comm comm,DMDAPeriodicType wrap,int M,int w,int s,int *lc,DM *inra);\\
-  DMDACreate3d\=(MPI\_Comm comm,DMDAPeriodicType wrap,DMDAStencilType stencil\_type,\\
+  DMDACreate1d(MPI\_Comm comm,DMDABoundaryType wrap,int M,int w,int s,int *lc,DM *inra);\\
+  DMDACreate3d\=(MPI\_Comm comm,DMDABoundaryType wrap,DMDAStencilType stencil\_type,\\
              \>int M,int N,int P,int m,int n,int p,int w,int s,int *lx,int *ly,int *lz,DM *inra);
 \end{tabbing}
 \trl{DA_ZPERIODIC}, \findex{DA_ZPERIODIC}
 \trl{DA_XZPERIODIC}, \findex{DA_XZPERIODIC}
 \trl{DA_YZPERIODIC}, and \findex{DA_YZPERIODIC}
 \trl{DA_XYZPERIODIC} \findex{DA_XYZPERIODIC}
-are additional options in three dimensions for DMDAPeriodicType.
+are additional options in three dimensions for DMDABoundaryType.
 The routines to create distributed arrays are collective, so that all
 processes in the communicator \trl{comm} must call \trl{DACreateXXX()}.
 
diff -r 3923fa35e382 src/docs/website/documentation/changes/dev.html
--- a/src/docs/website/documentation/changes/dev.html	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/docs/website/documentation/changes/dev.html	Thu Mar 10 16:31:28 2011 -0700
@@ -299,6 +299,12 @@
 and DMGetLocalToGlobalMappingBlock() and are collective since they may
 be constructed lazily.</li>
         <li>DMGetBlockSize() is added.</li>
+	<li>Changed DMDAPeriodicType to DMDABoundaryType, and enabled
+ghost cells to be included in DM_DAs on domain boundaries even for
+non-periodic dimensions through the use of DMDA_{XYZ}GHOSTED.
+DMDABoundaryType is assigned through bitwise-or composition,
+i.e. DMDA_XPERIODIC | DMDA_YGHOSTED.  
+	<li>DMDASetGhostedCoordinates() is added.</li>
       </ul>
       <p><u><b>DMMG:</b></u></p>
       <ul>
diff -r 3923fa35e382 src/snes/examples/tutorials/ex30.c
--- a/src/snes/examples/tutorials/ex30.c	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/snes/examples/tutorials/ex30.c	Thu Mar 10 16:31:28 2011 -0700
@@ -90,7 +90,7 @@
 } Parameter;
 
 typedef struct { /* grid parameters */
-  DMDAPeriodicType periodic;
+  DMDABoundaryType periodic;
   DMDAStencilType  stencil;
   PetscInt       corner,ni,nj,jlid,jfault,inose;
   PetscInt       dof,stencil_width,mglevels;
diff -r 3923fa35e382 src/tops/server/c/TOPS_CStructuredSolver_Impl.h
--- a/src/tops/server/c/TOPS_CStructuredSolver_Impl.h	Thu Mar 10 15:03:35 2011 -0600
+++ b/src/tops/server/c/TOPS_CStructuredSolver_Impl.h	Thu Mar 10 16:31:28 2011 -0700
@@ -81,7 +81,7 @@
   DM                                    da;
   int                                   lengths[4],m,n,p,dim,s,levels,bs;
   DMDAStencilType                         stencil_type;
-  DMDAPeriodicType                        wrap;
+  DMDABoundaryType                        wrap;
   int                                   startedpetsc;
   gov_cca_Services			myServices;
   gov_cca_ports_ParameterPortFactory 	ppf;


More information about the petsc-dev mailing list