Actual source code: vseqcr.c

      1: #define PETSCVEC_DLL
      2: /*
      3:    Implements the sequential vectors.
      4: */

     6:  #include vecimpl.h
     7:  #include src/vec/impls/dvecimpl.h

     11: /*@C
     12:    VecCreateSeq - Creates a standard, sequential array-style vector.

     14:    Collective on MPI_Comm

     16:    Input Parameter:
     17: +  comm - the communicator, should be PETSC_COMM_SELF
     18: -  n - the vector length

     20:    Output Parameter:
     21: .  V - 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 sequential

     31: .seealso: VecCreateMPI(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost()
     32: @*/
     33: PetscErrorCode PETSCVEC_DLLEXPORT VecCreateSeq(MPI_Comm comm,PetscInt n,Vec *v)
     34: {

     38:   VecCreate(comm,v);
     39:   VecSetSizes(*v,n,n);
     40:   VecSetType(*v,VECSEQ);
     41:   return(0);
     42: }