Vectors: Examples

PETSc vectors (Vec objects) are used to store the field variables in PDE-based (or other) simulations.

ex1.c: Basic vector routines
ex1e.c: Demonstrates various vector routines
ex2.c: Builds a parallel vector with 1 component on the firstprocessor, 2 on the second, etc
ex3.c: Parallel vector layout
ex5.c: Tests binary I/O of vectors and illustrates the use of user-defined event logging
ex6.c: Writes an array to a file, then reads an array from a file, then forms a vector
ex7.c: Demonstrates calling a Fortran computational routine from C
ex8.c: Demonstrates using a local ordering to set values into a parallel vector
ex9.c: Demonstrates use of VecCreateGhost()
ex10.c: Demonstrates the AMS Memory Snooper viewing
ex11.c: Demonstrates VecStrideNorm()
ex12.c: Demonstrates VecStrideScatter() and VecStrideGather()
ex13.c: Tests PetscObjectPublish()
ex16.c: Demonstrates VecStrideScatter() and VecStrideGather() with subvectors that are also strided