aboutsummaryrefslogtreecommitdiff
path: root/src/ParamCheck.c
diff options
context:
space:
mode:
authorhawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2003-07-22 07:07:14 +0000
committerhawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2003-07-22 07:07:14 +0000
commite3096d84ffb4b909977066f158db78eb45f4a80b (patch)
tree9e41096faa3de1f2af27660866aa5e4eea4cffed /src/ParamCheck.c
parent06f6fb8bd438528724715988336a8b8ef86192ce (diff)
Add two methods:
RK3. The optimized version of the TVD RK3 solver. Requires no scratch space so is about as efficient as ICN, but third order. Generic method from a parameter table. By specifying the number of intermediate steps and the alpha and beta arrays, create your own method at parameter time. Not well (or at all) documented because it doesn't seem to work correctly at the moment. Some tidying of extraneous code as well. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@29 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
Diffstat (limited to 'src/ParamCheck.c')
-rw-r--r--src/ParamCheck.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/ParamCheck.c b/src/ParamCheck.c
index 2ade916..01e6cbd 100644
--- a/src/ParamCheck.c
+++ b/src/ParamCheck.c
@@ -12,6 +12,9 @@
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
+#include "util_ErrorCodes.h"
+#include "util_Table.h"
+
static const char *rcsid = "$Header$";
CCTK_FILEVERSION(AlphaThorns_MoL_ParamCheck_c);
@@ -62,19 +65,54 @@ int MoL_ParamCheck(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
+ CCTK_INT options_table, ierr, GenericIntermediateSteps;
+
if (CCTK_Equals(ODE_Method, "Generic"))
{
if (MoL_Num_Scratch_Levels < MoL_Intermediate_Steps - 1)
{
CCTK_PARAMWARN("When using a generic solver the number of scratch levels must be at least the number of intermediate steps - 1");
}
+ if (CCTK_Equals(Generic_Type, "Table"))
+ {
+ options_table =
+ Util_TableCreateFromString(Generic_Method_Descriptor);
+ if (options_table < 0)
+ {
+ CCTK_WARN(0, "Failed to create table from Generic_Method_Descriptor!");
+ }
+ ierr = Util_TableGetInt(options_table,
+ &GenericIntermediateSteps,
+ "GenericIntermediateSteps");
+ if (ierr < 1)
+ {
+ if (ierr == UTIL_ERROR_TABLE_NO_SUCH_KEY)
+ {
+ CCTK_WARN(0, "When using the generic table options you must set \"GenericIntermediateSteps\" in the options table");
+ }
+ else
+ {
+ CCTK_WARN(0, "Table error - check with Ian.");
+ }
+ }
+ if (MoL_Intermediate_Steps != GenericIntermediateSteps)
+ {
+ CCTK_PARAMWARN("The number of intermediate steps must equal the number specified in the table options!");
+ }
+ ierr = Util_TableDestroy(options_table);
+ }
}
if ( (CCTK_Equals(ODE_Method, "RK2"))&&(!(MoL_Intermediate_Steps == 2)) )
{
CCTK_PARAMWARN("When using the efficient RK2 evolver the number of intermediate steps must be 2");
}
-
+
+ if ( (CCTK_Equals(ODE_Method, "RK3"))&&(!(MoL_Intermediate_Steps == 3)) )
+ {
+ CCTK_PARAMWARN("When using the efficient RK3 evolver the number of intermediate steps must be 3");
+ }
+
return 0;
}