aboutsummaryrefslogtreecommitdiff
path: root/src/RKCoefficients.c
diff options
context:
space:
mode:
authorhawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2004-07-01 11:02:39 +0000
committerhawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2004-07-01 11:02:39 +0000
commit2c8448f84da0b9f4ae13cf1a02c71e0c626e4782 (patch)
treeacdb6e851521a70ce86232c157fcde018a332c73 /src/RKCoefficients.c
parent6c919642546550497f17559a7d4f19a01b8d39ef (diff)
Add the Classic RK3 method (as a generic method, so use Generic_Type).
Agrees with other RK3's to floating point round off (except at boundaries) for linear case. Uses more storage and is slower than standard RK3 so I don't recommend it. This showed up (so I fixed) a bug with the generic methods when used with Carpet. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@72 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
Diffstat (limited to 'src/RKCoefficients.c')
-rw-r--r--src/RKCoefficients.c35
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)
{