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