aboutsummaryrefslogtreecommitdiff
path: root/Examples/SimpleWaveCaKernel/src
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-01-25 16:26:38 -0600
committerIan Hinder <ian.hinder@aei.mpg.de>2012-01-25 16:26:38 -0600
commit66351c0bf0cd499d942874e922c9bd658cc52752 (patch)
treeb8aa94554ef7be6ad059eb4a74a15b23e58193d3 /Examples/SimpleWaveCaKernel/src
parent967e562ad70137c50d31762df2b8e5c897c8fe24 (diff)
Regenerate SimpleWaveCaKernel
Diffstat (limited to 'Examples/SimpleWaveCaKernel/src')
-rw-r--r--Examples/SimpleWaveCaKernel/src/Boundaries.cc208
-rw-r--r--Examples/SimpleWaveCaKernel/src/RegisterMoL.cc2
-rw-r--r--Examples/SimpleWaveCaKernel/src/calc_rhs.code78
-rw-r--r--Examples/SimpleWaveCaKernel/src/initial_sine.code68
-rw-r--r--Examples/SimpleWaveCaKernel/src/rk1.code73
5 files changed, 425 insertions, 4 deletions
diff --git a/Examples/SimpleWaveCaKernel/src/Boundaries.cc b/Examples/SimpleWaveCaKernel/src/Boundaries.cc
index 0417d10..11561bf 100644
--- a/Examples/SimpleWaveCaKernel/src/Boundaries.cc
+++ b/Examples/SimpleWaveCaKernel/src/Boundaries.cc
@@ -31,11 +31,219 @@ extern "C" void SimpleWaveCaKernel_SelectBoundConds(CCTK_ARGUMENTS)
DECLARE_CCTK_PARAMETERS;
CCTK_INT ierr = 0;
+
+ if (CCTK_EQUALS(phi_g_bound, "none" ) ||
+ CCTK_EQUALS(phi_g_bound, "static") ||
+ CCTK_EQUALS(phi_g_bound, "flat" ) ||
+ CCTK_EQUALS(phi_g_bound, "zero" ) )
+ {
+ ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1,
+ "SimpleWaveCaKernel::phi_g", phi_g_bound);
+ if (ierr < 0)
+ CCTK_WARN(0, "Failed to register phi_g_bound BC for SimpleWaveCaKernel::phi_g!");
+ }
+
+ if (CCTK_EQUALS(pi_g_bound, "none" ) ||
+ CCTK_EQUALS(pi_g_bound, "static") ||
+ CCTK_EQUALS(pi_g_bound, "flat" ) ||
+ CCTK_EQUALS(pi_g_bound, "zero" ) )
+ {
+ ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1,
+ "SimpleWaveCaKernel::pi_g", pi_g_bound);
+ if (ierr < 0)
+ CCTK_WARN(0, "Failed to register pi_g_bound BC for SimpleWaveCaKernel::pi_g!");
+ }
+
+ if (CCTK_EQUALS(phi_bound, "none" ) ||
+ CCTK_EQUALS(phi_bound, "static") ||
+ CCTK_EQUALS(phi_bound, "flat" ) ||
+ CCTK_EQUALS(phi_bound, "zero" ) )
+ {
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1,
+ "SimpleWaveCaKernel::phi", phi_bound);
+ if (ierr < 0)
+ CCTK_WARN(0, "Failed to register phi_bound BC for SimpleWaveCaKernel::phi!");
+ }
+
+ if (CCTK_EQUALS(pi_bound, "none" ) ||
+ CCTK_EQUALS(pi_bound, "static") ||
+ CCTK_EQUALS(pi_bound, "flat" ) ||
+ CCTK_EQUALS(pi_bound, "zero" ) )
+ {
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1,
+ "SimpleWaveCaKernel::pi", pi_bound);
+ if (ierr < 0)
+ CCTK_WARN(0, "Failed to register pi_bound BC for SimpleWaveCaKernel::pi!");
+ }
+
+ if (CCTK_EQUALS(phi_g_bound, "radiative"))
+ {
+ /* select radiation boundary condition */
+ static CCTK_INT handle_phi_g_bound = -1;
+ if (handle_phi_g_bound < 0) handle_phi_g_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
+ if (handle_phi_g_bound < 0) CCTK_WARN(0, "could not create table!");
+ if (Util_TableSetReal(handle_phi_g_bound , phi_g_bound_limit, "LIMIT") < 0)
+ CCTK_WARN(0, "could not set LIMIT value in table!");
+ if (Util_TableSetReal(handle_phi_g_bound ,phi_g_bound_speed, "SPEED") < 0)
+ CCTK_WARN(0, "could not set SPEED value in table!");
+
+ ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_phi_g_bound,
+ "SimpleWaveCaKernel::phi_g", "Radiation");
+
+ if (ierr < 0)
+ CCTK_WARN(0, "Failed to register Radiation BC for SimpleWaveCaKernel::phi_g!");
+
+ }
+
+ if (CCTK_EQUALS(pi_g_bound, "radiative"))
+ {
+ /* select radiation boundary condition */
+ static CCTK_INT handle_pi_g_bound = -1;
+ if (handle_pi_g_bound < 0) handle_pi_g_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
+ if (handle_pi_g_bound < 0) CCTK_WARN(0, "could not create table!");
+ if (Util_TableSetReal(handle_pi_g_bound , pi_g_bound_limit, "LIMIT") < 0)
+ CCTK_WARN(0, "could not set LIMIT value in table!");
+ if (Util_TableSetReal(handle_pi_g_bound ,pi_g_bound_speed, "SPEED") < 0)
+ CCTK_WARN(0, "could not set SPEED value in table!");
+
+ ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_pi_g_bound,
+ "SimpleWaveCaKernel::pi_g", "Radiation");
+
+ if (ierr < 0)
+ CCTK_WARN(0, "Failed to register Radiation BC for SimpleWaveCaKernel::pi_g!");
+
+ }
+
+ if (CCTK_EQUALS(phi_bound, "radiative"))
+ {
+ /* select radiation boundary condition */
+ static CCTK_INT handle_phi_bound = -1;
+ if (handle_phi_bound < 0) handle_phi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
+ if (handle_phi_bound < 0) CCTK_WARN(0, "could not create table!");
+ if (Util_TableSetReal(handle_phi_bound , phi_bound_limit, "LIMIT") < 0)
+ CCTK_WARN(0, "could not set LIMIT value in table!");
+ if (Util_TableSetReal(handle_phi_bound ,phi_bound_speed, "SPEED") < 0)
+ CCTK_WARN(0, "could not set SPEED value in table!");
+
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_phi_bound,
+ "SimpleWaveCaKernel::phi", "Radiation");
+
+ if (ierr < 0)
+ CCTK_WARN(0, "Failed to register Radiation BC for SimpleWaveCaKernel::phi!");
+
+ }
+
+ if (CCTK_EQUALS(pi_bound, "radiative"))
+ {
+ /* select radiation boundary condition */
+ static CCTK_INT handle_pi_bound = -1;
+ if (handle_pi_bound < 0) handle_pi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
+ if (handle_pi_bound < 0) CCTK_WARN(0, "could not create table!");
+ if (Util_TableSetReal(handle_pi_bound , pi_bound_limit, "LIMIT") < 0)
+ CCTK_WARN(0, "could not set LIMIT value in table!");
+ if (Util_TableSetReal(handle_pi_bound ,pi_bound_speed, "SPEED") < 0)
+ CCTK_WARN(0, "could not set SPEED value in table!");
+
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_pi_bound,
+ "SimpleWaveCaKernel::pi", "Radiation");
+
+ if (ierr < 0)
+ CCTK_WARN(0, "Failed to register Radiation BC for SimpleWaveCaKernel::pi!");
+
+ }
+
+ if (CCTK_EQUALS(phi_g_bound, "scalar"))
+ {
+ /* select scalar boundary condition */
+ static CCTK_INT handle_phi_g_bound = -1;
+ if (handle_phi_g_bound < 0) handle_phi_g_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
+ if (handle_phi_g_bound < 0) CCTK_WARN(0, "could not create table!");
+ if (Util_TableSetReal(handle_phi_g_bound ,phi_g_bound_scalar, "SCALAR") < 0)
+ CCTK_WARN(0, "could not set SCALAR value in table!");
+
+ ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_phi_g_bound,
+ "SimpleWaveCaKernel::phi_g", "scalar");
+
+ if (ierr < 0)
+ CCTK_WARN(0, "Failed to register Scalar BC for SimpleWaveCaKernel::phi_g!");
+
+ }
+
+ if (CCTK_EQUALS(pi_g_bound, "scalar"))
+ {
+ /* select scalar boundary condition */
+ static CCTK_INT handle_pi_g_bound = -1;
+ if (handle_pi_g_bound < 0) handle_pi_g_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
+ if (handle_pi_g_bound < 0) CCTK_WARN(0, "could not create table!");
+ if (Util_TableSetReal(handle_pi_g_bound ,pi_g_bound_scalar, "SCALAR") < 0)
+ CCTK_WARN(0, "could not set SCALAR value in table!");
+
+ ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_pi_g_bound,
+ "SimpleWaveCaKernel::pi_g", "scalar");
+
+ if (ierr < 0)
+ CCTK_WARN(0, "Failed to register Scalar BC for SimpleWaveCaKernel::pi_g!");
+
+ }
+
+ if (CCTK_EQUALS(phi_bound, "scalar"))
+ {
+ /* select scalar boundary condition */
+ static CCTK_INT handle_phi_bound = -1;
+ if (handle_phi_bound < 0) handle_phi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
+ if (handle_phi_bound < 0) CCTK_WARN(0, "could not create table!");
+ if (Util_TableSetReal(handle_phi_bound ,phi_bound_scalar, "SCALAR") < 0)
+ CCTK_WARN(0, "could not set SCALAR value in table!");
+
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_phi_bound,
+ "SimpleWaveCaKernel::phi", "scalar");
+
+ if (ierr < 0)
+ CCTK_WARN(0, "Error in registering Scalar BC for SimpleWaveCaKernel::phi!");
+
+ }
+
+ if (CCTK_EQUALS(pi_bound, "scalar"))
+ {
+ /* select scalar boundary condition */
+ static CCTK_INT handle_pi_bound = -1;
+ if (handle_pi_bound < 0) handle_pi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
+ if (handle_pi_bound < 0) CCTK_WARN(0, "could not create table!");
+ if (Util_TableSetReal(handle_pi_bound ,pi_bound_scalar, "SCALAR") < 0)
+ CCTK_WARN(0, "could not set SCALAR value in table!");
+
+ ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_pi_bound,
+ "SimpleWaveCaKernel::pi", "scalar");
+
+ if (ierr < 0)
+ CCTK_WARN(0, "Error in registering Scalar BC for SimpleWaveCaKernel::pi!");
+
+ }
return;
}
/* template for entries in parameter file:
+#$bound$#SimpleWaveCaKernel::phi_g_bound = "skip"
+#$bound$#SimpleWaveCaKernel::phi_g_bound_speed = 1.0
+#$bound$#SimpleWaveCaKernel::phi_g_bound_limit = 0.0
+#$bound$#SimpleWaveCaKernel::phi_g_bound_scalar = 0.0
+
+#$bound$#SimpleWaveCaKernel::pi_g_bound = "skip"
+#$bound$#SimpleWaveCaKernel::pi_g_bound_speed = 1.0
+#$bound$#SimpleWaveCaKernel::pi_g_bound_limit = 0.0
+#$bound$#SimpleWaveCaKernel::pi_g_bound_scalar = 0.0
+
+#$bound$#SimpleWaveCaKernel::phi_bound = "skip"
+#$bound$#SimpleWaveCaKernel::phi_bound_speed = 1.0
+#$bound$#SimpleWaveCaKernel::phi_bound_limit = 0.0
+#$bound$#SimpleWaveCaKernel::phi_bound_scalar = 0.0
+
+#$bound$#SimpleWaveCaKernel::pi_bound = "skip"
+#$bound$#SimpleWaveCaKernel::pi_bound_speed = 1.0
+#$bound$#SimpleWaveCaKernel::pi_bound_limit = 0.0
+#$bound$#SimpleWaveCaKernel::pi_bound_scalar = 0.0
+
*/
diff --git a/Examples/SimpleWaveCaKernel/src/RegisterMoL.cc b/Examples/SimpleWaveCaKernel/src/RegisterMoL.cc
index 3e35f8d..ac8c57b 100644
--- a/Examples/SimpleWaveCaKernel/src/RegisterMoL.cc
+++ b/Examples/SimpleWaveCaKernel/src/RegisterMoL.cc
@@ -12,6 +12,8 @@ extern "C" void SimpleWaveCaKernel_RegisterVars(CCTK_ARGUMENTS)
CCTK_INT ierr = 0;
/* Register all the evolved grid functions with MoL */
+ ierr += MoLRegisterEvolved(CCTK_VarIndex("SimpleWaveCaKernel::phi"), CCTK_VarIndex("SimpleWaveCaKernel::phirhs"));
+ ierr += MoLRegisterEvolved(CCTK_VarIndex("SimpleWaveCaKernel::pi"), CCTK_VarIndex("SimpleWaveCaKernel::pirhs"));
/* Register all the evolved Array functions with MoL */
return;
diff --git a/Examples/SimpleWaveCaKernel/src/calc_rhs.code b/Examples/SimpleWaveCaKernel/src/calc_rhs.code
new file mode 100644
index 0000000..f21f507
--- /dev/null
+++ b/Examples/SimpleWaveCaKernel/src/calc_rhs.code
@@ -0,0 +1,78 @@
+#include "GenericFD.h"
+#include "Differencing.h"
+
+#define CCTK_GFINDEX3D(u,i,j,k) I3D(u,i,j,k)
+
+CAKERNEL_calc_rhs_Begin_s
+
+ /* Declare finite differencing variables */
+
+ /* Include user-supplied include files */
+
+ /* Initialise finite differencing variables */
+ ptrdiff_t const di = 1;
+ ptrdiff_t const dj = CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
+ ptrdiff_t const dk = CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
+ ptrdiff_t const cdi = sizeof(CCTK_REAL) * di;
+ ptrdiff_t const cdj = sizeof(CCTK_REAL) * dj;
+ ptrdiff_t const cdk = sizeof(CCTK_REAL) * dk;
+ CCTK_REAL const dx = ToReal(CCTK_DELTA_SPACE(0));
+ CCTK_REAL const dy = ToReal(CCTK_DELTA_SPACE(1));
+ CCTK_REAL const dz = ToReal(CCTK_DELTA_SPACE(2));
+ CCTK_REAL const dt = ToReal(CCTK_DELTA_TIME);
+ CCTK_REAL const t = ToReal(cctk_time);
+ CCTK_REAL const dxi = INV(dx);
+ CCTK_REAL const dyi = INV(dy);
+ CCTK_REAL const dzi = INV(dz);
+ CCTK_REAL const khalf = 0.5;
+ CCTK_REAL const kthird = 1/3.0;
+ CCTK_REAL const ktwothird = 2.0/3.0;
+ CCTK_REAL const kfourthird = 4.0/3.0;
+ CCTK_REAL const keightthird = 8.0/3.0;
+ CCTK_REAL const hdxi = 0.5 * dxi;
+ CCTK_REAL const hdyi = 0.5 * dyi;
+ CCTK_REAL const hdzi = 0.5 * dzi;
+
+ /* Initialize predefined quantities */
+ CCTK_REAL const p1o2dx = 0.5*INV(dx);
+ CCTK_REAL const p1o2dy = 0.5*INV(dy);
+ CCTK_REAL const p1o2dz = 0.5*INV(dz);
+ CCTK_REAL const p1odx2 = INV(SQR(dx));
+ CCTK_REAL const p1ody2 = INV(SQR(dy));
+ CCTK_REAL const p1odz2 = INV(SQR(dz));
+
+ /* Assign local copies of arrays functions */
+
+
+
+ /* Calculate temporaries and arrays functions */
+
+ /* Copy local copies back to grid functions */
+ CAKERNEL_calc_rhs_Computations_Begin_s
+
+ /* Assign local copies of grid functions */
+
+ CCTK_REAL phiL = I3D(phi,0,0,0);
+ CCTK_REAL piL = I3D(pi,0,0,0);
+
+
+ /* Include user supplied include files */
+
+ /* Precompute derivatives */
+ CCTK_REAL const PDstandard2nd11phi = PDstandard2nd11(&phi[index]);
+ CCTK_REAL const PDstandard2nd22phi = PDstandard2nd22(&phi[index]);
+ CCTK_REAL const PDstandard2nd33phi = PDstandard2nd33(&phi[index]);
+
+ /* Calculate temporaries and grid functions */
+ CCTK_REAL phirhsL = piL;
+
+ CCTK_REAL pirhsL = PDstandard2nd11phi + PDstandard2nd22phi +
+ PDstandard2nd33phi;
+
+ /* Copy local copies back to grid functions */
+ I3D(phirhs,0,0,0) = phirhsL;
+ I3D(pirhs,0,0,0) = pirhsL;
+
+ CAKERNEL_calc_rhs_Computations_End_s
+
+CAKERNEL_calc_rhs_End_s
diff --git a/Examples/SimpleWaveCaKernel/src/initial_sine.code b/Examples/SimpleWaveCaKernel/src/initial_sine.code
index 41e6fcf..293d70a 100644
--- a/Examples/SimpleWaveCaKernel/src/initial_sine.code
+++ b/Examples/SimpleWaveCaKernel/src/initial_sine.code
@@ -1,11 +1,71 @@
+#include "GenericFD.h"
+#include "Differencing.h"
+
+#define CCTK_GFINDEX3D(u,i,j,k) I3D(u,i,j,k)
+
CAKERNEL_initial_sine_Begin_s
+
+ /* Declare finite differencing variables */
+
+ /* Include user-supplied include files */
+
+ /* Initialise finite differencing variables */
+ ptrdiff_t const di = 1;
+ ptrdiff_t const dj = CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
+ ptrdiff_t const dk = CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
+ ptrdiff_t const cdi = sizeof(CCTK_REAL) * di;
+ ptrdiff_t const cdj = sizeof(CCTK_REAL) * dj;
+ ptrdiff_t const cdk = sizeof(CCTK_REAL) * dk;
+ CCTK_REAL const dx = ToReal(CCTK_DELTA_SPACE(0));
+ CCTK_REAL const dy = ToReal(CCTK_DELTA_SPACE(1));
+ CCTK_REAL const dz = ToReal(CCTK_DELTA_SPACE(2));
+ CCTK_REAL const dt = ToReal(CCTK_DELTA_TIME);
+ CCTK_REAL const t = ToReal(cctk_time);
+ CCTK_REAL const dxi = INV(dx);
+ CCTK_REAL const dyi = INV(dy);
+ CCTK_REAL const dzi = INV(dz);
+ CCTK_REAL const khalf = 0.5;
+ CCTK_REAL const kthird = 1/3.0;
+ CCTK_REAL const ktwothird = 2.0/3.0;
+ CCTK_REAL const kfourthird = 4.0/3.0;
+ CCTK_REAL const keightthird = 8.0/3.0;
+ CCTK_REAL const hdxi = 0.5 * dxi;
+ CCTK_REAL const hdyi = 0.5 * dyi;
+ CCTK_REAL const hdzi = 0.5 * dzi;
+
+ /* Initialize predefined quantities */
+ CCTK_REAL const p1o2dx = 0.5*INV(dx);
+ CCTK_REAL const p1o2dy = 0.5*INV(dy);
+ CCTK_REAL const p1o2dz = 0.5*INV(dz);
+ CCTK_REAL const p1odx2 = INV(SQR(dx));
+ CCTK_REAL const p1ody2 = INV(SQR(dy));
+ CCTK_REAL const p1odz2 = INV(SQR(dz));
+
+ /* Assign local copies of arrays functions */
+
+
+
+ /* Calculate temporaries and arrays functions */
+
+ /* Copy local copies back to grid functions */
CAKERNEL_initial_sine_Computations_Begin_s
- // phi -> 0
- phi(0,0,0) = 0
- // pi -> 0
- pi(0,0,0) = 0
+ /* Assign local copies of grid functions */
+
+
+
+ /* Include user supplied include files */
+
+ /* Precompute derivatives */
+
+ /* Calculate temporaries and grid functions */
+ CCTK_REAL phiL = 0;
+
+ CCTK_REAL piL = 0;
+ /* Copy local copies back to grid functions */
+ I3D(phi,0,0,0) = phiL;
+ I3D(pi,0,0,0) = piL;
CAKERNEL_initial_sine_Computations_End_s
diff --git a/Examples/SimpleWaveCaKernel/src/rk1.code b/Examples/SimpleWaveCaKernel/src/rk1.code
new file mode 100644
index 0000000..ed4bb7a
--- /dev/null
+++ b/Examples/SimpleWaveCaKernel/src/rk1.code
@@ -0,0 +1,73 @@
+#include "GenericFD.h"
+#include "Differencing.h"
+
+#define CCTK_GFINDEX3D(u,i,j,k) I3D(u,i,j,k)
+
+CAKERNEL_rk1_Begin_s
+
+ /* Declare finite differencing variables */
+
+ /* Include user-supplied include files */
+
+ /* Initialise finite differencing variables */
+ ptrdiff_t const di = 1;
+ ptrdiff_t const dj = CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
+ ptrdiff_t const dk = CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
+ ptrdiff_t const cdi = sizeof(CCTK_REAL) * di;
+ ptrdiff_t const cdj = sizeof(CCTK_REAL) * dj;
+ ptrdiff_t const cdk = sizeof(CCTK_REAL) * dk;
+ CCTK_REAL const dx = ToReal(CCTK_DELTA_SPACE(0));
+ CCTK_REAL const dy = ToReal(CCTK_DELTA_SPACE(1));
+ CCTK_REAL const dz = ToReal(CCTK_DELTA_SPACE(2));
+ CCTK_REAL const dt = ToReal(CCTK_DELTA_TIME);
+ CCTK_REAL const t = ToReal(cctk_time);
+ CCTK_REAL const dxi = INV(dx);
+ CCTK_REAL const dyi = INV(dy);
+ CCTK_REAL const dzi = INV(dz);
+ CCTK_REAL const khalf = 0.5;
+ CCTK_REAL const kthird = 1/3.0;
+ CCTK_REAL const ktwothird = 2.0/3.0;
+ CCTK_REAL const kfourthird = 4.0/3.0;
+ CCTK_REAL const keightthird = 8.0/3.0;
+ CCTK_REAL const hdxi = 0.5 * dxi;
+ CCTK_REAL const hdyi = 0.5 * dyi;
+ CCTK_REAL const hdzi = 0.5 * dzi;
+
+ /* Initialize predefined quantities */
+ CCTK_REAL const p1o2dx = 0.5*INV(dx);
+ CCTK_REAL const p1o2dy = 0.5*INV(dy);
+ CCTK_REAL const p1o2dz = 0.5*INV(dz);
+ CCTK_REAL const p1odx2 = INV(SQR(dx));
+ CCTK_REAL const p1ody2 = INV(SQR(dy));
+ CCTK_REAL const p1odz2 = INV(SQR(dz));
+
+ /* Assign local copies of arrays functions */
+
+
+
+ /* Calculate temporaries and arrays functions */
+
+ /* Copy local copies back to grid functions */
+ CAKERNEL_rk1_Computations_Begin_s
+
+ /* Assign local copies of grid functions */
+
+ CCTK_REAL phiL = I3D(phi,0,0,0);
+ CCTK_REAL phirhsL = I3D(phirhs,0,0,0);
+ CCTK_REAL piL = I3D(pi,0,0,0);
+ CCTK_REAL pirhsL = I3D(pirhs,0,0,0);
+
+
+ /* Include user supplied include files */
+
+ /* Precompute derivatives */
+
+ /* Calculate temporaries and grid functions */
+ phiL = Rule(phiL + phirhsL*piL*dt,piL + pirhsL*dt);
+
+ /* Copy local copies back to grid functions */
+ I3D(phi,0,0,0) = phiL;
+
+ CAKERNEL_rk1_Computations_End_s
+
+CAKERNEL_rk1_End_s