#include "petscvec.h" PetscErrorCode VecLoad(Vec newvec, PetscViewer viewer)Collective on PetscViewer
newvec | - the newly loaded vector, this needs to have been created with VecCreate() or some related function before a call to VecLoad(). | |
viewer | - binary file viewer, obtained from PetscViewerBinaryOpen() or HDF5 file viewer, obtained from PetscViewerHDF5Open() |
The input file must contain the full global vector, as written by the routine VecView().
If the type or size of newvec is not set before a call to VecLoad, PETSc sets the type and the local and global sizes.If type and/or sizes are already set, then the same are used.
IF using HDF5, you must assign the Vec the same name as was used in the Vec that was stored in the file using PetscObjectSetName(). Otherwise you will get the error message: "Cannot H5DOpen2() with Vec name NAMEOFOBJECT"
int VEC_FILE_CLASSID int number of rows PetscScalar *values of all entries
In addition, PETSc automatically does the byte swapping for machines that store the bytes reversed, e.g. DEC alpha, freebsd, linux, Windows and the paragon; thus if you write your own binary read/write routines you have to swap the bytes; see PetscBinaryRead() and PetscBinaryWrite() to see how this may be done.
Level:intermediate
Location:src/vec/vec/interface/vector.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages