This is a problem I've been harping on but should harp on more; It is IMPOSSIBLE to reset the context on a lot of things to null after it's been set.  What's happening is that the context is being set as the TS object in the previous setting of the SNES jacobian in TSSetRHSJacobian.  Then, this call is expecting it to have a MatFDColoring.  I could just make SNESDefaultComputeJacobianColor ignore its context argument, but I left it in there so that a user could pass their own coloring in.<br>
<br>It's my opinion that sticking PetscObjects in the context field like the SNES wrappers for TS function and jacobian evaluations do is a bad habit.  However, just composing it with, say, the DM won't give us the flexibility we need if, for instance, we want multilevel methods to work on this.  <br>
<br>- Peter<br><br><div class="gmail_quote">On Tue, Aug 14, 2012 at 4:12 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
  Things are still mighty fragile ----<br>
<br>
> [0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
> [0]PETSC ERROR: Invalid argument!<br>
> [0]PETSC ERROR: Wrong type of object: Parameter # 6!<br>
> [0]PETSC ERROR: ------------------------------------------------------------------------<br>
> [0]PETSC ERROR: Petsc Development HG revision: bd03fdcd3cf87c5b29ea28a5f4737ae936d9df04  HG Date: Sat Aug 11 20:22:42 2012 -0500<br>
> [0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
> [0]PETSC ERROR: See docs/index.html for manual pages.<br>
> [1]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
> [1]PETSC ERROR: Invalid argument!<br>
> [1]PETSC ERROR: Wrong type of object: Parameter # 6!<br>
> [1]PETSC ERROR: ------------------------------------------------------------------------<br>
> [1]PETSC ERROR: Petsc Development HG revision: bd03fdcd3cf87c5b29ea28a5f4737ae936d9df04  HG Date: Sat Aug 11 20:22:42 2012 -0500<br>
> [1]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
> [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
> [1]PETSC ERROR: See docs/index.html for manual pages.<br>
> [1]PETSC ERROR: ------------------------------------------------------------------------<br>
> [1]PETSC ERROR: ./ex13 on a arch-gnu named Barrys-MacBook-Pro.local by barrysmith Mon Aug 13 21:36:58 2012<br>
> [2]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
> [2]PETSC ERROR: Invalid argument!<br>
> [2]PETSC ERROR: Wrong type of object: Parameter # 6!<br>
> [2]PETSC ERROR: ------------------------------------------------------------------------<br>
> [2]PETSC ERROR: Petsc Development HG revision: bd03fdcd3cf87c5b29ea28a5f4737ae936d9df04  HG Date: Sat Aug 11 20:22:42 2012 -0500<br>
> [2]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
> [2]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
> [2]PETSC ERROR: See docs/index.html for manual pages.<br>
> [2]PETSC ERROR: ------------------------------------------------------------------------<br>
> [2]PETSC ERROR: ./ex13 on a arch-gnu named Barrys-MacBook-Pro.local by barrysmith Mon Aug 13 21:36:58 2012<br>
> [2]PETSC ERROR: Libraries linked from /Users/barrysmith/Src/petsc-dev/arch-gnu/lib<br>
> [2]PETSC ERROR: Configure run at Sat Aug 11 20:25:02 2012<br>
> [2]PETSC ERROR: Configure options --download-blacs --download-fftw --download-hypre --download-libyaml --download-metis --download-ml --download-mpich --download-mumps --download-parmetis --download-ptscotch --download-scalapack --download-superlu --download-superlu_dist --download-triangle --download-yaml --with-ams-dir=/Users/barrysmith/Src/ams-dev --with-java --with-openmp --with-server --with-shared-libraries PETSC_ARCH=arch-gnu<br>

> [2]PETSC ERROR: [0]PETSC ERROR: ------------------------------------------------------------------------<br>
> [0]PETSC ERROR: ./ex13 on a arch-gnu named Barrys-MacBook-Pro.local by barrysmith Mon Aug 13 21:36:58 2012<br>
> [0]PETSC ERROR: Libraries linked from /Users/barrysmith/Src/petsc-dev/arch-gnu/lib<br>
> [0]PETSC ERROR: Configure run at Sat Aug 11 20:25:02 2012<br>
> [0]PETSC ERROR: Configure options --download-blacs --download-fftw --download-hypre --download-libyaml --download-metis --download-ml --download-mpich --download-mumps --download-parmetis --download-ptscotch --download-scalapack --download-superlu --download-superlu_dist --download-triangle --download-yaml --with-ams-dir=/Users/barrysmith/Src/ams-dev --with-java --with-openmp --with-server --with-shared-libraries PETSC_ARCH=arch-gnu<br>

> [0]PETSC ERROR: ------------------------------------------------------------------------<br>
> [0]PETSC ERROR: SNESDefaultComputeJacobianColor() line 50 in /Users/barrysmith/Src/petsc-dev/src/snes/interface/snesj2.c<br>
> [0]PETSC ERROR: SNESComputeJacobian() line 2079 in /Users/barrysmith/Src/petsc-dev/src/snes/interface/snes.c<br>
> [0]PETSC ERROR: SNESSolve_LS() line 198 in /Users/barrysmith/Src/petsc-dev/src/snes/impls/ls/ls.c<br>
> [0]PETSC ERROR: SNESSolve() line 3570 in /Users/barrysmith/Src/petsc-dev/src/snes/interface/snes.c<br>
> [1]PETSC ERROR: Libraries linked from /Users/barrysmith/Src/petsc-dev/arch-gnu/lib<br>
> [1]PETSC ERROR: Configure run at Sat Aug 11 20:25:02 2012<br>
> [1]PETSC ERROR: Configure options --download-blacs --download-fftw --download-hypre --download-libyaml --download-metis --download-ml --download-mpich --download-mumps --download-parmetis --download-ptscotch --download-scalapack --download-superlu --download-superlu_dist --download-triangle --download-yaml --with-ams-dir=/Users/barrysmith/Src/ams-dev --with-java --with-openmp --with-server --with-shared-libraries PETSC_ARCH=arch-gnu<br>

> [1]PETSC ERROR: ------------------------------------------------------------------------<br>
> [1]PETSC ERROR: SNESDefaultComputeJacobianColor() line 50 in /Users/barrysmith/Src/petsc-dev/src/snes/interface/snesj2.c<br>
> [1]PETSC ERROR: SNESComputeJacobian() line 2079 in /Users/barrysmith/Src/petsc-dev/src/snes/interface/snes.c<br>
> [1]PETSC ERROR: SNESSolve_LS() line 198 in /Users/barrysmith/Src/petsc-dev/src/snes/impls/ls/ls.c<br>
> [1]PETSC ERROR: SNESSolve() line 3570 in /Users/barrysmith/Src/petsc-dev/src/snes/interface/snes.c<br>
> [1]PETSC ERROR: TSStep_Theta() line 116 in /Users/barrysmith/Src/petsc-dev/src/ts/impls/implicit/theta/theta.c<br>
> [1]PETSC ERROR: ------------------------------------------------------------------------<br>
> [2]PETSC ERROR: SNESDefaultComputeJacobianColor() line 50 in /Users/barrysmith/Src/petsc-dev/src/snes/interface/snesj2.c<br>
> [2]PETSC ERROR: SNESComputeJacobian() line 2079 in /Users/barrysmith/Src/petsc-dev/src/snes/interface/snes.c<br>
> [2]PETSC ERROR: SNESSolve_LS() line 198 in /Users/barrysmith/Src/petsc-dev/src/snes/impls/ls/ls.c<br>
> [2]PETSC ERROR: SNESSolve() line 3570 in /Users/barrysmith/Src/petsc-dev/src/snes/interface/snes.c<br>
> [2]PETSC ERROR: TSStep_Theta() line 116 in /Users/barrysmith/Src/petsc-dev/src/ts/impls/implicit/theta/theta.c<br>
> [2]PETSC ERROR: TSStep() line 1977 in /Users/barrysmith/Src/petsc-dev/src/ts/interface/ts.c<br>
> [2]PETSC ERROR: TSSolve() line 2100 in /Users/barrysmith/Src/petsc-dev/src/ts/interface/ts.c<br>
> [0]PETSC ERROR: TSStep_Theta() line 116 in /Users/barrysmith/Src/petsc-dev/src/ts/impls/implicit/theta/theta.c<br>
> [0]PETSC ERROR: TSStep() line 1977 in /Users/barrysmith/Src/petsc-dev/src/ts/interface/ts.c<br>
> [0]PETSC ERROR: TSSolve() line 2100 in /Users/barrysmith/Src/petsc-dev/src/ts/interface/ts.c<br>
> [0]PETSC ERROR: main() line 108 in src/ts/examples/tutorials/ex13.c<br>
> TSStep() line 1977 in /Users/barrysmith/Src/petsc-dev/src/ts/interface/ts.c<br>
> [1]PETSC ERROR: TSSolve() line 2100 in /Users/barrysmith/Src/petsc-dev/src/ts/interface/ts.c<br>
> [1]PETSC ERROR: main() line 108 in src/ts/examples/tutorials/ex13.c<br>
> [2]PETSC ERROR: main() line 108 in src/ts/examples/tutorials/ex13.c<br>
> application called MPI_Abort(MPI_COMM_WORLD, 62) - process 0<br>
> [cli_0]: aborting job:<br>
> application called MPI_Abort(MPI_COMM_WORLD, 62) - process 0<br>
> application called MPI_Abort(MPI_COMM_WORLD, 62) - process 1<br>
> [cli_1]: aborting job:<br>
> application called MPI_Abort(MPI_COMM_WORLD, 62) - process 1<br>
> application called MPI_Abort(MPI_COMM_WORLD, 62) - process 2<br>
> [cli_2]: aborting job:<br>
> application called MPI_Abort(MPI_COMM_WORLD, 62) - process 2<br>
/Users/barrysmith/Src/petsc-dev/src/ts/examples/tutorials<br>
Possible problem with ex13_3, diffs above<br>
=========================================<br>
<br>
</blockquote></div><br>