[petsc-users] Save matrix to binary file on sub directory

Matthew Knepley knepley at gmail.com
Thu Oct 2 14:44:06 CDT 2014


On Thu, Oct 2, 2014 at 12:17 PM, Robert Rezk <robertrezk at yahoo.ca> wrote:

> This is the code I used
>   PetscViewer viewer;
>   PetscErrorCode ierr;
>
>   PetscViewerBinaryOpen(comm_,File_Name.c_str(),FILE_MODE_WRITE,&viewer);
>
>

Can you check all return codes with CHKERRQ(ierr)?

  Thanks,

     Matt


    ierr = MatView(*petsc_matrix, viewer);
>
>   PetscViewerDestroy(&viewer);
>
> and I can't see any output or crash
>
> Best Regards
> Robert Andrawis
>
>
>
>   ------------------------------
>  *From:* Jed Brown <jed at jedbrown.org>
> *To:* Robert Rezk <robertrezk at yahoo.ca>; "petsc-users at mcs.anl.gov" <
> petsc-users at mcs.anl.gov>
> *Sent:* Thursday, October 2, 2014 1:04 PM
> *Subject:* Re: [petsc-users] Save matrix to binary file on sub directory
>
> Robert Rezk <robertrezk at yahoo.ca> writes:
>
>
> > I am using the pets viewer and I want to save binary file to sub
> directory.
> >
> > I tried to save file to the current directory and it work fine.
> >
> > when I try to use file name like this "./xyz_dir/file_name" it doesn't
> work.
>
>
> What symptoms do you see?  Can you reproduce with an example?
>
>
>
>


-- 
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/20141002/81e36c10/attachment.html>


More information about the petsc-users mailing list