[petsc-dev] DMDABoundaryType

Ethan Coon ecoon at lanl.gov
Mon Mar 14 09:34:06 CDT 2011


Related to this, do you guys have a standard way of finding all such
instances?  I was using grep/find (and then checking the compilation
output), but I'm sure my find was missing a few files.  

Ethan

On Fri, 2011-03-11 at 19:14 -0600, Satish Balay wrote:
> I just pushed this patch along with the fix you mentioned.. [and
> couple of other fixes]
> 
> Satish
> 
> On Fri, 11 Mar 2011, Lisandro Dalcin wrote:
> 
> > 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);
> > 
> > 
> > 

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

http://www.ldeo.columbia.edu/~ecoon/
------------------------------------




More information about the petsc-dev mailing list