Commits

Debojyoti Ghosh committed fdefd5e

Added Dormand-Prince and Bogacki-Shampine RK schemes...

  • Participants
  • Parent commits f68a32c
  • Branches emil/ts-irk, emil/ts-main 2
    1. emil/ts-poststage
    2. emil/ts-rk-rehab

Comments (0)

Files changed (3)

File include/finclude/petsctsdef.h

 
 #define TSRKType character*(80)
 #define TSRK1FE   '1fe'
-#define TSRK2     '2'
+#define TSRK2A    '2a'
 #define TSRK3     '3'
+#define TSRK3BS   '3bs'
 #define TSRK4     '4'
-#define TSRK5F    '5fehlberg'
+#define TSRK5F    '5f'
+#define TSRK5DP   '5dp'
 
 #define TSARKIMEXType character*(80)
 #define TSARKIMEX1BEE   '1bee'

File include/petscts.h

 J*/
 typedef const char* TSRKType;
 #define TSRK1FE   "1fe"
-#define TSRK2     "2"
+#define TSRK2A    "2a"
 #define TSRK3     "3"
+#define TSRK3BS   "3bs"
 #define TSRK4     "4"
-#define TSRK5F    "5fehlberg"
+#define TSRK5F    "5f"
+#define TSRK5DP   "5dp"
 PETSC_EXTERN PetscErrorCode TSRKGetType(TS ts,TSRKType*);
 PETSC_EXTERN PetscErrorCode TSRKSetType(TS ts,TSRKType);
 PETSC_EXTERN PetscErrorCode TSRKSetFullyImplicit(TS,PetscBool);

File src/ts/impls/explicit/rk/rk.c

                     {1.0,0.0}},
       b[2]        = {0.5,0.5},
       bembed[2]   = {1.0,0};
-    ierr = TSRKRegister(TSRK2,2,2,&A[0][0],b,NULL,bembed,1,b);CHKERRQ(ierr);
+    ierr = TSRKRegister(TSRK2A,2,2,&A[0][0],b,NULL,bembed,2,b);CHKERRQ(ierr);
   }
   {
     const PetscReal
                  {2.0/3.0,0,0},
                  {-1.0/3.0,1.0,0}},
       b[3]    = {0.25,0.5,0.25};
-    ierr = TSRKRegister(TSRK3,3,3,&A[0][0],b,NULL,NULL,2,b);CHKERRQ(ierr);
+    ierr = TSRKRegister(TSRK3,3,3,&A[0][0],b,NULL,NULL,3,b);CHKERRQ(ierr);
+  }
+  {
+    const PetscReal
+      A[4][4] = {{0,0,0,0},
+                 {1.0/2.0,0,0,0},
+                 {0,3.0/4.0,0,0},
+                 {2.0/9.0,1.0/3.0,4.0/9.0,0}},
+      b[4]    = {2.0/9.0,1.0/3.0,4.0/9.0,0},
+      bembed[4] = {7.0/24.0,1.0/4.0,1.0/3.0,1.0/8.0};
+    ierr = TSRKRegister(TSRK3BS,3,4,&A[0][0],b,NULL,bembed,3,b);CHKERRQ(ierr);
   }
   {
     const PetscReal
                  {0,0.5,0,0},
                  {0,0,1.0,0}},
       b[4]    = {1.0/6.0,1.0/3.0,1.0/3.0,1.0/6.0};
-    ierr = TSRKRegister(TSRK4,4,4,&A[0][0],b,NULL,NULL,2,b);CHKERRQ(ierr);
+    ierr = TSRKRegister(TSRK4,4,4,&A[0][0],b,NULL,NULL,4,b);CHKERRQ(ierr);
   }
   {
     const PetscReal
                    {-8.0/27.0,2.0,-3544.0/2565.0,1859.0/4104.0,-11.0/40.0,0}},
       b[6]      = {16.0/135.0,0,6656.0/12825.0,28561.0/56430.0,-9.0/50.0,2.0/55.0},
       bembed[6] = {25.0/216.0,0,1408.0/2565.0,2197.0/4104.0,-1.0/5.0,0};
-    ierr = TSRKRegister(TSRK5F,5,6,&A[0][0],b,NULL,bembed,2,b);CHKERRQ(ierr);
+    ierr = TSRKRegister(TSRK5F,5,6,&A[0][0],b,NULL,bembed,5,b);CHKERRQ(ierr);
+  }
+  {
+    const PetscReal
+      A[7][7]   = {{0,0,0,0,0,0,0},
+                   {1.0/5.0,0,0,0,0,0,0},
+                   {3.0/40.0,9.0/40.0,0,0,0,0,0},
+                   {44.0/45.0,-56.0/15.0,32.0/9.0,0,0,0,0},
+                   {19372.0/6561.0,-25360.0/2187.0,64448.0/6561.0,-212.0/729.0,0,0,0},
+                   {9017.0/3168.0,-355.0/33.0,46732.0/5247.0,49.0/176.0,-5103.0/18656.0,0,0},
+                   {35.0/384.0,0,500.0/1113.0,125.0/192.0,-2187.0/6784.0,11.0/84.0,0}},
+      b[7]      = {35.0/384.0,0,500.0/1113.0,125.0/192.0,-2187.0/6784.0,11.0/84.0,0},
+      bembed[7] = {5179.0/57600.0,0,7571.0/16695.0,393.0/640.0,-92097.0/339200.0,187.0/2100.0,1.0/40.0};
+    ierr = TSRKRegister(TSRK5DP,5,7,&A[0][0],b,NULL,bembed,5,b);CHKERRQ(ierr);
   }
   PetscFunctionReturn(0);
 }