Comparing matrices between 2 different codes and viewing of matrix

Ben Tay zonexo at gmail.com
Sun May 25 05:43:19 CDT 2008


Hi,

I have an old serial code and a newer parallel code. The new parallel 
code is converted from the old serial code. However, due to numerous 
changes, the answers from the new code now differs from the old one 
after the 1st step. What is the best way to compare the matrices from 
the 2 different code?

I guess the most direct mtd is to use MatView to store the matrix in a 
ACSII file and spot the difference between the 2 files. However, I can't 
seem to get it right. What I did is:

PetscViewer viewer

call  PetscViewerCreate(PETSC_COMM_SELF,viewer,ierr)

call MatView(A_mat_uv,viewer,ierr)

call PetscViewerDestroy(viewer,ierr)

call PetscViewerASCIIOpen(PETSC_COMM_SELF, "matrix.txt",viewer,ierr)

However, I get the error that "PetscViewer viewer" has syntax error. 
Hope you can help me out.

Thank you very much.

Regards




More information about the petsc-users mailing list