Initialization of PETSc
21: /* Include "petscsles.h" so that we can use SLES solvers. Note that this file
petsc.h - base PETSc routines petscvec.h - vectors
petscsys.h - system routines petscmat.h - matrices
petscis.h - index sets petscksp.h - Krylov subspace methods
petscviewer.h - viewers petscpc.h - preconditioners */
33: int main(int argc,char **args)
35: Vec x, b, u; /* approx solution, RHS, exact solution */
36: Mat A; /* linear system matrix */
37: SLES sles; /* linear solver context */
38: PetscRandom rctx; /* random number generator context */
39: PetscReal norm; /* norm of solution error */
40: int i,j, I,J, Istart, Iend, ierr, m = 4, n = 4, its;
42: PetscScalar v, h, one = 1.0, neg_one = –1.0;
43: KSP ksp; KSPType ksptype; PC pc; PCType pctype;
45: PetscInitialize(&argc, &args, (char *)0, help);
46: PetscOptionsGetInt(PETSC_NULL,"–m",&m,PETSC_NULL);
47: PetscOptionsGetInt(PETSC_NULL,"–n", &n, PETSC_NULL);