output to matlab

Matthew Knepley knepley at gmail.com
Tue Feb 17 08:26:16 CST 2009


Always always always check the return codes for each call (you can
use the CHKERRQ macro). Otherwise, you have no idea whether an
error occurred during the call.

  Matt

On Mon, Feb 16, 2009 at 7:05 PM, Yixun Liu <enjoywm at cs.wm.edu> wrote:

> Hi,
> I want to output matrix and vector into matlab.
> // output a vector,
>      PetscViewer bviewer;
>      PetscViewerCreate(PETSC_COMM_WORLD, &bviewer);
>      PetscViewerSetType(bviewer, PETSC_VIEWER_ASCII);
>      PetscViewerSetFormat(bviewer, PETSC_VIEWER_ASCII_MATLAB);
>      PetscViewerFileSetName(bviewer, bname);
>      VecView(externalForcesVector, bviewer);//externalForcesVector is a
> parallel vector.
>
> However, the output file contains nothing.
>
> Thanks.
>
> Yixun
>
>
>


-- 
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090217/43864ba4/attachment-0001.htm>


More information about the petsc-users mailing list