[petsc-users] How to view petsc array?

TAY wee-beng zonexo at gmail.com
Tue Jul 21 01:35:35 CDT 2015


Hi,

I need to check the contents of the array which was declared using:

PetscScalar,pointer :: 
u_array(:,:,:),v_array(:,:,:),w_array(:,:,:),p_array(:,:,:)

I tried to use :

call PetscViewerASCIIOpen(MPI_COMM_WORLD,"pres.txt",viewer,ierr)

call VecView(p_array,viewer,ierr)

or

call MatView(p_array,viewer,ierr)

call PetscViewerDestroy(viewer,ierr)

but I got segmentation error. So is there a PETSc routine I can use?

-- 
Thank you

Yours sincerely,

TAY wee-beng



More information about the petsc-users mailing list