The Jacobian interface has the shift parameter which I think is the 'factor' you are looking for.
In the Jacobian function IJacobian(TS ts,PetscReal time,Vec X,Vec Xdot,PetscReal shift,Mat A,Mat B,void *ctx) you can save shift and time to your MatShell context, and later, use them in the shell matrix operations. For example, the Jacobian of F in your case is dF/du+shift*dF/du_t. As Barry indicated, you should not manually set this 'factor', it is determined internally by PETSc according to the time-stepping scheme you are using. Hong (Mr.) On Mar 27, 2017, at 12:56 PM, Amneet Bhalla <[email protected]<mailto:[email protected]>> wrote: On Mon, Mar 27, 2017 at 10:42 AM, Matthew Knepley <[email protected]<mailto:[email protected]>> wrote: 1) sounds easier and matches your current code. Great! For matrix free TS, the form of F(t,u,u_t) = rho u*_t - div ( sigma) as written "on paper" and should not contain time stepping factors like (1/2) that comes from CN? Similarly for RHS = G(t,u). What about Jacobian of F (MATSHELL to solve momentum eqn) --- should that contain these factors? -- --Amneet
