The MatMatSolve mystery

Nicolas Tardieu niko.karin at gmail.com
Wed Sep 10 16:18:41 CDT 2008


Thanks a lot!
I have changed the code but I still have strange behaviour.
I scaled the identity matrix and enlarged the BB matrix :

==================================================================================
 A before MatMatSolve
row 0: (0, 1e-06)
row 1: (1, 1e-06)
 BB before MatMatSolve
0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+03
0.0000000000000000e+00
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
1.0000000000000000e+03
 XX before MatMatSolve
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0.0000000000000000e+00
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0.0000000000000000e+00
 XX after MatMatSolve
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0.0000000000000000e+00
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0.0000000000000000e+00
==================================================================================

Nicolas


2008/9/10 Barry Smith <bsmith at mcs.anl.gov>

>
>  For the MatMatSolve_SeqAIJ() to work both B and X must be dense matrices,
> since you passed in a sparse SeqAIJ matrix (the default) for B you get
> garbage out.
> I will add an error check telling you the B matrix is not dense so no one
> will fall for this
> again.
>
>   Barry
>
>
>
> On Sep 10, 2008, at 3:39 PM, Nicolas Tardieu wrote:
>
>  Dear PETSc users,
>>
>> The attached file is a naive test of MatMatSolve : I create a matrix,say
>> A, I duplicate it, say BB, and I would like to compute A^{-1}*BB.
>> Since A is the identity matrix, I would like to get the identity matrix.
>> But I don't!
>> Here is what I obtain by doing "./niko1f -n 3" :
>>
>>
>> ===========================================================================
>>  A before MatMatSolve
>> row 0: (0, 1)
>> row 1: (1, 1)
>> row 2: (2, 1)
>>  BB before MatMatSolve
>> row 0: (0, 1)
>> row 1: (1, 1)
>> row 2: (2, 1)
>>  XX before MatMatSolve
>> 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
>> 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
>> 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
>>  XX after MatMatSolve
>> 1.0000000000000000e+00 1.9966503766457982e-314 7.9050503334599447e-323
>> 1.0000000000000000e+00 0.0000000000000000e+00 6.4996731077266291e-311
>> 1.0000000000000000e+00 2.6136072665001942e-321 9.6616869034104132e-317
>>
>> ===========================================================================
>>
>>
>> Can you tell me what I am doing wrong?
>>
>> Thanks,
>>
>> Nicolas
>>
>> <niko1f.F>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20080910/4100fde5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: niko1f.F
Type: text/x-fortran
Size: 4090 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20080910/4100fde5/attachment.bin>


More information about the petsc-users mailing list