aboutsummaryrefslogtreecommitdiff
path: root/src/IndexArrays.c
diff options
context:
space:
mode:
authoreschnett <eschnett@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2013-01-22 21:00:28 +0000
committereschnett <eschnett@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2013-01-22 21:00:28 +0000
commita4ed7cfd73db6ef8418ffb47f4237cc529f8c710 (patch)
treebfd603e9eb86fc9ad01ee2b841013903752d1859 /src/IndexArrays.c
parent15f9511f821e350bc8c0c850b6f0a65ff786df87 (diff)
MoL Update
New integrator Euler. This is an explicit, first-order method, mostly useful for debugging. New integrators AB (Adams-Bashforth) with various orders. These are explicit integrators using several past timelevels to provide higher-order integration with a single RHS evaluation each. Introduce LinearCombination, a generic routine to calculate linear combinations of grid functions. This simplifies existing code, and can be overloaded if MoL should run on a device (e.g. with OpenCL). Replace cctk_lsh with cctk_ash where necessary. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@190 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
Diffstat (limited to 'src/IndexArrays.c')
-rw-r--r--src/IndexArrays.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/IndexArrays.c b/src/IndexArrays.c
index 485a4bd..65a4dac 100644
--- a/src/IndexArrays.c
+++ b/src/IndexArrays.c
@@ -12,6 +12,7 @@
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
+#include "util_String.h"
#include <stdlib.h>
#include <stdio.h>
@@ -313,6 +314,10 @@ void MoL_SetupIndexArrays(CCTK_ARGUMENTS)
CCTK_WARN(0, "Generic_Type not recognized!");
}
}
+ else if (CCTK_EQUALS(ODE_Method,"Euler"))
+ {
+ sprintf(infoline, "Euler");
+ }
else if (CCTK_EQUALS(ODE_Method,"RK2"))
{
sprintf(infoline, "Runge-Kutta 2");
@@ -352,6 +357,38 @@ void MoL_SetupIndexArrays(CCTK_ARGUMENTS)
"Averaging iterative Crank Nicholson with %i iterations",
MoL_Intermediate_Steps);
}
+ else if (CCTK_EQUALS(ODE_Method,"AB"))
+ {
+ if (CCTK_EQUALS(AB_Type,"1"))
+ {
+ Util_snprintf(infoline, sizeof infoline,
+ "Adams-Bashforth of order 1");
+ }
+ else if (CCTK_EQUALS(AB_Type,"2"))
+ {
+ Util_snprintf(infoline, sizeof infoline,
+ "Adams-Bashforth of order 2");
+ }
+ else if (CCTK_EQUALS(AB_Type,"3"))
+ {
+ Util_snprintf(infoline, sizeof infoline,
+ "Adams-Bashforth of order 3");
+ }
+ else if (CCTK_EQUALS(AB_Type,"4"))
+ {
+ Util_snprintf(infoline, sizeof infoline,
+ "Adams-Bashforth of order 4");
+ }
+ else if (CCTK_EQUALS(AB_Type,"5"))
+ {
+ Util_snprintf(infoline, sizeof infoline,
+ "Adams-Bashforth of order 5");
+ }
+ else
+ {
+ CCTK_WARN(0, "AB_Type not recognized!");
+ }
+ }
else if (CCTK_EQUALS(ODE_Method,"RK2-MR-2:1"))
{
sprintf(infoline, "Multi-rate 2:1 Runge-Kutta 2");