[petsc-users] How to symmetrical the pattern of anunsymmetrical matrix

Gong Ding gdiso at ustc.edu
Sat Jan 29 07:27:03 CST 2011


OK, I had gather all the pattern of A+A^T by my code.
Can I call  MatSeqAIJSetPreallocation again for enlarge preallocated memory?
And then I can add 0 to some entry to make the matrix symmetrical. 



> 2011/1/26 Gong Ding <gdiso at ustc.edu>
> 
>> I have unsymmetrical jacobian matrix in MPIAIJ format (it is nearlly
>> symmetric, I guess). I'd like to pad it to symmetrical pattern by just add 0
>> to corresponding matrix entry, which is required to some matrix partition
>> step.
> 
> 
> How are you obtaining the matrix?  The best way is to preallocate those
> extra zeros.
> 
> A traditional purely algebraic way is to add the transpose (zeroed in this
> case), but transpose is a bad operation to perform in parallel so I would
> try to avoid it.
>


More information about the petsc-users mailing list