Evan,

   There is very little control. But if you are reading the vectors/matrices 
into MATLAB or Python you should use the binary format; it is much faster and 
always preserves all the precision.  Use PetscViewerBinaryOpen()  then in 
MATLAB use PetscBinaryRead.m to read them in (it is in bin/matlab in PETSc 3.4 
and earlier and in share/petsc/matlab in PETSc 3.5)  to read into Python you 
can use bin/pythonscripts/petscBinaryIO.py

  Barry

On Oct 15, 2014, at 6:52 PM, Evan Um <[email protected]> wrote:

> Dear users,
> 
> Is there any way to control the precision (i.e. decimal points) of matrices 
> and vectors when they are written into files? Otherwise, do I need to access 
> elements of a matrix by myself and then write them with my own format? In 
> advance, thanks for tour advice.
> 
> Regards,
> Evan
> 
> 
> PetscViewerASCIIOpen(PETSC_COMM_WORLD,"A.out",&viewer);
> PetscViewerSetFormat(viewer, PETSC_VIEWER_ASCII_MATLAB);
> MatView(A_dt,viewer);

Reply via email to