Hi, Suppose the following is the residual function that TS needs:
void residualFunction(TS ts, PetscScalar t, Vec X, Vec dX_dt, Vec F, void *ptr) and this returns the following finite volume residual at each grid point dU_dt + gradF + sourceTerms = 0 where dU_dt are the time derivatives of the conserved variables. The value of dU_dt needs to be computed from the values of the time derivatives of the primitive variables given in dX_dt, i.e. dU_dt is an analytic function of dX_dt. But is it possible to compute dU_dt numerically using the vector X and it's value at a previous time step like the following? dU_dt = (U(X) - U(X_old) )/dt -- (1) (instead of analytically computing dU_dt which is a function of the vectors X and dX_dt which is hard to do if the function is very complicated) So, is computing dU_dt using (1) permissible using TS? The jacobian will be correctly assembled for implicit methods? Cheers, Mani
