On 11 March 2011 20:35, Ethan Coon <ecoon at lanl.gov> wrote: > Ok, here's a patch that makes the below change, and changes the APIs of > DMDACreate*D(), DMDAGetInfo(), and DMDASetBoundaryType(). >
You missed a couple of fixes (pasted at the end). After applying your patch, the updated (also working with petsc-3.1) petsc4py testsuite pass fine. > Nearly every tutorial/test example is touched, and everyone's DA code is > broken. ?Up to you if you want it :) > > This should deal with Lisandro's c++ issue with int/enum bitwise or (or > we could change the enum to a typedef if that works or int otherwise, or > some other hack for c++?). > I vote for pushing your patch plus my trivial fixes... I think Barry is still OK. Satish, do you what me to push? I'll use hg commit --user "Ethan Coon <ecoon at lanl.gov>" $ hg diff src/dm/impls/da/utils/binaryMatlab.c src/dm/impls/da/ftn-custom/zdaviewf.c diff -r e7b8783e37a0 src/dm/impls/da/ftn-custom/zdaviewf.c --- a/src/dm/impls/da/ftn-custom/zdaviewf.c Fri Mar 11 15:21:12 2011 -0600 +++ b/src/dm/impls/da/ftn-custom/zdaviewf.c Fri Mar 11 21:57:20 2011 -0300 @@ -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, - DMDABoundaryType *wrap,DMDAStencilType *st,PetscErrorCode *ierr) + DMDABoundaryType *bx,DMDABoundaryType *by,DMDABoundaryType *bz,DMDAStencilType *st,PetscErrorCode *ierr) { CHKFORTRANNULLINTEGER(dim); CHKFORTRANNULLINTEGER(M); @@ -21,8 +21,10 @@ CHKFORTRANNULLINTEGER(p); CHKFORTRANNULLINTEGER(w); CHKFORTRANNULLINTEGER(s); - CHKFORTRANNULLINTEGER(wrap); + CHKFORTRANNULLINTEGER(bx); + CHKFORTRANNULLINTEGER(by); + CHKFORTRANNULLINTEGER(bz); CHKFORTRANNULLINTEGER(st); - *ierr = DMDAGetInfo(*da,dim,M,N,P,m,n,p,w,s,wrap,st); + *ierr = DMDAGetInfo(*da,dim,M,N,P,m,n,p,w,s,bx,by,bz,st); } EXTERN_C_END diff -r e7b8783e37a0 src/dm/impls/da/utils/binaryMatlab.c --- a/src/dm/impls/da/utils/binaryMatlab.c Fri Mar 11 15:21:12 2011 -0600 +++ b/src/dm/impls/da/utils/binaryMatlab.c Fri Mar 11 21:57:20 2011 -0300 @@ -175,7 +175,7 @@ PetscFunctionBegin; ierr = PetscObjectGetComm((PetscObject)viewer,&comm);CHKERRQ(ierr); ierr = PetscViewerBinaryGetInfoPointer(viewer,&info);CHKERRQ(ierr); - ierr = DMDAGetInfo(da,&dim,&ni,&nj,&nk,&pi,&pj,&pk,&dof,PETSC_NULL,PETSC_NULL,PETSC_NULL);CHKERRQ(ierr); + ierr = DMDAGetInfo(da,&dim,&ni,&nj,&nk,&pi,&pj,&pk,&dof,PETSC_NULL,PETSC_NULL,PETSC_NULL,PETSC_NULL,PETSC_NULL);CHKERRQ(ierr); ierr = VecView(vec,viewer);CHKERRQ(ierr); ierr = PetscFPrintf(comm,info,"%%--- begin code written by PetscViewerBinaryMatlabOutputVecDA ---%\n");CHKERRQ(ierr); ierr = PetscFPrintf(comm,info,"%%$$ tmp = PetscBinaryRead(fd); \n");CHKERRQ(ierr); -- Lisandro Dalcin --------------- CIMEC (INTEC/CONICET-UNL) Predio CONICET-Santa Fe Colectora RN 168 Km 472, Paraje El Pozo 3000 Santa Fe, Argentina Tel: +54-342-4511594 (ext 1011) Tel/Fax: +54-342-4511169