static char help[] = "Illustrate how to do one symbolic factorization and multiple numeric factorizations using same matrix structure. \n\n"; #include int main(int argc,char **args) { PetscInt i,rstart,rend,N=10,num_numfac=5,col[3],k; Mat A[5],F; Vec u,x,b; PetscMPIInt rank; PetscScalar value[3]; PetscReal norm,tol=100*PETSC_MACHINE_EPSILON; IS perm,iperm; MatFactorInfo info; MatFactorType facttype = MAT_FACTOR_LU; char solvertype[64]; char factortype[64]; PetscCall(PetscInitialize(&argc,&args,(char*)0,help)); PetscCallMPI(MPI_Comm_rank(PETSC_COMM_WORLD, &rank)); /* Create and assemble matrices, all have same data structure */ for (k=0; k tol) { PetscCall(PetscPrintf(PETSC_COMM_WORLD,"%" PetscInt_FMT "-the %s numfact and solve: residual %g\n",k,factortype,(double)norm)); } } /* Free data structures */ for (k=0; k