[petsc-users] DAGetMatrix()

Matthew Knepley knepley at gmail.com
Sun Feb 21 20:26:15 CST 2010

I would turn on the ERR_ON_ALLOCATION option and then do your
MatSetValues(). That way the exact location of the allocation is clear.
MAybe this will expose the bug.


On Sun, Feb 21, 2010 at 1:25 PM, Dave May <dave.mayhem23 at gmail.com> wrote:

> Hello,
>  I have a question about the usage of DAGetMatrix().
> Is there any possibility that the matrix preallocation and the indices
> returned from DAGetGlobalIndices() are incompatible with each other?
> To clarify my question, I use DAGetMatrix() with a DA created with the
> lx,ly,lz (local nodes sizes) specified. The resulting DA is used to
> represent a Q1 finite element mesh. I then use values return from
> DAGetGlobalIndices() to define the equation number for each dof
> associated with each element.   In the past I've used this approach in
> parallel without any problems matrix preallocation issues, but I've
> never specified lx,ly,lz before.
> What I see now is that for certain grid resolutions and element
> combinations, -info reports that additional non-zeros are having to be
> allocated.
> Is my function to compute the element node relationship screwed, or is
> there an assumption about when and where DAGetMatrix() is valid. I
> suspect the former, but looking through the numbers I cannot see any
> problems.
> Cheers,
>   Dave

What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100221/a29be7ec/attachment.htm>

More information about the petsc-users mailing list