Actual source code: vseqcr.c
1: /*$Id: vseqcr.c,v 1.18 2001/03/23 23:21:25 balay Exp $*/
2: /*
3: Implements the sequential vectors.
4: */
6: #include src/vec/vecimpl.h
7: #include src/vec/impls/dvecimpl.h
9: /*@C
10: VecCreateSeq - Creates a standard, sequential array-style vector.
12: Collective on MPI_Comm
14: Input Parameter:
15: + comm - the communicator, should be PETSC_COMM_SELF
16: - n - the vector length
18: Output Parameter:
19: . V - 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: Concepts: vectors^creating sequential
29: .seealso: VecCreateMPI(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost()
30: @*/
31: int VecCreateSeq(MPI_Comm comm,int n,Vec *v)
32: {
33: int ierr,size;
36: MPI_Comm_size(comm,&size);
37: if (size > 1) SETERRQ(1,"Comm_size > 1; sequential vector can be created on 1 processor only");
38: VecCreate(comm,v);
39: VecSetSizes(*v,n,n);
40: VecSetType(*v,VECSEQ);
41: return(0);
42: }