static char help[] = "Demonstrates the use of fast Richardson for SOR. And tests\n\ the MatSOR() routines.\n\n"; #include int main(int argc,char **args) { Mat mat; Vec b,u; PC pc; PetscInt n = 5,i,col[3]; PetscScalar value[3]; PetscCall(PetscInitialize(&argc,&args,(char*)0,help)); /* Create vectors */ PetscCall(VecCreateSeq(PETSC_COMM_SELF,n,&b)); PetscCall(VecCreateSeq(PETSC_COMM_SELF,n,&u)); /* Create and assemble matrix */ PetscCall(MatCreateSeqDense(PETSC_COMM_SELF,n,n,NULL,&mat)); value[0] = -1.0; value[1] = 2.0; value[2] = -1.0; for (i=1; i