aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Diener <diener@linux-hn3d.site>2010-02-01 16:19:19 -0600
committerPeter Diener <diener@linux-hn3d.site>2010-02-01 16:19:19 -0600
commit3f330d6e66c355da6c9dd6aa28a4e8641a49e552 (patch)
tree8782b4209be586e20f453414b63466d05edbed04
parent77f234967fbcc6344888c8ef5f84d42adf7d1078 (diff)
Make sure BetaDriver routines are scheduled appropriately.
Schedule BetaDriver setup routines in initial, postregrid and post_recover_variables. Signed-off-by: Peter Diener <diener@linux-hn3d.site>
-rw-r--r--ML_BSSN/param.ccl16
-rw-r--r--ML_BSSN/schedule.ccl13
-rw-r--r--ML_BSSN/src/ML_BSSN_Minkowski.c4
-rw-r--r--ML_BSSN/src/ML_BSSN_convertFromADMBase.c4
-rw-r--r--ML_BSSN/src/ML_BSSN_setBetaDriverConstant.c139
-rw-r--r--ML_BSSN/src/ML_BSSN_setBetaDriverSpatial.c (renamed from ML_BSSN/src/ML_BSSN_setBetaDriver.c)17
-rw-r--r--ML_BSSN/src/make.code.defn2
-rw-r--r--ML_BSSN_Helper/schedule.ccl11
-rw-r--r--ML_BSSN_Helper/src/SetGroupTags.c1
-rw-r--r--ML_BSSN_M/param.ccl16
-rw-r--r--ML_BSSN_M/schedule.ccl13
-rw-r--r--ML_BSSN_M/src/ML_BSSN_M_Minkowski.c4
-rw-r--r--ML_BSSN_M/src/ML_BSSN_M_convertFromADMBase.c4
-rw-r--r--ML_BSSN_M/src/ML_BSSN_M_setBetaDriverConstant.c139
-rw-r--r--ML_BSSN_M/src/ML_BSSN_M_setBetaDriverSpatial.c (renamed from ML_BSSN_M/src/ML_BSSN_M_setBetaDriver.c)17
-rw-r--r--ML_BSSN_M/src/make.code.defn2
-rw-r--r--ML_BSSN_MP/param.ccl16
-rw-r--r--ML_BSSN_MP/schedule.ccl13
-rw-r--r--ML_BSSN_MP/src/ML_BSSN_MP_Minkowski.c4
-rw-r--r--ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBase.c4
-rw-r--r--ML_BSSN_MP/src/ML_BSSN_MP_setBetaDriverConstant.c139
-rw-r--r--ML_BSSN_MP/src/ML_BSSN_MP_setBetaDriverSpatial.c (renamed from ML_BSSN_MP/src/ML_BSSN_MP_setBetaDriver.c)17
-rw-r--r--ML_BSSN_MP/src/make.code.defn2
-rw-r--r--ML_BSSN_MP_Helper/schedule.ccl11
-rw-r--r--ML_BSSN_MP_Helper/src/SetGroupTags.c1
-rw-r--r--ML_BSSN_M_Helper/schedule.ccl11
-rw-r--r--ML_BSSN_M_Helper/src/SetGroupTags.c1
-rw-r--r--m/McLachlan_BSSN.m29
-rw-r--r--m/prototype/ML_BSSN_Helper/schedule.ccl11
-rw-r--r--m/prototype/ML_BSSN_Helper/src/SetGroupTags.c1
30 files changed, 586 insertions, 76 deletions
diff --git a/ML_BSSN/param.ccl b/ML_BSSN/param.ccl
index 8e791df..2d06d8b 100644
--- a/ML_BSSN/param.ccl
+++ b/ML_BSSN/param.ccl
@@ -213,7 +213,13 @@ CCTK_INT ML_BSSN_convertFromADMBaseGamma_calc_every "ML_BSSN_convertFromADMBaseG
} 1
restricted:
-CCTK_INT ML_BSSN_setBetaDriver_calc_every "ML_BSSN_setBetaDriver_calc_every"
+CCTK_INT ML_BSSN_setBetaDriverSpatial_calc_every "ML_BSSN_setBetaDriverSpatial_calc_every"
+{
+ *:* :: ""
+} 1
+
+restricted:
+CCTK_INT ML_BSSN_setBetaDriverConstant_calc_every "ML_BSSN_setBetaDriverConstant_calc_every"
{
*:* :: ""
} 1
@@ -303,7 +309,13 @@ CCTK_INT ML_BSSN_convertFromADMBaseGamma_calc_offset "ML_BSSN_convertFromADMBase
} 0
restricted:
-CCTK_INT ML_BSSN_setBetaDriver_calc_offset "ML_BSSN_setBetaDriver_calc_offset"
+CCTK_INT ML_BSSN_setBetaDriverSpatial_calc_offset "ML_BSSN_setBetaDriverSpatial_calc_offset"
+{
+ *:* :: ""
+} 0
+
+restricted:
+CCTK_INT ML_BSSN_setBetaDriverConstant_calc_offset "ML_BSSN_setBetaDriverConstant_calc_offset"
{
*:* :: ""
} 0
diff --git a/ML_BSSN/schedule.ccl b/ML_BSSN/schedule.ccl
index f8a7f3b..1380de4 100644
--- a/ML_BSSN/schedule.ccl
+++ b/ML_BSSN/schedule.ccl
@@ -370,10 +370,19 @@ if (CCTK_EQUALS(my_initial_data, "ADMBase"))
if (CCTK_EQUALS(UseSpatialBetaDriver, "yes"))
{
- schedule ML_BSSN_setBetaDriver AT initial AFTER ADMBase_PostInitial AFTER ML_BSSN_convertFromADMBase
+ schedule ML_BSSN_setBetaDriverSpatial IN ML_BSSN_init_eta
{
LANG: C
- } "ML_BSSN_setBetaDriver"
+ } "ML_BSSN_setBetaDriverSpatial"
+}
+
+
+if (CCTK_EQUALS(UseSpatialBetaDriver, "no"))
+{
+ schedule ML_BSSN_setBetaDriverConstant IN ML_BSSN_init_eta
+ {
+ LANG: C
+ } "ML_BSSN_setBetaDriverConstant"
}
schedule ML_BSSN_RHS IN ML_BSSN_evolCalcGroup
diff --git a/ML_BSSN/src/ML_BSSN_Minkowski.c b/ML_BSSN/src/ML_BSSN_Minkowski.c
index 759310a..28229b7 100644
--- a/ML_BSSN/src/ML_BSSN_Minkowski.c
+++ b/ML_BSSN/src/ML_BSSN_Minkowski.c
@@ -108,7 +108,6 @@ void ML_BSSN_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_I
CCTK_REAL At11L = INITVALUE, At12L = INITVALUE, At13L = INITVALUE, At22L = INITVALUE, At23L = INITVALUE, At33L = INITVALUE;
CCTK_REAL B1L = INITVALUE, B2L = INITVALUE, B3L = INITVALUE;
CCTK_REAL beta1L = INITVALUE, beta2L = INITVALUE, beta3L = INITVALUE;
- CCTK_REAL etaL = INITVALUE;
CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE;
CCTK_REAL phiL = INITVALUE;
CCTK_REAL trKL = INITVALUE;
@@ -178,8 +177,6 @@ void ML_BSSN_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_I
B3L = 0;
- etaL = BetaDriver;
-
/* Copy local copies back to grid functions */
A[index] = AL;
@@ -196,7 +193,6 @@ void ML_BSSN_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_I
beta1[index] = beta1L;
beta2[index] = beta2L;
beta3[index] = beta3L;
- eta[index] = etaL;
gt11[index] = gt11L;
gt12[index] = gt12L;
gt13[index] = gt13L;
diff --git a/ML_BSSN/src/ML_BSSN_convertFromADMBase.c b/ML_BSSN/src/ML_BSSN_convertFromADMBase.c
index 3d5e687..90cd41c 100644
--- a/ML_BSSN/src/ML_BSSN_convertFromADMBase.c
+++ b/ML_BSSN/src/ML_BSSN_convertFromADMBase.c
@@ -115,7 +115,6 @@ void ML_BSSN_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const di
CCTK_REAL betaxL = INITVALUE;
CCTK_REAL betayL = INITVALUE;
CCTK_REAL betazL = INITVALUE;
- CCTK_REAL etaL = INITVALUE;
CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE;
CCTK_REAL gxxL = INITVALUE;
CCTK_REAL gxyL = INITVALUE;
@@ -240,8 +239,6 @@ void ML_BSSN_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const di
beta3L = betazL;
- etaL = BetaDriver;
-
/* Copy local copies back to grid functions */
alpha[index] = alphaL;
@@ -254,7 +251,6 @@ void ML_BSSN_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const di
beta1[index] = beta1L;
beta2[index] = beta2L;
beta3[index] = beta3L;
- eta[index] = etaL;
gt11[index] = gt11L;
gt12[index] = gt12L;
gt13[index] = gt13L;
diff --git a/ML_BSSN/src/ML_BSSN_setBetaDriverConstant.c b/ML_BSSN/src/ML_BSSN_setBetaDriverConstant.c
new file mode 100644
index 0000000..3ae34af
--- /dev/null
+++ b/ML_BSSN/src/ML_BSSN_setBetaDriverConstant.c
@@ -0,0 +1,139 @@
+/* File produced by Kranc */
+
+#define KRANC_C
+
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+#include "GenericFD.h"
+#include "Differencing.h"
+#include "loopcontrol.h"
+
+/* Define macros used in calculations */
+#define INITVALUE (42)
+#define INV(x) ((1.0) / (x))
+#define SQR(x) ((x) * (x))
+#define CUB(x) ((x) * (x) * (x))
+#define QAD(x) ((x) * (x) * (x) * (x))
+
+void ML_BSSN_setBetaDriverConstant_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[])
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+
+ /* Declare finite differencing variables */
+ CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE;
+ CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE;
+ CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE;
+ CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE;
+
+
+ /* Declare predefined quantities */
+ CCTK_REAL p1o12dx = INITVALUE;
+ CCTK_REAL p1o12dy = INITVALUE;
+ CCTK_REAL p1o12dz = INITVALUE;
+ CCTK_REAL p1o144dxdy = INITVALUE;
+ CCTK_REAL p1o144dxdz = INITVALUE;
+ CCTK_REAL p1o144dydz = INITVALUE;
+ CCTK_REAL p1odx = INITVALUE;
+ CCTK_REAL p1ody = INITVALUE;
+ CCTK_REAL p1odz = INITVALUE;
+ CCTK_REAL pm1o12dx2 = INITVALUE;
+ CCTK_REAL pm1o12dy2 = INITVALUE;
+ CCTK_REAL pm1o12dz2 = INITVALUE;
+
+ if (verbose > 1)
+ {
+ CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_setBetaDriverConstant_Body");
+ }
+
+ if (cctk_iteration % ML_BSSN_setBetaDriverConstant_calc_every != ML_BSSN_setBetaDriverConstant_calc_offset)
+ {
+ return;
+ }
+
+ /* Include user-supplied include files */
+
+ /* Initialise finite differencing variables */
+ dx = CCTK_DELTA_SPACE(0);
+ dy = CCTK_DELTA_SPACE(1);
+ dz = CCTK_DELTA_SPACE(2);
+ dxi = 1.0 / dx;
+ dyi = 1.0 / dy;
+ dzi = 1.0 / dz;
+ khalf = 0.5;
+ kthird = 1/3.0;
+ ktwothird = 2.0/3.0;
+ kfourthird = 4.0/3.0;
+ keightthird = 8.0/3.0;
+ hdxi = 0.5 * dxi;
+ hdyi = 0.5 * dyi;
+ hdzi = 0.5 * dzi;
+
+ /* Initialize predefined quantities */
+ p1o12dx = INV(dx)/12.;
+ p1o12dy = INV(dy)/12.;
+ p1o12dz = INV(dz)/12.;
+ p1o144dxdy = (INV(dx)*INV(dy))/144.;
+ p1o144dxdz = (INV(dx)*INV(dz))/144.;
+ p1o144dydz = (INV(dy)*INV(dz))/144.;
+ p1odx = INV(dx);
+ p1ody = INV(dy);
+ p1odz = INV(dz);
+ pm1o12dx2 = -pow(dx,-2)/12.;
+ pm1o12dy2 = -pow(dy,-2)/12.;
+ pm1o12dz2 = -pow(dz,-2)/12.;
+
+ /* Loop over the grid points */
+ #pragma omp parallel
+ LC_LOOP3 (ML_BSSN_setBetaDriverConstant,
+ i,j,k, min[0],min[1],min[2], max[0],max[1],max[2],
+ cctk_lsh[0],cctk_lsh[1],cctk_lsh[2])
+ {
+ int index = INITVALUE;
+ int subblock_index = INITVALUE;
+ index = CCTK_GFINDEX3D(cctkGH,i,j,k);
+ subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2]));
+
+ /* Declare shorthands */
+
+ /* Declare local copies of grid functions */
+ CCTK_REAL etaL = INITVALUE;
+ /* Declare precomputed derivatives*/
+
+ /* Declare derivatives */
+
+ /* Assign local copies of grid functions */
+
+ /* Assign local copies of subblock grid functions */
+
+ /* Include user supplied include files */
+
+ /* Precompute derivatives (new style) */
+
+ /* Precompute derivatives (old style) */
+
+ /* Calculate temporaries and grid functions */
+ etaL = BetaDriver;
+
+
+ /* Copy local copies back to grid functions */
+ eta[index] = etaL;
+
+ /* Copy local copies back to subblock grid functions */
+ }
+ LC_ENDLOOP3 (ML_BSSN_setBetaDriverConstant);
+}
+
+void ML_BSSN_setBetaDriverConstant(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_setBetaDriverConstant_Body);
+}
diff --git a/ML_BSSN/src/ML_BSSN_setBetaDriver.c b/ML_BSSN/src/ML_BSSN_setBetaDriverSpatial.c
index 04a369a..0762043 100644
--- a/ML_BSSN/src/ML_BSSN_setBetaDriver.c
+++ b/ML_BSSN/src/ML_BSSN_setBetaDriverSpatial.c
@@ -20,7 +20,7 @@
#define CUB(x) ((x) * (x) * (x))
#define QAD(x) ((x) * (x) * (x) * (x))
-void ML_BSSN_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[])
+void ML_BSSN_setBetaDriverSpatial_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[])
{
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
@@ -49,10 +49,10 @@ void ML_BSSN_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir, CC
if (verbose > 1)
{
- CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_setBetaDriver_Body");
+ CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_setBetaDriverSpatial_Body");
}
- if (cctk_iteration % ML_BSSN_setBetaDriver_calc_every != ML_BSSN_setBetaDriver_calc_offset)
+ if (cctk_iteration % ML_BSSN_setBetaDriverSpatial_calc_every != ML_BSSN_setBetaDriverSpatial_calc_offset)
{
return;
}
@@ -91,7 +91,7 @@ void ML_BSSN_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir, CC
/* Loop over the grid points */
#pragma omp parallel
- LC_LOOP3 (ML_BSSN_setBetaDriver,
+ LC_LOOP3 (ML_BSSN_setBetaDriverSpatial,
i,j,k, min[0],min[1],min[2], max[0],max[1],max[2],
cctk_lsh[0],cctk_lsh[1],cctk_lsh[2])
{
@@ -110,7 +110,6 @@ void ML_BSSN_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir, CC
/* Declare derivatives */
/* Assign local copies of grid functions */
- etaL = eta[index];
rL = r[index];
/* Assign local copies of subblock grid functions */
@@ -122,7 +121,7 @@ void ML_BSSN_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir, CC
/* Precompute derivatives (old style) */
/* Calculate temporaries and grid functions */
- etaL = etaL*IfThen(rL > SpatialBetaDriverRadius,SpatialBetaDriverRadius*INV(rL),1);
+ etaL = BetaDriver*IfThen(rL > SpatialBetaDriverRadius,SpatialBetaDriverRadius*INV(rL),1);
/* Copy local copies back to grid functions */
@@ -130,13 +129,13 @@ void ML_BSSN_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir, CC
/* Copy local copies back to subblock grid functions */
}
- LC_ENDLOOP3 (ML_BSSN_setBetaDriver);
+ LC_ENDLOOP3 (ML_BSSN_setBetaDriverSpatial);
}
-void ML_BSSN_setBetaDriver(CCTK_ARGUMENTS)
+void ML_BSSN_setBetaDriverSpatial(CCTK_ARGUMENTS)
{
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
- GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_setBetaDriver_Body);
+ GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_setBetaDriverSpatial_Body);
}
diff --git a/ML_BSSN/src/make.code.defn b/ML_BSSN/src/make.code.defn
index 461adc2..a1538e8 100644
--- a/ML_BSSN/src/make.code.defn
+++ b/ML_BSSN/src/make.code.defn
@@ -1,3 +1,3 @@
# File produced by Kranc
-SRCS = Startup.c RegisterMoL.c RegisterSymmetries.c ML_BSSN_Minkowski.c ML_BSSN_convertFromADMBase.c ML_BSSN_convertFromADMBaseGamma.c ML_BSSN_setBetaDriver.c ML_BSSN_RHS.c ML_BSSN_RHSStaticBoundary.c ML_BSSN_RHSRadiativeBoundary.c ML_BSSN_enforce.c ML_BSSN_boundary.c ML_BSSN_convertToADMBase.c ML_BSSN_convertToADMBaseDtLapseShift.c ML_BSSN_convertToADMBaseDtLapseShiftBoundary.c ML_BSSN_convertToADMBaseFakeDtLapseShift.c ML_BSSN_constraints.c ML_BSSN_constraints_boundary.c Boundaries.c
+SRCS = Startup.c RegisterMoL.c RegisterSymmetries.c ML_BSSN_Minkowski.c ML_BSSN_convertFromADMBase.c ML_BSSN_convertFromADMBaseGamma.c ML_BSSN_setBetaDriverSpatial.c ML_BSSN_setBetaDriverConstant.c ML_BSSN_RHS.c ML_BSSN_RHSStaticBoundary.c ML_BSSN_RHSRadiativeBoundary.c ML_BSSN_enforce.c ML_BSSN_boundary.c ML_BSSN_convertToADMBase.c ML_BSSN_convertToADMBaseDtLapseShift.c ML_BSSN_convertToADMBaseDtLapseShiftBoundary.c ML_BSSN_convertToADMBaseFakeDtLapseShift.c ML_BSSN_constraints.c ML_BSSN_constraints_boundary.c Boundaries.c
diff --git a/ML_BSSN_Helper/schedule.ccl b/ML_BSSN_Helper/schedule.ccl
index 447b2cd..2e32335 100644
--- a/ML_BSSN_Helper/schedule.ccl
+++ b/ML_BSSN_Helper/schedule.ccl
@@ -162,4 +162,15 @@ if (CCTK_EQUALS (evolution_method, "ML_BSSN")) {
TRIGGERS: ML_BSSN::ML_mom
} "Calculate BSSN constraints"
+ SCHEDULE GROUP ML_BSSN_init_eta AT initial
+ {
+ } "Initialize BetaDriver"
+
+ SCHEDULE GROUP ML_BSSN_init_eta AT postregrid
+ {
+ } "Initialize BetaDriver"
+
+ SCHEDULE GROUP ML_BSSN_init_eta AT post_recover_variables
+ {
+ } "Initialize BetaDriver"
}
diff --git a/ML_BSSN_Helper/src/SetGroupTags.c b/ML_BSSN_Helper/src/SetGroupTags.c
index a3f20a7..4a70b50 100644
--- a/ML_BSSN_Helper/src/SetGroupTags.c
+++ b/ML_BSSN_Helper/src/SetGroupTags.c
@@ -26,6 +26,7 @@ ML_BSSN_SetGroupTags (void)
set_group_tags (0, 0, "ML_BSSN::ML_Ham");
set_group_tags (0, 0, "ML_BSSN::ML_mom");
set_group_tags (0, 0, "ML_BSSN::ML_curvrhs");
+ set_group_tags (0, 0, "ML_BSSN::ML_BetaDriver");
int const checkpoint = rhs_timelevels > 1;
set_group_tags (checkpoint, 0, "ML_BSSN::ML_dtlapserhs");
diff --git a/ML_BSSN_M/param.ccl b/ML_BSSN_M/param.ccl
index 219cf0b..588df7b 100644
--- a/ML_BSSN_M/param.ccl
+++ b/ML_BSSN_M/param.ccl
@@ -213,7 +213,13 @@ CCTK_INT ML_BSSN_M_convertFromADMBaseGamma_calc_every "ML_BSSN_M_convertFromADMB
} 1
restricted:
-CCTK_INT ML_BSSN_M_setBetaDriver_calc_every "ML_BSSN_M_setBetaDriver_calc_every"
+CCTK_INT ML_BSSN_M_setBetaDriverSpatial_calc_every "ML_BSSN_M_setBetaDriverSpatial_calc_every"
+{
+ *:* :: ""
+} 1
+
+restricted:
+CCTK_INT ML_BSSN_M_setBetaDriverConstant_calc_every "ML_BSSN_M_setBetaDriverConstant_calc_every"
{
*:* :: ""
} 1
@@ -303,7 +309,13 @@ CCTK_INT ML_BSSN_M_convertFromADMBaseGamma_calc_offset "ML_BSSN_M_convertFromADM
} 0
restricted:
-CCTK_INT ML_BSSN_M_setBetaDriver_calc_offset "ML_BSSN_M_setBetaDriver_calc_offset"
+CCTK_INT ML_BSSN_M_setBetaDriverSpatial_calc_offset "ML_BSSN_M_setBetaDriverSpatial_calc_offset"
+{
+ *:* :: ""
+} 0
+
+restricted:
+CCTK_INT ML_BSSN_M_setBetaDriverConstant_calc_offset "ML_BSSN_M_setBetaDriverConstant_calc_offset"
{
*:* :: ""
} 0
diff --git a/ML_BSSN_M/schedule.ccl b/ML_BSSN_M/schedule.ccl
index 6ce5bdf..41cd90a 100644
--- a/ML_BSSN_M/schedule.ccl
+++ b/ML_BSSN_M/schedule.ccl
@@ -370,10 +370,19 @@ if (CCTK_EQUALS(my_initial_data, "ADMBase"))
if (CCTK_EQUALS(UseSpatialBetaDriver, "yes"))
{
- schedule ML_BSSN_M_setBetaDriver AT initial AFTER ADMBase_PostInitial AFTER ML_BSSN_M_convertFromADMBase
+ schedule ML_BSSN_M_setBetaDriverSpatial IN ML_BSSN_M_init_eta
{
LANG: C
- } "ML_BSSN_M_setBetaDriver"
+ } "ML_BSSN_M_setBetaDriverSpatial"
+}
+
+
+if (CCTK_EQUALS(UseSpatialBetaDriver, "no"))
+{
+ schedule ML_BSSN_M_setBetaDriverConstant IN ML_BSSN_M_init_eta
+ {
+ LANG: C
+ } "ML_BSSN_M_setBetaDriverConstant"
}
schedule ML_BSSN_M_RHS IN ML_BSSN_M_evolCalcGroup
diff --git a/ML_BSSN_M/src/ML_BSSN_M_Minkowski.c b/ML_BSSN_M/src/ML_BSSN_M_Minkowski.c
index 4574716..a4163e4 100644
--- a/ML_BSSN_M/src/ML_BSSN_M_Minkowski.c
+++ b/ML_BSSN_M/src/ML_BSSN_M_Minkowski.c
@@ -108,7 +108,6 @@ void ML_BSSN_M_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK
CCTK_REAL At11L = INITVALUE, At12L = INITVALUE, At13L = INITVALUE, At22L = INITVALUE, At23L = INITVALUE, At33L = INITVALUE;
CCTK_REAL B1L = INITVALUE, B2L = INITVALUE, B3L = INITVALUE;
CCTK_REAL beta1L = INITVALUE, beta2L = INITVALUE, beta3L = INITVALUE;
- CCTK_REAL etaL = INITVALUE;
CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE;
CCTK_REAL phiL = INITVALUE;
CCTK_REAL trKL = INITVALUE;
@@ -178,8 +177,6 @@ void ML_BSSN_M_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK
B3L = 0;
- etaL = BetaDriver;
-
/* Copy local copies back to grid functions */
A[index] = AL;
@@ -196,7 +193,6 @@ void ML_BSSN_M_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK
beta1[index] = beta1L;
beta2[index] = beta2L;
beta3[index] = beta3L;
- eta[index] = etaL;
gt11[index] = gt11L;
gt12[index] = gt12L;
gt13[index] = gt13L;
diff --git a/ML_BSSN_M/src/ML_BSSN_M_convertFromADMBase.c b/ML_BSSN_M/src/ML_BSSN_M_convertFromADMBase.c
index 774e2ce..5033a9c 100644
--- a/ML_BSSN_M/src/ML_BSSN_M_convertFromADMBase.c
+++ b/ML_BSSN_M/src/ML_BSSN_M_convertFromADMBase.c
@@ -115,7 +115,6 @@ void ML_BSSN_M_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const
CCTK_REAL betaxL = INITVALUE;
CCTK_REAL betayL = INITVALUE;
CCTK_REAL betazL = INITVALUE;
- CCTK_REAL etaL = INITVALUE;
CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE;
CCTK_REAL gxxL = INITVALUE;
CCTK_REAL gxyL = INITVALUE;
@@ -240,8 +239,6 @@ void ML_BSSN_M_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const
beta3L = betazL;
- etaL = BetaDriver;
-
/* Copy local copies back to grid functions */
alpha[index] = alphaL;
@@ -254,7 +251,6 @@ void ML_BSSN_M_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const
beta1[index] = beta1L;
beta2[index] = beta2L;
beta3[index] = beta3L;
- eta[index] = etaL;
gt11[index] = gt11L;
gt12[index] = gt12L;
gt13[index] = gt13L;
diff --git a/ML_BSSN_M/src/ML_BSSN_M_setBetaDriverConstant.c b/ML_BSSN_M/src/ML_BSSN_M_setBetaDriverConstant.c
new file mode 100644
index 0000000..9310476
--- /dev/null
+++ b/ML_BSSN_M/src/ML_BSSN_M_setBetaDriverConstant.c
@@ -0,0 +1,139 @@
+/* File produced by Kranc */
+
+#define KRANC_C
+
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+#include "GenericFD.h"
+#include "Differencing.h"
+#include "loopcontrol.h"
+
+/* Define macros used in calculations */
+#define INITVALUE (42)
+#define INV(x) ((1.0) / (x))
+#define SQR(x) ((x) * (x))
+#define CUB(x) ((x) * (x) * (x))
+#define QAD(x) ((x) * (x) * (x) * (x))
+
+void ML_BSSN_M_setBetaDriverConstant_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[])
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+
+ /* Declare finite differencing variables */
+ CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE;
+ CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE;
+ CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE;
+ CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE;
+
+
+ /* Declare predefined quantities */
+ CCTK_REAL p1o12dx = INITVALUE;
+ CCTK_REAL p1o12dy = INITVALUE;
+ CCTK_REAL p1o12dz = INITVALUE;
+ CCTK_REAL p1o144dxdy = INITVALUE;
+ CCTK_REAL p1o144dxdz = INITVALUE;
+ CCTK_REAL p1o144dydz = INITVALUE;
+ CCTK_REAL p1odx = INITVALUE;
+ CCTK_REAL p1ody = INITVALUE;
+ CCTK_REAL p1odz = INITVALUE;
+ CCTK_REAL pm1o12dx2 = INITVALUE;
+ CCTK_REAL pm1o12dy2 = INITVALUE;
+ CCTK_REAL pm1o12dz2 = INITVALUE;
+
+ if (verbose > 1)
+ {
+ CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_M_setBetaDriverConstant_Body");
+ }
+
+ if (cctk_iteration % ML_BSSN_M_setBetaDriverConstant_calc_every != ML_BSSN_M_setBetaDriverConstant_calc_offset)
+ {
+ return;
+ }
+
+ /* Include user-supplied include files */
+
+ /* Initialise finite differencing variables */
+ dx = CCTK_DELTA_SPACE(0);
+ dy = CCTK_DELTA_SPACE(1);
+ dz = CCTK_DELTA_SPACE(2);
+ dxi = 1.0 / dx;
+ dyi = 1.0 / dy;
+ dzi = 1.0 / dz;
+ khalf = 0.5;
+ kthird = 1/3.0;
+ ktwothird = 2.0/3.0;
+ kfourthird = 4.0/3.0;
+ keightthird = 8.0/3.0;
+ hdxi = 0.5 * dxi;
+ hdyi = 0.5 * dyi;
+ hdzi = 0.5 * dzi;
+
+ /* Initialize predefined quantities */
+ p1o12dx = INV(dx)/12.;
+ p1o12dy = INV(dy)/12.;
+ p1o12dz = INV(dz)/12.;
+ p1o144dxdy = (INV(dx)*INV(dy))/144.;
+ p1o144dxdz = (INV(dx)*INV(dz))/144.;
+ p1o144dydz = (INV(dy)*INV(dz))/144.;
+ p1odx = INV(dx);
+ p1ody = INV(dy);
+ p1odz = INV(dz);
+ pm1o12dx2 = -pow(dx,-2)/12.;
+ pm1o12dy2 = -pow(dy,-2)/12.;
+ pm1o12dz2 = -pow(dz,-2)/12.;
+
+ /* Loop over the grid points */
+ #pragma omp parallel
+ LC_LOOP3 (ML_BSSN_M_setBetaDriverConstant,
+ i,j,k, min[0],min[1],min[2], max[0],max[1],max[2],
+ cctk_lsh[0],cctk_lsh[1],cctk_lsh[2])
+ {
+ int index = INITVALUE;
+ int subblock_index = INITVALUE;
+ index = CCTK_GFINDEX3D(cctkGH,i,j,k);
+ subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2]));
+
+ /* Declare shorthands */
+
+ /* Declare local copies of grid functions */
+ CCTK_REAL etaL = INITVALUE;
+ /* Declare precomputed derivatives*/
+
+ /* Declare derivatives */
+
+ /* Assign local copies of grid functions */
+
+ /* Assign local copies of subblock grid functions */
+
+ /* Include user supplied include files */
+
+ /* Precompute derivatives (new style) */
+
+ /* Precompute derivatives (old style) */
+
+ /* Calculate temporaries and grid functions */
+ etaL = BetaDriver;
+
+
+ /* Copy local copies back to grid functions */
+ eta[index] = etaL;
+
+ /* Copy local copies back to subblock grid functions */
+ }
+ LC_ENDLOOP3 (ML_BSSN_M_setBetaDriverConstant);
+}
+
+void ML_BSSN_M_setBetaDriverConstant(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_M_setBetaDriverConstant_Body);
+}
diff --git a/ML_BSSN_M/src/ML_BSSN_M_setBetaDriver.c b/ML_BSSN_M/src/ML_BSSN_M_setBetaDriverSpatial.c
index 2f57166..afc6635 100644
--- a/ML_BSSN_M/src/ML_BSSN_M_setBetaDriver.c
+++ b/ML_BSSN_M/src/ML_BSSN_M_setBetaDriverSpatial.c
@@ -20,7 +20,7 @@
#define CUB(x) ((x) * (x) * (x))
#define QAD(x) ((x) * (x) * (x) * (x))
-void ML_BSSN_M_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[])
+void ML_BSSN_M_setBetaDriverSpatial_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[])
{
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
@@ -49,10 +49,10 @@ void ML_BSSN_M_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir,
if (verbose > 1)
{
- CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_M_setBetaDriver_Body");
+ CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_M_setBetaDriverSpatial_Body");
}
- if (cctk_iteration % ML_BSSN_M_setBetaDriver_calc_every != ML_BSSN_M_setBetaDriver_calc_offset)
+ if (cctk_iteration % ML_BSSN_M_setBetaDriverSpatial_calc_every != ML_BSSN_M_setBetaDriverSpatial_calc_offset)
{
return;
}
@@ -91,7 +91,7 @@ void ML_BSSN_M_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir,
/* Loop over the grid points */
#pragma omp parallel
- LC_LOOP3 (ML_BSSN_M_setBetaDriver,
+ LC_LOOP3 (ML_BSSN_M_setBetaDriverSpatial,
i,j,k, min[0],min[1],min[2], max[0],max[1],max[2],
cctk_lsh[0],cctk_lsh[1],cctk_lsh[2])
{
@@ -110,7 +110,6 @@ void ML_BSSN_M_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir,
/* Declare derivatives */
/* Assign local copies of grid functions */
- etaL = eta[index];
rL = r[index];
/* Assign local copies of subblock grid functions */
@@ -122,7 +121,7 @@ void ML_BSSN_M_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir,
/* Precompute derivatives (old style) */
/* Calculate temporaries and grid functions */
- etaL = etaL*IfThen(rL > SpatialBetaDriverRadius,SpatialBetaDriverRadius*INV(rL),1);
+ etaL = BetaDriver*IfThen(rL > SpatialBetaDriverRadius,SpatialBetaDriverRadius*INV(rL),1);
/* Copy local copies back to grid functions */
@@ -130,13 +129,13 @@ void ML_BSSN_M_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir,
/* Copy local copies back to subblock grid functions */
}
- LC_ENDLOOP3 (ML_BSSN_M_setBetaDriver);
+ LC_ENDLOOP3 (ML_BSSN_M_setBetaDriverSpatial);
}
-void ML_BSSN_M_setBetaDriver(CCTK_ARGUMENTS)
+void ML_BSSN_M_setBetaDriverSpatial(CCTK_ARGUMENTS)
{
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
- GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_M_setBetaDriver_Body);
+ GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_M_setBetaDriverSpatial_Body);
}
diff --git a/ML_BSSN_M/src/make.code.defn b/ML_BSSN_M/src/make.code.defn
index 06bf056..2c89d2a 100644
--- a/ML_BSSN_M/src/make.code.defn
+++ b/ML_BSSN_M/src/make.code.defn
@@ -1,3 +1,3 @@
# File produced by Kranc
-SRCS = Startup.c RegisterMoL.c RegisterSymmetries.c ML_BSSN_M_Minkowski.c ML_BSSN_M_convertFromADMBase.c ML_BSSN_M_convertFromADMBaseGamma.c ML_BSSN_M_setBetaDriver.c ML_BSSN_M_RHS.c ML_BSSN_M_RHSStaticBoundary.c ML_BSSN_M_RHSRadiativeBoundary.c ML_BSSN_M_enforce.c ML_BSSN_M_boundary.c ML_BSSN_M_convertToADMBase.c ML_BSSN_M_convertToADMBaseDtLapseShift.c ML_BSSN_M_convertToADMBaseDtLapseShiftBoundary.c ML_BSSN_M_convertToADMBaseFakeDtLapseShift.c ML_BSSN_M_constraints.c ML_BSSN_M_constraints_boundary.c Boundaries.c
+SRCS = Startup.c RegisterMoL.c RegisterSymmetries.c ML_BSSN_M_Minkowski.c ML_BSSN_M_convertFromADMBase.c ML_BSSN_M_convertFromADMBaseGamma.c ML_BSSN_M_setBetaDriverSpatial.c ML_BSSN_M_setBetaDriverConstant.c ML_BSSN_M_RHS.c ML_BSSN_M_RHSStaticBoundary.c ML_BSSN_M_RHSRadiativeBoundary.c ML_BSSN_M_enforce.c ML_BSSN_M_boundary.c ML_BSSN_M_convertToADMBase.c ML_BSSN_M_convertToADMBaseDtLapseShift.c ML_BSSN_M_convertToADMBaseDtLapseShiftBoundary.c ML_BSSN_M_convertToADMBaseFakeDtLapseShift.c ML_BSSN_M_constraints.c ML_BSSN_M_constraints_boundary.c Boundaries.c
diff --git a/ML_BSSN_MP/param.ccl b/ML_BSSN_MP/param.ccl
index 23ac896..5726b4c 100644
--- a/ML_BSSN_MP/param.ccl
+++ b/ML_BSSN_MP/param.ccl
@@ -213,7 +213,13 @@ CCTK_INT ML_BSSN_MP_convertFromADMBaseGamma_calc_every "ML_BSSN_MP_convertFromAD
} 1
restricted:
-CCTK_INT ML_BSSN_MP_setBetaDriver_calc_every "ML_BSSN_MP_setBetaDriver_calc_every"
+CCTK_INT ML_BSSN_MP_setBetaDriverSpatial_calc_every "ML_BSSN_MP_setBetaDriverSpatial_calc_every"
+{
+ *:* :: ""
+} 1
+
+restricted:
+CCTK_INT ML_BSSN_MP_setBetaDriverConstant_calc_every "ML_BSSN_MP_setBetaDriverConstant_calc_every"
{
*:* :: ""
} 1
@@ -303,7 +309,13 @@ CCTK_INT ML_BSSN_MP_convertFromADMBaseGamma_calc_offset "ML_BSSN_MP_convertFromA
} 0
restricted:
-CCTK_INT ML_BSSN_MP_setBetaDriver_calc_offset "ML_BSSN_MP_setBetaDriver_calc_offset"
+CCTK_INT ML_BSSN_MP_setBetaDriverSpatial_calc_offset "ML_BSSN_MP_setBetaDriverSpatial_calc_offset"
+{
+ *:* :: ""
+} 0
+
+restricted:
+CCTK_INT ML_BSSN_MP_setBetaDriverConstant_calc_offset "ML_BSSN_MP_setBetaDriverConstant_calc_offset"
{
*:* :: ""
} 0
diff --git a/ML_BSSN_MP/schedule.ccl b/ML_BSSN_MP/schedule.ccl
index 737f61f..bb44a4d 100644
--- a/ML_BSSN_MP/schedule.ccl
+++ b/ML_BSSN_MP/schedule.ccl
@@ -370,10 +370,19 @@ if (CCTK_EQUALS(my_initial_data, "ADMBase"))
if (CCTK_EQUALS(UseSpatialBetaDriver, "yes"))
{
- schedule ML_BSSN_MP_setBetaDriver AT initial AFTER ADMBase_PostInitial AFTER ML_BSSN_MP_convertFromADMBase
+ schedule ML_BSSN_MP_setBetaDriverSpatial IN ML_BSSN_MP_init_eta
{
LANG: C
- } "ML_BSSN_MP_setBetaDriver"
+ } "ML_BSSN_MP_setBetaDriverSpatial"
+}
+
+
+if (CCTK_EQUALS(UseSpatialBetaDriver, "no"))
+{
+ schedule ML_BSSN_MP_setBetaDriverConstant IN ML_BSSN_MP_init_eta
+ {
+ LANG: C
+ } "ML_BSSN_MP_setBetaDriverConstant"
}
schedule ML_BSSN_MP_RHS IN ML_BSSN_MP_evolCalcGroup
diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_Minkowski.c b/ML_BSSN_MP/src/ML_BSSN_MP_Minkowski.c
index 8874902..277ef96 100644
--- a/ML_BSSN_MP/src/ML_BSSN_MP_Minkowski.c
+++ b/ML_BSSN_MP/src/ML_BSSN_MP_Minkowski.c
@@ -108,7 +108,6 @@ void ML_BSSN_MP_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCT
CCTK_REAL At11L = INITVALUE, At12L = INITVALUE, At13L = INITVALUE, At22L = INITVALUE, At23L = INITVALUE, At33L = INITVALUE;
CCTK_REAL B1L = INITVALUE, B2L = INITVALUE, B3L = INITVALUE;
CCTK_REAL beta1L = INITVALUE, beta2L = INITVALUE, beta3L = INITVALUE;
- CCTK_REAL etaL = INITVALUE;
CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE;
CCTK_REAL phiL = INITVALUE;
CCTK_REAL trKL = INITVALUE;
@@ -178,8 +177,6 @@ void ML_BSSN_MP_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCT
B3L = 0;
- etaL = BetaDriver;
-
/* Copy local copies back to grid functions */
A[index] = AL;
@@ -196,7 +193,6 @@ void ML_BSSN_MP_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCT
beta1[index] = beta1L;
beta2[index] = beta2L;
beta3[index] = beta3L;
- eta[index] = etaL;
gt11[index] = gt11L;
gt12[index] = gt12L;
gt13[index] = gt13L;
diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBase.c b/ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBase.c
index d64668c..0ed9bfd 100644
--- a/ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBase.c
+++ b/ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBase.c
@@ -115,7 +115,6 @@ void ML_BSSN_MP_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const
CCTK_REAL betaxL = INITVALUE;
CCTK_REAL betayL = INITVALUE;
CCTK_REAL betazL = INITVALUE;
- CCTK_REAL etaL = INITVALUE;
CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE;
CCTK_REAL gxxL = INITVALUE;
CCTK_REAL gxyL = INITVALUE;
@@ -240,8 +239,6 @@ void ML_BSSN_MP_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const
beta3L = betazL;
- etaL = BetaDriver;
-
/* Copy local copies back to grid functions */
alpha[index] = alphaL;
@@ -254,7 +251,6 @@ void ML_BSSN_MP_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const
beta1[index] = beta1L;
beta2[index] = beta2L;
beta3[index] = beta3L;
- eta[index] = etaL;
gt11[index] = gt11L;
gt12[index] = gt12L;
gt13[index] = gt13L;
diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_setBetaDriverConstant.c b/ML_BSSN_MP/src/ML_BSSN_MP_setBetaDriverConstant.c
new file mode 100644
index 0000000..9df10d2
--- /dev/null
+++ b/ML_BSSN_MP/src/ML_BSSN_MP_setBetaDriverConstant.c
@@ -0,0 +1,139 @@
+/* File produced by Kranc */
+
+#define KRANC_C
+
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+#include "GenericFD.h"
+#include "Differencing.h"
+#include "loopcontrol.h"
+
+/* Define macros used in calculations */
+#define INITVALUE (42)
+#define INV(x) ((1.0) / (x))
+#define SQR(x) ((x) * (x))
+#define CUB(x) ((x) * (x) * (x))
+#define QAD(x) ((x) * (x) * (x) * (x))
+
+void ML_BSSN_MP_setBetaDriverConstant_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[])
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+
+ /* Declare finite differencing variables */
+ CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE;
+ CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE;
+ CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE;
+ CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE;
+
+
+ /* Declare predefined quantities */
+ CCTK_REAL p1o12dx = INITVALUE;
+ CCTK_REAL p1o12dy = INITVALUE;
+ CCTK_REAL p1o12dz = INITVALUE;
+ CCTK_REAL p1o144dxdy = INITVALUE;
+ CCTK_REAL p1o144dxdz = INITVALUE;
+ CCTK_REAL p1o144dydz = INITVALUE;
+ CCTK_REAL p1odx = INITVALUE;
+ CCTK_REAL p1ody = INITVALUE;
+ CCTK_REAL p1odz = INITVALUE;
+ CCTK_REAL pm1o12dx2 = INITVALUE;
+ CCTK_REAL pm1o12dy2 = INITVALUE;
+ CCTK_REAL pm1o12dz2 = INITVALUE;
+
+ if (verbose > 1)
+ {
+ CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_setBetaDriverConstant_Body");
+ }
+
+ if (cctk_iteration % ML_BSSN_MP_setBetaDriverConstant_calc_every != ML_BSSN_MP_setBetaDriverConstant_calc_offset)
+ {
+ return;
+ }
+
+ /* Include user-supplied include files */
+
+ /* Initialise finite differencing variables */
+ dx = CCTK_DELTA_SPACE(0);
+ dy = CCTK_DELTA_SPACE(1);
+ dz = CCTK_DELTA_SPACE(2);
+ dxi = 1.0 / dx;
+ dyi = 1.0 / dy;
+ dzi = 1.0 / dz;
+ khalf = 0.5;
+ kthird = 1/3.0;
+ ktwothird = 2.0/3.0;
+ kfourthird = 4.0/3.0;
+ keightthird = 8.0/3.0;
+ hdxi = 0.5 * dxi;
+ hdyi = 0.5 * dyi;
+ hdzi = 0.5 * dzi;
+
+ /* Initialize predefined quantities */
+ p1o12dx = INV(dx)/12.;
+ p1o12dy = INV(dy)/12.;
+ p1o12dz = INV(dz)/12.;
+ p1o144dxdy = (INV(dx)*INV(dy))/144.;
+ p1o144dxdz = (INV(dx)*INV(dz))/144.;
+ p1o144dydz = (INV(dy)*INV(dz))/144.;
+ p1odx = INV(dx);
+ p1ody = INV(dy);
+ p1odz = INV(dz);
+ pm1o12dx2 = -pow(dx,-2)/12.;
+ pm1o12dy2 = -pow(dy,-2)/12.;
+ pm1o12dz2 = -pow(dz,-2)/12.;
+
+ /* Loop over the grid points */
+ #pragma omp parallel
+ LC_LOOP3 (ML_BSSN_MP_setBetaDriverConstant,
+ i,j,k, min[0],min[1],min[2], max[0],max[1],max[2],
+ cctk_lsh[0],cctk_lsh[1],cctk_lsh[2])
+ {
+ int index = INITVALUE;
+ int subblock_index = INITVALUE;
+ index = CCTK_GFINDEX3D(cctkGH,i,j,k);
+ subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2]));
+
+ /* Declare shorthands */
+
+ /* Declare local copies of grid functions */
+ CCTK_REAL etaL = INITVALUE;
+ /* Declare precomputed derivatives*/
+
+ /* Declare derivatives */
+
+ /* Assign local copies of grid functions */
+
+ /* Assign local copies of subblock grid functions */
+
+ /* Include user supplied include files */
+
+ /* Precompute derivatives (new style) */
+
+ /* Precompute derivatives (old style) */
+
+ /* Calculate temporaries and grid functions */
+ etaL = BetaDriver;
+
+
+ /* Copy local copies back to grid functions */
+ eta[index] = etaL;
+
+ /* Copy local copies back to subblock grid functions */
+ }
+ LC_ENDLOOP3 (ML_BSSN_MP_setBetaDriverConstant);
+}
+
+void ML_BSSN_MP_setBetaDriverConstant(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_MP_setBetaDriverConstant_Body);
+}
diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_setBetaDriver.c b/ML_BSSN_MP/src/ML_BSSN_MP_setBetaDriverSpatial.c
index bc24ee7..4fef857 100644
--- a/ML_BSSN_MP/src/ML_BSSN_MP_setBetaDriver.c
+++ b/ML_BSSN_MP/src/ML_BSSN_MP_setBetaDriverSpatial.c
@@ -20,7 +20,7 @@
#define CUB(x) ((x) * (x) * (x))
#define QAD(x) ((x) * (x) * (x) * (x))
-void ML_BSSN_MP_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[])
+void ML_BSSN_MP_setBetaDriverSpatial_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[])
{
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
@@ -49,10 +49,10 @@ void ML_BSSN_MP_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir,
if (verbose > 1)
{
- CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_setBetaDriver_Body");
+ CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_setBetaDriverSpatial_Body");
}
- if (cctk_iteration % ML_BSSN_MP_setBetaDriver_calc_every != ML_BSSN_MP_setBetaDriver_calc_offset)
+ if (cctk_iteration % ML_BSSN_MP_setBetaDriverSpatial_calc_every != ML_BSSN_MP_setBetaDriverSpatial_calc_offset)
{
return;
}
@@ -91,7 +91,7 @@ void ML_BSSN_MP_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir,
/* Loop over the grid points */
#pragma omp parallel
- LC_LOOP3 (ML_BSSN_MP_setBetaDriver,
+ LC_LOOP3 (ML_BSSN_MP_setBetaDriverSpatial,
i,j,k, min[0],min[1],min[2], max[0],max[1],max[2],
cctk_lsh[0],cctk_lsh[1],cctk_lsh[2])
{
@@ -110,7 +110,6 @@ void ML_BSSN_MP_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir,
/* Declare derivatives */
/* Assign local copies of grid functions */
- etaL = eta[index];
rL = r[index];
/* Assign local copies of subblock grid functions */
@@ -122,7 +121,7 @@ void ML_BSSN_MP_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir,
/* Precompute derivatives (old style) */
/* Calculate temporaries and grid functions */
- etaL = etaL*IfThen(rL > SpatialBetaDriverRadius,SpatialBetaDriverRadius*INV(rL),1);
+ etaL = BetaDriver*IfThen(rL > SpatialBetaDriverRadius,SpatialBetaDriverRadius*INV(rL),1);
/* Copy local copies back to grid functions */
@@ -130,13 +129,13 @@ void ML_BSSN_MP_setBetaDriver_Body(cGH const * const cctkGH, CCTK_INT const dir,
/* Copy local copies back to subblock grid functions */
}
- LC_ENDLOOP3 (ML_BSSN_MP_setBetaDriver);
+ LC_ENDLOOP3 (ML_BSSN_MP_setBetaDriverSpatial);
}
-void ML_BSSN_MP_setBetaDriver(CCTK_ARGUMENTS)
+void ML_BSSN_MP_setBetaDriverSpatial(CCTK_ARGUMENTS)
{
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
- GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_MP_setBetaDriver_Body);
+ GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_MP_setBetaDriverSpatial_Body);
}
diff --git a/ML_BSSN_MP/src/make.code.defn b/ML_BSSN_MP/src/make.code.defn
index ed62c1a..3ac22c7 100644
--- a/ML_BSSN_MP/src/make.code.defn
+++ b/ML_BSSN_MP/src/make.code.defn
@@ -1,3 +1,3 @@
# File produced by Kranc
-SRCS = Startup.c RegisterMoL.c RegisterSymmetries.c ML_BSSN_MP_Minkowski.c ML_BSSN_MP_convertFromADMBase.c ML_BSSN_MP_convertFromADMBaseGamma.c ML_BSSN_MP_setBetaDriver.c ML_BSSN_MP_RHS.c ML_BSSN_MP_RHSStaticBoundary.c ML_BSSN_MP_RHSRadiativeBoundary.c ML_BSSN_MP_enforce.c ML_BSSN_MP_boundary.c ML_BSSN_MP_convertToADMBase.c ML_BSSN_MP_convertToADMBaseDtLapseShift.c ML_BSSN_MP_convertToADMBaseDtLapseShiftBoundary.c ML_BSSN_MP_convertToADMBaseFakeDtLapseShift.c ML_BSSN_MP_constraints.c ML_BSSN_MP_constraints_boundary.c Boundaries.c
+SRCS = Startup.c RegisterMoL.c RegisterSymmetries.c ML_BSSN_MP_Minkowski.c ML_BSSN_MP_convertFromADMBase.c ML_BSSN_MP_convertFromADMBaseGamma.c ML_BSSN_MP_setBetaDriverSpatial.c ML_BSSN_MP_setBetaDriverConstant.c ML_BSSN_MP_RHS.c ML_BSSN_MP_RHSStaticBoundary.c ML_BSSN_MP_RHSRadiativeBoundary.c ML_BSSN_MP_enforce.c ML_BSSN_MP_boundary.c ML_BSSN_MP_convertToADMBase.c ML_BSSN_MP_convertToADMBaseDtLapseShift.c ML_BSSN_MP_convertToADMBaseDtLapseShiftBoundary.c ML_BSSN_MP_convertToADMBaseFakeDtLapseShift.c ML_BSSN_MP_constraints.c ML_BSSN_MP_constraints_boundary.c Boundaries.c
diff --git a/ML_BSSN_MP_Helper/schedule.ccl b/ML_BSSN_MP_Helper/schedule.ccl
index 0d44d8d..795177b 100644
--- a/ML_BSSN_MP_Helper/schedule.ccl
+++ b/ML_BSSN_MP_Helper/schedule.ccl
@@ -162,4 +162,15 @@ if (CCTK_EQUALS (evolution_method, "ML_BSSN_MP")) {
TRIGGERS: ML_BSSN_MP::ML_mom
} "Calculate BSSN constraints"
+ SCHEDULE GROUP ML_BSSN_MP_init_eta AT initial
+ {
+ } "Initialize BetaDriver"
+
+ SCHEDULE GROUP ML_BSSN_MP_init_eta AT postregrid
+ {
+ } "Initialize BetaDriver"
+
+ SCHEDULE GROUP ML_BSSN_MP_init_eta AT post_recover_variables
+ {
+ } "Initialize BetaDriver"
}
diff --git a/ML_BSSN_MP_Helper/src/SetGroupTags.c b/ML_BSSN_MP_Helper/src/SetGroupTags.c
index 8411824..ef1532b 100644
--- a/ML_BSSN_MP_Helper/src/SetGroupTags.c
+++ b/ML_BSSN_MP_Helper/src/SetGroupTags.c
@@ -26,6 +26,7 @@ ML_BSSN_MP_SetGroupTags (void)
set_group_tags (0, 0, "ML_BSSN_MP::ML_Ham");
set_group_tags (0, 0, "ML_BSSN_MP::ML_mom");
set_group_tags (0, 0, "ML_BSSN_MP::ML_curvrhs");
+ set_group_tags (0, 0, "ML_BSSN_MP::ML_BetaDriver");
int const checkpoint = rhs_timelevels > 1;
set_group_tags (checkpoint, 0, "ML_BSSN_MP::ML_dtlapserhs");
diff --git a/ML_BSSN_M_Helper/schedule.ccl b/ML_BSSN_M_Helper/schedule.ccl
index ee7adac..d9675b8 100644
--- a/ML_BSSN_M_Helper/schedule.ccl
+++ b/ML_BSSN_M_Helper/schedule.ccl
@@ -162,4 +162,15 @@ if (CCTK_EQUALS (evolution_method, "ML_BSSN_M")) {
TRIGGERS: ML_BSSN_M::ML_mom
} "Calculate BSSN constraints"
+ SCHEDULE GROUP ML_BSSN_M_init_eta AT initial
+ {
+ } "Initialize BetaDriver"
+
+ SCHEDULE GROUP ML_BSSN_M_init_eta AT postregrid
+ {
+ } "Initialize BetaDriver"
+
+ SCHEDULE GROUP ML_BSSN_M_init_eta AT post_recover_variables
+ {
+ } "Initialize BetaDriver"
}
diff --git a/ML_BSSN_M_Helper/src/SetGroupTags.c b/ML_BSSN_M_Helper/src/SetGroupTags.c
index db16c77..79e02fb 100644
--- a/ML_BSSN_M_Helper/src/SetGroupTags.c
+++ b/ML_BSSN_M_Helper/src/SetGroupTags.c
@@ -26,6 +26,7 @@ ML_BSSN_M_SetGroupTags (void)
set_group_tags (0, 0, "ML_BSSN_M::ML_Ham");
set_group_tags (0, 0, "ML_BSSN_M::ML_mom");
set_group_tags (0, 0, "ML_BSSN_M::ML_curvrhs");
+ set_group_tags (0, 0, "ML_BSSN_M::ML_BetaDriver");
int const checkpoint = rhs_timelevels > 1;
set_group_tags (checkpoint, 0, "ML_BSSN_M::ML_dtlapserhs");
diff --git a/m/McLachlan_BSSN.m b/m/McLachlan_BSSN.m
index c18cd88..f361657 100644
--- a/m/McLachlan_BSSN.m
+++ b/m/McLachlan_BSSN.m
@@ -264,8 +264,7 @@ initialCalc =
alpha -> 1,
A -> 0,
beta[ua] -> 0,
- B[ua] -> 0,
- eta -> BetaDriver
+ B[ua] -> 0
}
};
@@ -323,9 +322,7 @@ convertFromADMBaseCalc =
beta1 -> betax,
beta2 -> betay,
- beta3 -> betaz,
-
- eta -> BetaDriver
+ beta3 -> betaz
}
};
@@ -360,14 +357,25 @@ convertFromADMBaseGammaCalc =
}
};
-setBetaDriverCalc =
+setBetaDriverSpatialCalc =
{
- Name -> BSSN <> "_setBetaDriver",
- Schedule -> {"AT initial AFTER ADMBase_PostInitial AFTER " <> BSSN <> "_convertFromADMBase"},
+ Name -> BSSN <> "_setBetaDriverSpatial",
+ Schedule -> {"IN "<> BSSN <> "_init_eta"},
ConditionalOnKeyword -> {"UseSpatialBetaDriver", "yes"},
Equations ->
{
- eta -> eta IfThen[r>SpatialBetaDriverRadius,SpatialBetaDriverRadius/r,1]
+ eta -> BetaDriver IfThen[r>SpatialBetaDriverRadius,SpatialBetaDriverRadius/r,1]
+ }
+};
+
+setBetaDriverConstantCalc =
+{
+ Name -> BSSN <> "_setBetaDriverConstant",
+ Schedule -> {"IN "<> BSSN <> "_init_eta"},
+ ConditionalOnKeyword -> {"UseSpatialBetaDriver", "no"},
+ Equations ->
+ {
+ eta -> BetaDriver
}
};
@@ -1048,7 +1056,8 @@ calculations =
initialCalc,
convertFromADMBaseCalc,
convertFromADMBaseGammaCalc,
- setBetaDriverCalc,
+ setBetaDriverSpatialCalc,
+ setBetaDriverConstantCalc,
evolCalc,
RHSStaticBoundaryCalc,
RHSRadiativeBoundaryCalc,
diff --git a/m/prototype/ML_BSSN_Helper/schedule.ccl b/m/prototype/ML_BSSN_Helper/schedule.ccl
index 447b2cd..2e32335 100644
--- a/m/prototype/ML_BSSN_Helper/schedule.ccl
+++ b/m/prototype/ML_BSSN_Helper/schedule.ccl
@@ -162,4 +162,15 @@ if (CCTK_EQUALS (evolution_method, "ML_BSSN")) {
TRIGGERS: ML_BSSN::ML_mom
} "Calculate BSSN constraints"
+ SCHEDULE GROUP ML_BSSN_init_eta AT initial
+ {
+ } "Initialize BetaDriver"
+
+ SCHEDULE GROUP ML_BSSN_init_eta AT postregrid
+ {
+ } "Initialize BetaDriver"
+
+ SCHEDULE GROUP ML_BSSN_init_eta AT post_recover_variables
+ {
+ } "Initialize BetaDriver"
}
diff --git a/m/prototype/ML_BSSN_Helper/src/SetGroupTags.c b/m/prototype/ML_BSSN_Helper/src/SetGroupTags.c
index a3f20a7..4a70b50 100644
--- a/m/prototype/ML_BSSN_Helper/src/SetGroupTags.c
+++ b/m/prototype/ML_BSSN_Helper/src/SetGroupTags.c
@@ -26,6 +26,7 @@ ML_BSSN_SetGroupTags (void)
set_group_tags (0, 0, "ML_BSSN::ML_Ham");
set_group_tags (0, 0, "ML_BSSN::ML_mom");
set_group_tags (0, 0, "ML_BSSN::ML_curvrhs");
+ set_group_tags (0, 0, "ML_BSSN::ML_BetaDriver");
int const checkpoint = rhs_timelevels > 1;
set_group_tags (checkpoint, 0, "ML_BSSN::ML_dtlapserhs");