Up to now, I've not changed any API

http://petsc.cs.iit.edu/petsc/temp/petsc-dev-ts/rev/86e0cf3edea1

The Algorithm pattern appears (Barry, let me use such "pretension
academic language"), so I think we should not duplicate the code with
the time-stepping loop, and use something like this:

TSSolve(x):

TSSetUp()
#This subtype handles the whole time-stepping loop (like Sundials?)*/
if ts->ops->solve {
    ts->ops->solve()
    return
#This subtype handles step by step (many PETSc TS subtype, like Theta) */
for (i=0; i< max_steps; i++)
    if i==0: Monitor()
    PreStep()
    ts->ops->step( .... ) #
    PostStep()
    Monitor()

Moreover, we could redefine TSStep() to mean "do just one (or many)? steps":

TSStep(ts, step, ....)
    if step ==0: Monitor()
    PreStep()
    ts->ops->step( .... ) #
    PostStep()
    Monitor()

and reuse this for TSSolve()... TSStep() would then give users a bit
more of control, letting them to manage the loop outside TSSolve(),
but still in a high-level way...

Coments ?

-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169

Reply via email to