1
2 /*
3 Implements the sequential vectors.
4 */
5
6 #include <../src/vec/vec/impls/dvecimpl.h> /*I "petscvec.h" I*/
7
8 /*@
9 VecCreateSeq - Creates a standard, sequential array-style vector.
10
11 Collective
12
13 Input Parameter:
14 + comm - the communicator, should be PETSC_COMM_SELF
15 - n - the vector length
16
17 Output Parameter:
18 . V - the vector
19
20 Notes:
21 Use VecDuplicate() or VecDuplicateVecs() to form additional vectors of the
22 same type as an existing vector.
23
24 Level: intermediate
25
26 .seealso: VecCreateMPI(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost()
27 @*/
VecCreateSeq(MPI_Comm comm,PetscInt n,Vec * v)28 PetscErrorCode VecCreateSeq(MPI_Comm comm,PetscInt n,Vec *v)
29 {
30 PetscErrorCode ierr;
31
32 PetscFunctionBegin;
33 ierr = VecCreate(comm,v);CHKERRQ(ierr);
34 ierr = VecSetSizes(*v,n,n);CHKERRQ(ierr);
35 ierr = VecSetType(*v,VECSEQ);CHKERRQ(ierr);
36 PetscFunctionReturn(0);
37 }
38