Commits

Debojyoti Ghosh  committed 2e698f8

minor edits in rk and adding petsc math types in ex31

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

Comments (5)

  1. Jed Brown

    Where is ex31? This branch seems to have no tests at all. Shall we change the default method to something with an embedded method. (A normal run with -ts_type rk fails now because the adaptive controller tries to evaluate an embedded method.) And there is a short section in the user's manual (src/docs/tex/manual/part2.tex) that needs to be updated.

  2. Debojyoti Ghosh author

    The comment on ex31 is actually leftover from the time when I had emil/ts-new-examples and emil/ts-rk-rehab in the same branch (ex31 is a new example added in emil/ts-new-examples). I changed this commit text to just "minor edits in rk" and pushed my branch to this repo, but it isn't showing up here! Is there a way to change the text here? Also, I changed the default RK method to TSRK3BS (3rd order Bogacki-Shampine with 2nd order embedded method) and pushed that commit to this repo/branch (does the pull request get updated?). What do we need to update in src/docs/tex/manual/part2.tex?

    1. Jed Brown

      Thanks. This is just the commit so it won't change, but I got your updates in the branch. The user's manual has a short section "Using the Explicit Runge-Kutta timestepper with variable timesteps" that mentions TSRKSetTolerance, which no longer exists. Please just change the statements about default method.

      We should write a proper section about using adaptive controllers later, but all I care about when merging this branch is that the documentation is consistent with the code.

      1. Debojyoti Ghosh author

        Hey, I updated the user's manual and pushed the changes. Can you check if I wrote it out correctly? I mentioned what the default method is, as well as other available methods. I also put in a sentence about the RK methods that do not have an embedded method and thus, cannot be used with variable time-steps.

Files changed (1)

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

 /*
-  Code for timestepping with Runge-Kutta method
+  Code for time stepping with the Runge-Kutta method
 
   Notes:
   The general system is written as
 
-  F(t,U,Udot) = G(t,U)
-
-  where F represents the stiff part of the physics and G represents the non-stiff part.
+  Udot = F(t,U)
 
 */
 #include <petsc-private/tsimpl.h>                /*I   "petscts.h"   I*/
 #include <petscdm.h>
 
-static TSRKType TSRKDefault = TSRK3;
-static PetscBool     TSRKRegisterAllCalled;
-static PetscBool     TSRKPackageInitialized;
-static PetscInt      explicit_stage_time_id;
+static TSRKType  TSRKDefault = TSRK3;
+static PetscBool TSRKRegisterAllCalled;
+static PetscBool TSRKPackageInitialized;
+static PetscInt  explicit_stage_time_id;
 
 typedef struct _RKTableau *RKTableau;
 struct _RKTableau {
 /*MC
      TSRK4 - Fourth order RK scheme.
 
-     This method has four stages.
+     This is the classical Runge-Kutta method with four stages.
 
      Level: advanced
 
 .seealso: TSRK
 M*/
 /*MC
-     TSRK5F - Fifth order Fehlberg RK scheme with 4th order embedded method.
+     TSRK5F - Fifth order Fehlberg RK scheme with a 4th order embedded method.
 
      This method has six stages.
 
 .seealso: TSRK
 M*/
 /*MC
-     TSRK5DP - Fifth order Dormand-Prince RK scheme with 4th order embedded method.
+     TSRK5DP - Fifth order Dormand-Prince RK scheme with the 4th order embedded method.
 
      This method has seven stages.
 
       ts->steps++;
       rk->status = TS_STEP_COMPLETE;
       ierr = PetscObjectComposedDataSetReal((PetscObject)ts->vec_sol,explicit_stage_time_id,ts->ptime);CHKERRQ(ierr);
-
       break;
     } else {                    /* Roll back the current step */
       for (j=0; j<s; j++) w[j] = -h*b[j];