[petsc-users] How/where to update DASetStencilWidth() info
Matthew Knepley
knepley at gmail.com
Fri Jan 6 16:34:42 CST 2012
On Fri, Jan 6, 2012 at 4:32 PM, Xuefeng Li <li at loyno.edu> wrote:
> 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?
>
1) You cannot change this after setting up the DA. Just make another DA,
since
they are very lightweight.
2) I think structuring new code around DMMG is wrong. It has been removed in
petsc-dev and is deprecated in 3.2. What are you trying to do?
Thanks,
Matt
> 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)
>
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120106/19ccdc08/attachment.htm>
More information about the petsc-users
mailing list