>>> I realize the ARKIMEX page does say "Methods with an explicit stage can >>> only be used with ODE in which the stiff part G(t,X,Xdot) has the form Xdot >>> + Ghat(t,X)." So my example does not do that. Is there a way for >>> ARKIMEX to detect that dG/d(Xdot) = I? > >> Other than sampling its action on vectors? Not really; it's user code. > > Call TSComputeIFunction(TS ts,PetscReal t,Vec U,Vec Udot,Vec Y,PetscBool imex) with Udot all 1 and rhsfunction turned off. Call again with Udot is zero, take the difference. If it does not return all 1 then you know the user has provided an unacceptable function? > > You could do this at the beginning of each TSSolve() for these picky methods in debug mode.
How about calling the IJacobian first with a=0 and then with a=1 and subtracting matrices, to see if the result is the identity? Ed On Sun, Aug 30, 2020 at 3:24 PM Barry Smith <bsm...@petsc.dev> wrote: > > > > On Aug 30, 2020, at 6:04 PM, Jed Brown <j...@jedbrown.org> wrote: > > > > Ed Bueler <elbue...@alaska.edu> writes: > > > >> Darn, sorry. > >> > >> I realize the ARKIMEX page does say "Methods with an explicit stage can > >> only be used with ODE in which the stiff part G(t,X,Xdot) has the form > Xdot > >> + Ghat(t,X)." So my example does not do that. Is there a way for > >> ARKIMEX to detect that dG/d(Xdot) = I? > > > > Other than sampling its action on vectors? Not really; it's user code. > > Call TSComputeIFunction(TS ts,PetscReal t,Vec U,Vec Udot,Vec Y,PetscBool > imex) with Udot all 1 and rhsfunction turned off. Call again with Udot is > zero, take the difference. If it does not return all 1 then you know the > user has provided an unacceptable function? > > You could do this at the beginning of each TSSolve() for these picky > methods in debug mode. > > > > > > Emil, per our thread the other day, here is an example of "misuse" by a > very experienced user. We need a better way to detect or provide feedback > to users. > > -- Ed Bueler Dept of Mathematics and Statistics University of Alaska Fairbanks Fairbanks, AK 99775-6660 306C Chapman