With the now-recommended approach of SNESSetDM(), a matrix is no longer available for PCGetDefaultType_Private(), so stuff like this fails:<div><br></div><div><div><font face="'courier new', monospace">~/petsc/src/snes/examples/tutorials$ ./ex5 -dm_mat_type sbaij</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: --------------------- Error Message ------------------------------------</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: No support for this operation for this object type!</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: Factor type not supported!</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: Petsc Development HG revision: fb0b659c7d3475598a50a3736d056cce163b2de9  HG Date: Sun Apr 15 00:02:43 2012 +0000</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: See docs/changes/index.html for recent updates.</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: See docs/index.html for manual pages.</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: ./ex5 on a mpich named batura by jed Sun May  6 11:25:55 2012</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: Libraries linked from /home/jed/petsc/mpich/lib</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: Configure run at Tue Apr 17 15:54:40 2012</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: Configure options --download-ams --download-blacs --download-chaco --download-hypre --download-metis --download-ml --download-parmetis --download-spai --download-spooles --download-sundials --download-superlu --download-superlu_dist --download-triangle --with-blas-lapack=/usr --with-c2html --with-cholmod-dir=/usr --with-lgrind --with-mpi-dir=/opt/mpich2 --with-pcbddc --with-pthreadclasses --with-shared-libraries --with-single-library=0 --with-sowing --with-umfpack-dir=/usr --with-x -PETSC_ARCH=mpich</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: MatGetFactor_seqsbaij_petsc() line 1817 in /home/jed/petsc/src/mat/impls/sbaij/seq/sbaij.c</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: MatGetFactor() line 3990 in /home/jed/petsc/src/mat/interface/matrix.c</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: PCSetUp_ILU() line 214 in /home/jed/petsc/src/ksp/pc/impls/factor/ilu/ilu.c</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: PCSetUp() line 832 in /home/jed/petsc/src/ksp/pc/interface/precon.c</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: KSPSetUp() line 278 in /home/jed/petsc/src/ksp/ksp/interface/itfunc.c</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: KSPSolve() line 402 in /home/jed/petsc/src/ksp/ksp/interface/itfunc.c</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: SNES_KSPSolve() line 4224 in /home/jed/petsc/src/snes/interface/snes.c</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: SNESSolve_LS() line 200 in /home/jed/petsc/src/snes/impls/ls/ls.c</font></div><div><font face="'courier new', monospace">[0]PETSC ERROR: SNESSolve() line 3442 in /home/jed/petsc/src/snes/interface/snes.c</font></div>
<div><font face="'courier new', monospace">[0]PETSC ERROR: main() line 152 in src/snes/examples/tutorials/ex5.c</font></div><div><font face="'courier new', monospace">application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0</font></div>
</div><div><br></div><div>What are the alternatives to moving matrix creation (via DM) all the way up here?</div>