[petsc-dev] printing matlab vectors

Mark Adams mfadams at lbl.gov
Fri Jun 12 07:54:53 CDT 2015


I do this:

  call
VecCreateSeqWithArray(PETSC_COMM_SELF,ione,n64,phi,vec,ierr);CHKERRQ(ierr)
  call PetscViewerASCIIOpen(PETSC_COMM_SELF, file_name,
viewer,ierr);CHKERRQ(ierr)
  call
PetscViewerSetFormat(viewer,PETSC_VIEWER_ASCII_MATLAB,ierr);CHKERRQ(ierr)
  call PetscObjectSetName(viewer,vec_name,ierr);CHKERRQ(ierr)
  call VecView(vec,viewer,ierr);CHKERRQ(ierr)

But I still get this:

05:51 nid02816 new_em *= ~/epsi/XGC-1_examples/em_tearing$ head xgc_lhs.m
%Vec Object: 1 MPI processes
%  type: seq
Vec_0xc4000009_0 = [
-0.0000000000000000e+00
5.6929682630215887e-16

Am I missing something?  I want Vec_0xc4000009_0 to be 'vec_name'

Mark


On Thu, Jun 11, 2015 at 8:06 PM, Jed Brown <jed at jedbrown.org> wrote:

> Mark Adams <mfadams at lbl.gov> writes:
>
> > I am printing matlab vectors and I have a matlab script to read these
> > files, take differences, etc.  PETSc name the vectors
> > (eg, Vec_0xc4000009_0) in a non-deterministic way as far as I can
> > tell.
>
> PetscObjectSetName()
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20150612/473970f6/attachment.html>


More information about the petsc-dev mailing list