petsc-3.7.1 2016-05-15
Report Typos and Errors

# VecCreateMPIWithArray

Creates a parallel, array-style vector, where the user provides the array space to store the vector values.

### Synopsis

    #include "petscvec.h"
    PetscErrorCode  VecCreateMPIWithArray(MPI_Comm comm,PetscInt bs,PetscInt n,PetscInt N,const PetscScalar array[],Vec *vv)

Collective on MPI_Comm Many br

### Input Parameters

| comm | - the MPI communicator to use Many br
| bs | - block size, same meaning as VecSetBlockSize() Many br
| n | - local vector length, cannot be PETSC_DECIDE Many br
| N | - global vector length (or PETSC_DECIDE to have calculated) Many br
| array | - the user provided array to store the vector values Many br

### Output Parameter

vv -the vector Many br

### Notes

Use VecDuplicate() or VecDuplicateVecs() to form additional vectors of the Many brsame type as an existing vector. Many br

If the user-provided array is NULL, then VecPlaceArray() can be used Many brat a later stage to SET the array for storing the vector values. Many br

PETSc does NOT free the array when the vector is destroyed via VecDestroy(). Many brThe user should not free the array until the vector is destroyed. Many br

Many br

### See Also

VecCreateSeqWithArray(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(),
VecCreateMPI(), VecCreateGhostWithArray(), VecPlaceArray() Many br

Level:intermediate
Location:src/vec/vec/impls/mpi/pbvec.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages