[petsc-users] MATLAB viewer

Sun, Hui hus003 at ucsd.edu
Sun Jul 27 03:18:29 CDT 2014


I try to create some binary output for MATLAB with the following code. 

PetscViewer viewer = PETSC_VIEWER_BINARY(PETSC_COMM_WORLD);
MatView(A,viewer);
VecView(v,viewer);
PetscViewerDestroy(&viewer);

However it gives me an error, which is the following:

interface_fs.c:215:26: warning: implicit declaration of function 'PETSC_VIEWER_MATLAB' is invalid in C99 [-Wimplicit-function-declaration]
    PetscViewer viewer = PETSC_VIEWER_MATLAB(PETSC_COMM_WORLD);
                         ^
interface_fs.c:215:17: warning: incompatible integer to pointer conversion initializing 'PetscViewer' (aka 'struct _p_PetscViewer *') with an expression of type 'int'
      [-Wint-conversion]
    PetscViewer viewer = PETSC_VIEWER_MATLAB(PETSC_COMM_WORLD);


I'm wondering what is the correct way to do this? Thank you! 


More information about the petsc-users mailing list