VecLoad

Loads a vector that has been stored in binary format with VecView().

Synopsis

int VecLoad(Viewer viewer,Vec *newvec)
Collective on Viewer

Input Parameters

viewer -binary file viewer, obtained from ViewerFileOpenBinary()

Output Parameter

newvec -the newly loaded vector

Notes

The input file must contain the full global vector, aswritten by the routine VecView().

Notes for advanced users

Most users should not need to know the details of the binary storageformat, since VecLoad() and VecView() completely hide these details. But for anyone who's interested, the standard binary matrix storageformat is
     int    VEC_COOKIE
     int    number of rows
     Scalar *values of all nonzeros

Note for Cray users, the int's stored in the binary file are 32 bitintegers; not 64 as they are represented in the memory, so if youwrite your own routines to read/write these binary files from the Crayyou need to adjust the integer sizes that you read in, seePetscReadBinary() and PetscWriteBinary() to see how this may bedone.

In addition, PETSc automatically does the byte swapping formachines that store the bytes reversed, e.g. DEC alpha, freebsd, linux, nt and the paragon; thus if you write your own binaryread/write routines you have to swap the bytes; see PetscReadBinary() and PetscWriteBinary() to see how this may be done.

Keywords

vector, load, binary, input

See Also

ViewerFileOpenBinary(), VecView(), MatLoad()

Examples

src/mat/examples/tutorials/ex1.c
src/sles/examples/tutorials/ex10.c

Location: src/vec/utils/vecio.c
Vector Index
Table of Contents