Hi folks,<br><br>I am trying to implement a sample problem for SNES using a shell matrix construct for the Jacobian (*not* finite differences).<br><br>However, I haven't yet found a straightforward example for this. I've seen one for a shell-based PC but not for a shell-based Jacobian.<br>
<br>I thought a sequence like this would work, but I'm not sure how to set the Jacobian. <br><br> call MatCreateShell( PETSC_COMM_SELF, m, n, m, n, PETSC_NULL_OBJECT, Jshell, ierr )<br> call MatShellSetOperation( Jshell, MATOP_MULT, jac_shell, ierr )<br>
call MatCreateSNESMF( snes, Jshell, ierr )<br> call SNESSetJacobian( snes, Jshell, Jshell, ???, PETSC_NULL_OBJECT, ierr )<br><br>I need no PC right now, jac_shell computes the result J*v, and Jshell is an empty Mat. <br>
<br>How do I finish this calling sequence? Am I way off base here?<br><br>Thanks,<br>Jeremy<br>