[petsc-users] Setting Ghosted Boundary Values

Jed Brown jedbrown at mcs.anl.gov
Thu Jan 3 10:38:06 CST 2013


On Thu, Jan 3, 2013 at 10:17 AM, David Scott <d.scott at ed.ac.uk> wrote:

> I wish to set boundary values in a structured grid. How do I do this if I
> am using DMDA_BOUNDARY_GHOSTED? I thought that I should set the boundary
> values in the function specified by a call to DMSetInitialGuess but it
> appears to be passed a global vector.
>

The local vector has that extra space. Scatter to the local vector as
usual, then fill them up.

Alternatively, use a *SetFunctionLocal() so that you start out with a local
vector.

http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/DMDASNESSetFunctionLocal.html


>
> I would prefer any example code to be in Fortran but that is not essential.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130103/0a8e9919/attachment.html>


More information about the petsc-users mailing list