[petsc-users] How/where to update DASetStencilWidth() info

Jed Brown jedbrown at mcs.anl.gov
Fri Jan 6 16:22:27 CST 2012


On Fri, Jan 6, 2012 at 16:18, Xuefeng Li <li at loyno.edu> wrote:

> The stencil width of my DA to a DMMG object is
> created to be 1. It is later adjusted using
> DASetStencilWidth() to 2.
>

You are not supposed to do this.

Either call DMDACreate2d() (or whichever dimension you want) or call the
sequence

  ierr = DMDACreate(comm, da);CHKERRQ(ierr);
  ierr = DMDASetDim(*da, 2);CHKERRQ(ierr);
  ierr = DMDASetSizes(*da, M, N, 1);CHKERRQ(ierr);
  ierr = DMDASetNumProcs(*da, m, n, PETSC_DECIDE);CHKERRQ(ierr);
  ierr = DMDASetBoundaryType(*da, bx, by, DMDA_BOUNDARY_NONE);CHKERRQ(ierr);
  ierr = DMDASetDof(*da, dof);CHKERRQ(ierr);
  ierr = DMDASetStencilType(*da, stencil_type);CHKERRQ(ierr);
  ierr = DMDASetStencilWidth(*da, s);CHKERRQ(ierr);
  ierr = DMDASetOwnershipRanges(*da, lx, ly, PETSC_NULL);CHKERRQ(ierr);
  ierr = DMSetFromOptions(*da);CHKERRQ(ierr);
  ierr = DMSetUp(*da);CHKERRQ(ierr);


I am updating all these functions now to give an error if you call them
after DMSetUp().


> DAGetInfo() confirmed
> that the stencil width is indeed 2. However,
> DAGetGhostCorners()/**DAGetCorners() show that
> the ghost point width is 1, instead of 2.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120106/09d9bb91/attachment.htm>


More information about the petsc-users mailing list