"Diagonal" Columns of MPIAIJ Matrix?

Matthew Knepley knepley at gmail.com
Wed Jul 2 06:35:06 CDT 2008


By definition, the diagonal portion is square. Thus you retrieve the
local rows [start, end), and then the diagonal block is

  [start, end) x [start, end)

which you can do with

http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatGetOwnershipRange.html

   Matt

On Wed, Jul 2, 2008 at 2:52 AM, Andrew Colombi <acolombi at gmail.com> wrote:
> I'm letting PETSC_DECIDE how to distribute the rows and columns of my
> non-square matrix, and I want to retrieve the columns it's decided to
> make the "Diagonal" for a particular process.  How can I do that?  I'm
> probably missing something obvious here, but I checked the docs.
>
> In case some context helps (or inspires a work-around):
>
> I want this information to count the number of d_nnz and o_nnz to
> preallocate perfectly.  This shouldn't be hard to do, but I need to
> know the boundary between off-diagonal and diagonal to do it.
>
> Thanks,
> -Andrew
>
>



-- 
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




More information about the petsc-users mailing list