Actual source code: vmpicr.c

petsc-master 2019-10-19
Report Typos and Errors

  2: /*
  3:    This file contains routines for Parallel vector operations.
  4:  */

  6:  #include <petscvec.h>

  8: /*@
  9:    VecCreateMPI - Creates a parallel vector.

 11:    Collective

 13:    Input Parameters:
 14: +  comm - the MPI communicator to use
 15: .  n - local vector length (or PETSC_DECIDE to have calculated if N is given)
 16: -  N - global vector length (or PETSC_DETERMINE to have calculated if n is given)

 18:    Output Parameter:
 19: .  vv - the vector

 21:    Notes:
 22:    Use VecDuplicate() or VecDuplicateVecs() to form additional vectors of the
 23:    same type as an existing vector.

 25:    Level: intermediate

 27: .seealso: VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(),
 28:           VecCreateMPIWithArray(), VecCreateGhostWithArray(), VecMPISetGhost()

 30: @*/
 31: PetscErrorCode  VecCreateMPI(MPI_Comm comm,PetscInt n,PetscInt N,Vec *v)
 32: {

 36:   VecCreate(comm,v);
 37:   VecSetSizes(*v,n,N);
 38:   VecSetType(*v,VECMPI);
 39:   return(0);
 40: }