Thank you Barry and Patrick. 

________________________________________
From: Barry Smith [[email protected]]
Sent: Sunday, July 27, 2014 10:51 AM
To: Patrick Sanan
Cc: Sun, Hui; [email protected]
Subject: Re: [petsc-users] MATLAB viewer

On Jul 27, 2014, at 6:19 AM, Patrick Sanan <[email protected]> wrote:

> 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 <[email protected]> wrote:
>
>> I try to create some binary output for MATLAB with the following code.
>>
>> PetscViewer viewer = PETSC_VIEWER_BINARY(PETSC_COMM_WORLD);

   or you are missing the _ at the end of PETSC_VIEWER_BINARY_


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

Reply via email to