[petsc-users] MATLAB viewer

Patrick Sanan patrick.sanan at gmail.com
Sun Jul 27 06:19:16 CDT 2014


A simple way to proceed is to use http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/PetscViewerBinaryOpen.html

On Jul 27, 2014, at 10:18 AM, Sun, Hui <hus003 at ucsd.edu> wrote:

> 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!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140727/3c2a666a/attachment.html>


More information about the petsc-users mailing list