[petsc-users] Is matrix analysis available in PETSc or external package?

Danyang Su danyang.su at gmail.com
Tue May 12 13:31:15 CDT 2015


On 15-05-12 11:13 AM, Barry Smith wrote:
>> On May 11, 2015, at 7:10 PM, Danyang Su <danyang.su at gmail.com> wrote:
>>
>> Hi All,
>>
>> I recently have some time-dependent cases that have difficulty in convergence. It needs a lot of linear iterations during a specific time, e.g., more than 100 linear iterations for every newton iteration. In PETSc parallel version, this number will be doubled or even more. Our case usually needs less than 10 iterations for every newton iteration. This is NOT caused by PETSc relative routines as the original sequential solver (ILU) also has the same problem.
>>
>> The results seems reasonable, but the large number of iterations leads me to suspect that something is not well implemented in a particular module. This module is developed a long time ago by another guy and it sounds impossible for me to check every line (thousands of lines) and do theoretical analysis.Does PETSc or external package provide matrix analysis to help to locate the 'suspected' entry?
>     What do you mean by 'matrix analaysis'?   You can run with -ksp_view_mat binary to have all the matrices saved in a binary file called binaryoutput which you can read into MATLAB (with $PETSC_DIR/shared/petsc/matlab/PetscBinaryRead.m) or python (with bin/PetscBinaryIO.py). You can then look at the matrices, determine the largest entry whatever you wish.
>
>     But it is also very possible that the due to changes in the model you are evolving in time the linear system simple does get more ill-conditioned during part of the simulation. This is pretty common and need not indicate that there is anything wrong with the model or the code.
>
>    Barry
Hi Barry,

Here 'matrix analysis' means some extreme large entries in the matrix 
that causes the linear solver difficult to converge. Since I am not 
pretty sure if anything is wrong with the code or not, I just want to 
check the location of these entries and how it is calculated. This is a 
complex reactive transport problem so it is possible that nothing is 
wrong but the system is more ill conditioned in as specific simulation 
time.

I also have the matrix output to matrix market format that I can use to 
analysis.

Thanks,

Danyang
>
>> Thanks and regards,
>>
>> Danyang



More information about the petsc-users mailing list