[petsc-users] global index distributed arrays

Mohamad M. Nasr-Azadani mmnasr at gmail.com
Fri Dec 10 20:03:36 CST 2010


What kind of boundary condition is this?
It is both Dirichlet and Neumann B.C. It uses trilinear interpolation to
impose the correct boundary condition on the node based on the exact
location of the interface.

In any case, you can create an independent DA of the same size as your
original, but with a box stencil of width 3.  Then
DAGetISLocalToGlobalMapping (generalized to DMGetLocalToGlobalMapping in
petsc-dev) will give you access to those global indices.  You will likely
have to adjust preallocation for these extra entries (unless, somehow
strangely, interpolation actually uses no more points, just from different
places).

That sounds like a good suggestion. I may do this as it seems to be the
reasonable and easy way to go.
But regarding the memory allocation,
for all the regular nodes, for each row, that would be only 7 nonzeroes
(STAR stencil). But for the special nodes (close to the boundaries), they
need 9 nonzeros per row and that would not necessary follow the STAR
stencil.
For example, for the node at (i,j,k) it might (depending on the normal
direction of the solid surface) add the nonzeros at
(i,j,k)
(i+1,j+1,k)
(i+1,j+2,k)
(i+2,j+1,k)
(i+2,j+2,k)
(i+1,j+1,k+1)
(i+1,j+2,k+1)
(i+2,j+1,k+1)
(i+2,j+2,k+1)

Do you think that would add a lot of extra memory allocation?
Thanks and have a good weekend,
Mohamad


On Fri, Dec 10, 2010 at 5:22 PM, Jed Brown <jed at 59a2.org> wrote:

> On Sat, Dec 11, 2010 at 02:14, Mohamad M. Nasr-Azadani <mmnasr at gmail.com>wrote:
>
>> Those nodes, do not follow Poisson equation anymore and they just obey
>> some interpolation equations which might need nodes in the BOX stencil of
>> width=3.
>
>
> What kind of boundary condition is this?
>
> In any case, you can create an independent DA of the same size as your
> original, but with a box stencil of width 3.  Then
> DAGetISLocalToGlobalMapping (generalized to DMGetLocalToGlobalMapping in
> petsc-dev) will give you access to those global indices.  You will likely
> have to adjust preallocation for these extra entries (unless, somehow
> strangely, interpolation actually uses no more points, just from different
> places).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101210/3f5bcbc8/attachment.htm>


More information about the petsc-users mailing list