diff options
Diffstat (limited to 'src/RKCoefficients.c')
-rw-r--r-- | src/RKCoefficients.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/src/RKCoefficients.c b/src/RKCoefficients.c index 905fb60..57ac38a 100644 --- a/src/RKCoefficients.c +++ b/src/RKCoefficients.c @@ -73,7 +73,36 @@ int MoL_SetupRKCoefficients(CCTK_ARGUMENTS) CCTK_INT ierr, options_table; - if (CCTK_Equals(Generic_Type,"ICN")) + if (CCTK_EQUALS(Generic_Type,"Classic RK3")) + { + if (MoL_Num_Scratch_Levels != 2) + { + CCTK_WARN(0, "For Classic RK3, MoL_Num_Scratch_Levels " + "should be at least 2"); + } + if (MoL_Intermediate_Steps != 3) + { + CCTK_WARN(0, "For Classic RK3, MoL_Intermediate_Steps " + "should be at least 3"); + } + for (i = 0; i < MoL_Intermediate_Steps; i++) + { + for (j = 0; j < MoL_Num_Scratch_Levels + 1; j++) + { + RKAlphaCoefficients[i * MoL_Intermediate_Steps + j] = 0.0; + } + RKBetaCoefficients[i] = 0.0; + } + RKAlphaCoefficients[0] = 1.0; + RKAlphaCoefficients[3] = 1.0; + RKAlphaCoefficients[6] = 1.0 / 9.0; + RKAlphaCoefficients[7] = 4.0 / 9.0; + RKAlphaCoefficients[8] = 4.0 / 9.0; + RKBetaCoefficients[0] = 0.5; + RKBetaCoefficients[1] = 0.75; + RKBetaCoefficients[2] = 4.0 / 9.0; + } + else if (CCTK_EQUALS(Generic_Type,"ICN")) { for (i = 0; i < MoL_Intermediate_Steps; i++) { @@ -92,7 +121,7 @@ int MoL_SetupRKCoefficients(CCTK_ARGUMENTS) } } } - else if (CCTK_Equals(Generic_Type,"RK")) + else if (CCTK_EQUALS(Generic_Type,"RK")) { if (MoL_Num_Scratch_Levels < MoL_Intermediate_Steps - 1) { @@ -152,7 +181,7 @@ int MoL_SetupRKCoefficients(CCTK_ARGUMENTS) "with MoL_Intermediate_Steps greater than 4"); } } - else if (CCTK_Equals(Generic_Type,"Table")) + else if (CCTK_EQUALS(Generic_Type,"Table")) { if (MoL_Num_Scratch_Levels < MoL_Intermediate_Steps - 1) { |