[petsc-users] Writing PETSc matrices

Nunion m.skates82 at gmail.com
Mon Dec 13 11:10:25 CST 2010


What files should one use to convert vectors from Matlab to PETSc
(PetscBinaryWrite is for square matrices)?  I have attempted to write
directly to binary from Matlab a matrix + vector, and only a vector (using
save command with the -mat option), then read the binary file into PETSc
(using ex34.c in ...src/mat/tests), however the format is not recognized.

Thanks,

Tom

On Tue, Oct 26, 2010 at 3:57 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
>   Use PetscBinaryWrite('filename',sparsematlabmatrix)  I do not know why
> your second argument has quotes around it.
>
>   Barry
>
>
> On Oct 26, 2010, at 3:33 PM, Nunion wrote:
>
> > Hello,
> >
> > I am new to PETSc and programming.  I have a question concerning writing
> PETSc matrices in binary from binary matrices [compressessed/uncompressed]
> generated in Matlab.  I am attempting to use the files in the /bin/matlab
> directory, in particular the PetscBinaryWrite.m file.  However, the usage;
> >
> > PetscBinaryWrite('matrix.mat','output.ex') does not seem to work.  I also
> tried using the examples in the /mat directory however, matlab does not
> support the writing of complex matrices in ASCII.
> >
> > Thanks in advance,
> >
> > Tom
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101213/c604c70d/attachment-0001.htm>


More information about the petsc-users mailing list