Actual source code: vmpicr.c

petsc-3.5.2 2014-09-08
Report Typos and Errors
  2: /*
  3:    This file contains routines for Parallel vector operations.
  4:  */

  6: #include <../src/vec/vec/impls/mpi/pvecimpl.h>   /*I  "petscvec.h"   I*/

 10: /*@
 11:    VecCreateMPI - Creates a parallel vector.

 13:    Collective on MPI_Comm

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

 20:    Output Parameter:
 21: .  vv - the vector

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

 27:    Level: intermediate

 29:    Concepts: vectors^creating parallel

 31: .seealso: VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(),
 32:           VecCreateMPIWithArray(), VecCreateGhostWithArray(), VecMPISetGhost()

 34: @*/
 35: PetscErrorCode  VecCreateMPI(MPI_Comm comm,PetscInt n,PetscInt N,Vec *v)
 36: {

 40:   VecCreate(comm,v);
 41:   VecSetSizes(*v,n,N);
 42:   VecSetType(*v,VECMPI);
 43:   return(0);
 44: }