xref: /petsc/src/ts/impls/explicit/rk/rk.h (revision 4c19bcc8199112b0a7b690bb6680614ea0de71fc)
1 typedef struct _RKTableau *RKTableau;
2 struct _RKTableau {
3   char       *name;
4   PetscInt   order;               /* Classical approximation order of the method i              */
5   PetscInt   s;                   /* Number of stages                                           */
6   PetscInt   p;                   /* Interpolation order                                        */
7   PetscBool  FSAL;                /* flag to indicate if tableau is FSAL                        */
8   PetscReal  *A,*b,*c;            /* Tableau                                                    */
9   PetscReal  *bembed;             /* Embedded formula of order one less (order-1)               */
10   PetscReal  *binterp;            /* Dense output formula                                       */
11   PetscReal  ccfl;                /* Placeholder for CFL coefficient relative to forward Euler  */
12 };
13 typedef struct _RKTableauLink *RKTableauLink;
14 struct _RKTableauLink {
15   struct _RKTableau tab;
16   RKTableauLink     next;
17 };
18 
19 typedef struct {
20   RKTableau    tableau;
21   Vec          X0;
22   Vec          *Y;               /* States computed during the step                                              */
23   Vec          *YdotRHS;         /* Function evaluations for the non-stiff part and contains all components      */
24   Vec          *YdotRHS_fast;    /* Function evaluations for the non-stiff part and contains fast components     */
25   Vec          *YdotRHS_slow;    /* Function evaluations for the non-stiff part and contains slow components     */
26   Vec          *VecDeltaLam;     /* Increment of the adjoint sensitivity w.r.t IC at stage                       */
27   Vec          *VecDeltaMu;      /* Increment of the adjoint sensitivity w.r.t P at stage                        */
28   Vec          VecCostIntegral0; /* backup for roll-backs due to events                                          */
29   PetscScalar  *work;            /* Scalar work                                                                  */
30   PetscInt     slow;             /* flag indicates call slow components solver (0) or fast components solver (1) */
31   PetscReal    stage_time;
32   TSStepStatus status;
33   PetscReal    ptime;
34   PetscReal    time_step;
35   PetscInt     dtratio;          /* ratio between slow time step size and fast step size                         */
36   IS           is_fast,is_slow;
37   TS           subts_fast,subts_slow,subts_current,ts_root;
38   PetscBool    use_multirate;
39 } TS_RK;
40