[petsc-users] Narrowing down "Matrix is missing diagonal entry" errors

Bill McGrory mcgrory at aerosoftinc.com
Fri Aug 16 13:07:08 CDT 2013


Thanks for the reply Matthew
Your suggestion to use MatGetValues helped me to figure out my problem.

The legacy part of my software decided I didn't have enough memory to 
solve the problem in one shot, so it split it into two pieces, 
unbeknownst to me. So my A matrix was being partially loaded (hence the 
unfilled diagonals)


On 08/16/2013 11:34 AM, Matthew Knepley wrote:
> On Fri, Aug 16, 2013 at 10:09 AM, Bill McGrory 
> <mcgrory at aerosoftinc.com <mailto:mcgrory at aerosoftinc.com>> wrote:
>
>     More information pertaining to the referenced post.
>
>     I am using default parameters for my KSP solver, so my routines
>     are pretty simple I don't pass any options in through the command
>     line, so this is all default stuff here.
>
>             I create, and fill A and b, and then call
>     MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY);
>
>                     MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY);
>
>             VecAssemblyBegin(b);
>             VecAssemblyEnd(b);
>
>             VecSet(x,0.);
>
>             // Solve A x = b
>
>             KSPCreate(PETSC_COMM_WORLD,&ksp);
>
>             KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);
>
>             KSPSetFromOptions(ksp);
>
>             KSPSolve(ksp,b,x);
>
>     The missing diagonals, I see are in the preconditioner, not the
>     original Matrix, so I thought I would check my original.
>
>
> From the code above, this makes no sense. You do not have a separate 
> preconditioner matrix.
>
>     When I make a call to MatMissingDiagonal, after assembling my
>     matrix, I get the error telling me that MatMissingDiagonal is not
>     supported for a mpibaij matrix.
>
>     Do I have any alternative for querying my assembled matrix?
>
>
> You can always use MatGetValues().
>
>    Matt
>
>     Thanks again
>     Bill
>
>
>
>
>
Very true statement in my case below. Ah, but to know what you are 
taking for granted.
> -- 
> 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/20130816/957bcde7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5396 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130816/957bcde7/attachment.bin>


More information about the petsc-users mailing list