Actual source code: ex1.c
petsc-3.4.2 2013-07-02

      2: static char help[] = "Tests the creation of a PC context.\n\n";

      4: #include <petscpc.h>

      8: int main(int argc,char **args)
      9: {
     10:   PC             pc;
     12:   PetscInt       n = 5;
     13:   Mat            mat;

     15:   PetscInitialize(&argc,&args,(char*)0,help);
     16:   PCCreate(PETSC_COMM_WORLD,&pc);
     17:   PCSetType(pc,PCNONE);

     19:   /* Vector and matrix must be set before calling PCSetUp */
     20:   MatCreateSeqAIJ(PETSC_COMM_SELF,n,n,3,NULL,&mat);
     21:   PCSetOperators(pc,mat,mat,DIFFERENT_NONZERO_PATTERN);
     22:   PCSetUp(pc);
     23:   MatDestroy(&mat);
     24:   PCDestroy(&pc);
     25:   PetscFinalize();
     26:   return 0;
     27: }