On 8/30/20 6:04 PM, Ed Bueler wrote: Actually, ARKIMEX is not off the hook. It still gets the wrong answer if told the whole thing is implicit:
$ ./ex54 -ts_type arkimex -ts_arkimex_fully_implicit # WRONG (AND REALLY SLOW) error norm at tf = 1.000000 from 224 steps: |u-u_exact| = 2.76636e+00 Hi Ed, can you please add the following TSSetEquationType<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetEquationType.html#TSSetEquationType>(ts,TS_EQ_IMPLICIT<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSEquationType.html#TSEquationType>); before calling TSSolve and try again? This is described in Table 12 in the pdf doc. So that we improve our user experience, can you tell us what are your usual sources/starting points when implementing a new problem: 1- PDF doc 2- tutorials (if you find a good match) 3- own PETSc implementations 4- online function doc 5- other Thanks, Emil versus $ ./ex54 -ts_type arkimex # WRONG BUT IFunction IS OF FLAGGED FORM error norm at tf = 1.000000 from 16 steps: |u-u_exact| = 1.93229e+01 $ ./ex54 -ts_type bdf # RIGHT error norm at tf = 1.000000 from 33 steps: |u-u_exact| = 9.29170e-02 So I am not sure what "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)." means. Ed On Sun, Aug 30, 2020 at 2:57 PM Ed Bueler <[email protected]<mailto:[email protected]>> wrote: 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? Ed On Sun, Aug 30, 2020 at 2:44 PM Ed Bueler <[email protected]<mailto:[email protected]>> wrote: Dear PETSc -- I tried twice to make this an issue at the gitlab.com<http://gitlab.com> host site, but both times got "something went wrong (500)". So this is a bug report by old-fashioned means. I created a TS example, https://github.com/bueler/p4pdes-next/blob/master/c/fix-arkimex/ex54.c at my github, also attached. It solves a 2D linear ODE ``` x' + y' = 6 y y' = x ``` Pretty basic; the known exact solution is just exponentials. The code writes it as F(t,u,u')=G(t,u) and supplies all the pieces, namely IFunction,IJacobian,RHSFunction,RHSJacobian. Note both F and G must be seen by TS to get the correct solution. In summary, a boring (and valgrind-clean ;-)) example. For current master branch it runs fine for the fully-implicit methods (e.g. BDF, CN, ROSW) which can use the IFunction F, including with finite-differenced Jacobians. With BDF2, BDF2+-snes_fd, BDF6+tight tol., CN, BEULER, ROSW: $ ./ex54 error norm at tf = 1.000000 from 33 steps: |u-u_exact| = 9.29170e-02 $ ./ex54 -snes_fd error norm at tf = 1.000000 from 33 steps: |u-u_exact| = 9.29170e-02 $ ./ex54 -ts_rtol 1.0e-14 -ts_atol 1.0e-14 -ts_bdf_order 6 error norm at tf = 1.000000 from 388 steps: |u-u_exact| = 4.23624e-11 $ ./ex54 -ts_type beuler error norm at tf = 1.000000 from 100 steps: |u-u_exact| = 6.71676e-01 $ ./ex54 -ts_type cn error norm at tf = 1.000000 from 100 steps: |u-u_exact| = 2.22839e-03 $ ./ex54 -ts_type rosw error norm at tf = 1.000000 from 21 steps: |u-u_exact| = 5.64012e-03 But it produces wrong values with ARKIMEX: $ ./ex54 -ts_type arkimex error norm at tf = 1.000000 from 16 steps: |u-u_exact| = 1.93229e+01 Neither tightening tolerance nor changing type (`-ts_arkimex_type`) helps ARKIMEX. Thanks! Ed PS My book is at a late proofs stage, and out of my hands. It should appear SIAM Press in a couple of months. In all the examples in my book, only my diffusion-reaction system example using F(t,u,u') = G(t,u) is broken. Thus the motivation for a trivial ODE example as above. -- Ed Bueler Dept of Mathematics and Statistics University of Alaska Fairbanks Fairbanks, AK 99775-6660 306C Chapman -- Ed Bueler Dept of Mathematics and Statistics University of Alaska Fairbanks Fairbanks, AK 99775-6660 306C Chapman -- Ed Bueler Dept of Mathematics and Statistics University of Alaska Fairbanks Fairbanks, AK 99775-6660 306C Chapman -- Emil M. Constantinescu, Ph.D. Computational Mathematician Argonne National Laboratory Mathematics and Computer Science Division Ph: 630-252-0926 http://www.mcs.anl.gov/~emconsta
