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

Xuefeng Li li at loyno.edu
Fri Jan 6 16:32:12 CST 2012


On Fri, 6 Jan 2012, Jed Brown wrote:

> 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
>
Understand.

However, is there a way to change/adjust the stencil width
AFTER the DA has been created and set up to a DMMG? Or,
in general, can we attach different DA objects to a DMMG
at different times?



>  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.
>>
>

Regards,

--Xuefeng Li, (504)865-3340(phone)
   Like floating clouds, the heart rests easy
   Like flowing water, the spirit stays free
        http://www.loyno.edu/~li/home
   New Orleans, Louisiana (504)865-2051(fax)



More information about the petsc-users mailing list