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: #undef __FUNCT__
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: int VecCreateSeq(MPI_Comm comm,int n,Vec *v)
34: {
35: int ierr,size;
38: MPI_Comm_size(comm,&size);
39: if (size > 1) SETERRQ(1,"Comm_size > 1; sequential vector can be created on 1 processor only");
40: VecCreate(comm,v);
41: VecSetSizes(*v,n,n);
42: VecSetType(*v,VECSEQ);
43: return(0);
44: }