Function ReadVec

Function Documentation

PetscErrorCode ReadVec(MPI_Comm COMM, PetscViewer viewer, char *varname, Vec *newvec, PetscInt *n)

Read data from a PetscViewer into a Vec (scalar) object. This version good for single-rank reads.

Parameters
  • COMM: The MPI communicator, PETSC_COMM_SELF or PETSC_COMM_WORLD.
  • viewer: A PetscViewer instance.
  • *varname: The new vector will have this name. For reading from hdf5 files, this name must match the dataset name in the file.
  • *newvec: The new vector object.
  • *n: The number of entries in the new object.