Actual source code: vmpicr.c

  1: /*$Id: vmpicr.c,v 1.14 2001/03/23 23:21:26 balay Exp $*/

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

 7:  #include src/vec/impls/mpi/pvecimpl.h

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

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

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

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

 26:    Level: intermediate

 28:    Concepts: vectors^creating parallel

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

 33: @*/
 34: int VecCreateMPI(MPI_Comm comm,int n,int N,Vec *v)
 35: {

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