#include "petscvec.h" PetscErrorCode VecCreateGhostWithArray(MPI_Comm comm,PetscInt n,PetscInt N,PetscInt nghost,const PetscInt ghosts[],const PetscScalar array[],Vec *vv)Collective on MPI_Comm
comm | - the MPI communicator to use | |
n | - local vector length | |
N | - global vector length (or PETSC_DECIDE to have calculated if n is given) | |
nghost | - number of local ghost points | |
ghosts | - global indices of ghost points (or NULL if not needed), these do not need to be in increasing order (sorted) | |
array | - the space to store the vector values (as long as n + nghost) |
This also automatically sets the ISLocalToGlobalMapping() for this vector.