[petsc-users] matrix memory preallocation

Matthew Knepley knepley at gmail.com
Sat Nov 22 20:05:07 CST 2014


On Sat, Nov 22, 2014 at 6:54 PM, Sun, Hui <hus003 at ucsd.edu> wrote:

>  Dear Petsc users,
>
>  I have a DM object by claiming
>
> DMDACreate3d(PETSC_COMM_WORLD,DMDA_BOUNDARY_NONE,DMDA_BOUNDARY_NONE,DMDA_BOUNDARY_NONE,DMDA_STENCIL_BOX,
> 32,32,32,PETSC_DECIDE,PETSC_DECIDE,PETSC_DECIDE,3,5,0,0,0,&da);
>
>  There is a problem with it, because it uses DMDA_STENCIL_BOX, and the
> stencil width is 5, quite big.
>
>  However, in fact, I don't need such big stencils everywhere, I only need
> it at a sparse number of locations. I'm wondering how to allocate memory
> only in those sparse number of locations?
>

DMDA is not flexible enough to support that. You could use a VecScatter to
support
that communication, but it would be complex to construct.

  Thanks,

     Matt


> Thank you very much!
>
>  Best,
> Hui
>



-- 
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/20141122/9a6d804c/attachment.html>


More information about the petsc-users mailing list