diff options
Diffstat (limited to 'ML_WaveToyFO')
-rw-r--r-- | ML_WaveToyFO/configuration.ccl | 4 | ||||
-rw-r--r-- | ML_WaveToyFO/param.ccl | 6 | ||||
-rw-r--r-- | ML_WaveToyFO/schedule.ccl | 32 | ||||
-rw-r--r-- | ML_WaveToyFO/src/WTFO_Gaussian.cc | 20 | ||||
-rw-r--r-- | ML_WaveToyFO/src/WTFO_RHS.cc | 22 | ||||
-rw-r--r-- | ML_WaveToyFO/src/WTFO_constraints.cc | 19 | ||||
-rw-r--r-- | ML_WaveToyFO/src/make.code.defn | 2 |
7 files changed, 69 insertions, 36 deletions
diff --git a/ML_WaveToyFO/configuration.ccl b/ML_WaveToyFO/configuration.ccl index 8e2c3c5..0a66ec2 100644 --- a/ML_WaveToyFO/configuration.ccl +++ b/ML_WaveToyFO/configuration.ccl @@ -1,4 +1,6 @@ # File produced by Kranc REQUIRES GenericFD -REQUIRES LoopControl +OPTIONAL LoopControl +{ +} diff --git a/ML_WaveToyFO/param.ccl b/ML_WaveToyFO/param.ccl index 854aee9..5bfa8b8 100644 --- a/ML_WaveToyFO/param.ccl +++ b/ML_WaveToyFO/param.ccl @@ -41,6 +41,12 @@ CCTK_INT rhs_timelevels "Number of active RHS timelevels" STEERABLE=RECOVER } 1 restricted: +CCTK_INT other_timelevels "Number of active timelevels for non-evolved grid functions" STEERABLE=RECOVER +{ + 0:2 :: "" +} 1 + +restricted: CCTK_INT WTFO_Gaussian_calc_every "WTFO_Gaussian_calc_every" STEERABLE=ALWAYS { *:* :: "" diff --git a/ML_WaveToyFO/schedule.ccl b/ML_WaveToyFO/schedule.ccl index e8c9a3f..f294545 100644 --- a/ML_WaveToyFO/schedule.ccl +++ b/ML_WaveToyFO/schedule.ccl @@ -1,7 +1,10 @@ # File produced by Kranc -STORAGE: WT_w[1] +if (other_timelevels == 1) +{ + STORAGE: WT_w[1] +} if (timelevels == 1) { @@ -63,12 +66,6 @@ schedule ML_WaveToyFO_Startup at STARTUP OPTIONS: meta } "create banner" -schedule ML_WaveToyFO_RegisterVars in MoL_Register -{ - LANG: C - OPTIONS: meta -} "Register Variables for MoL" - schedule ML_WaveToyFO_RegisterSymmetries in SymmetryRegister { LANG: C @@ -78,11 +75,19 @@ schedule ML_WaveToyFO_RegisterSymmetries in SymmetryRegister schedule WTFO_Gaussian AT initial { LANG: C + WRITES: ML_WaveToyFO::WT_rho + WRITES: ML_WaveToyFO::WT_u + WRITES: ML_WaveToyFO::WT_v } "WTFO_Gaussian" schedule WTFO_RHS IN MoL_CalcRHS { LANG: C + READS: ML_WaveToyFO::WT_rho + READS: ML_WaveToyFO::WT_v + WRITES: ML_WaveToyFO::WT_rhorhs + WRITES: ML_WaveToyFO::WT_urhs + WRITES: ML_WaveToyFO::WT_vrhs } "WTFO_RHS" schedule WTFO_RHS AT analysis @@ -91,12 +96,19 @@ schedule WTFO_RHS AT analysis SYNC: WT_rhorhs SYNC: WT_urhs SYNC: WT_vrhs + READS: ML_WaveToyFO::WT_rho + READS: ML_WaveToyFO::WT_v + WRITES: ML_WaveToyFO::WT_rhorhs + WRITES: ML_WaveToyFO::WT_urhs + WRITES: ML_WaveToyFO::WT_vrhs } "WTFO_RHS" schedule WTFO_constraints AT analysis { LANG: C SYNC: WT_w + READS: ML_WaveToyFO::WT_v + WRITES: ML_WaveToyFO::WT_w } "WTFO_constraints" schedule ML_WaveToyFO_SelectBoundConds in MoL_PostStep @@ -114,6 +126,12 @@ schedule ML_WaveToyFO_CheckBoundaries at BASEGRID OPTIONS: meta } "check boundaries treatment" +schedule ML_WaveToyFO_RegisterVars in MoL_Register +{ + LANG: C + OPTIONS: meta +} "Register Variables for MoL" + schedule group ApplyBCs as ML_WaveToyFO_ApplyBCs in MoL_PostStep after ML_WaveToyFO_SelectBoundConds { # no language specified diff --git a/ML_WaveToyFO/src/WTFO_Gaussian.cc b/ML_WaveToyFO/src/WTFO_Gaussian.cc index 0320d22..560f59b 100644 --- a/ML_WaveToyFO/src/WTFO_Gaussian.cc +++ b/ML_WaveToyFO/src/WTFO_Gaussian.cc @@ -12,6 +12,7 @@ #include "cctk_Parameters.h" #include "GenericFD.h" #include "Differencing.h" +#include "cctk_Loop.h" #include "loopcontrol.h" /* Define macros used in calculations */ @@ -27,8 +28,6 @@ static void WTFO_Gaussian_Body(cGH const * restrict const cctkGH, int const dir, DECLARE_CCTK_PARAMETERS; - /* Declare finite differencing variables */ - /* Include user-supplied include files */ /* Initialise finite differencing variables */ @@ -59,9 +58,9 @@ static void WTFO_Gaussian_Body(cGH const * restrict const cctkGH, int const dir, CCTK_REAL const p1o12dx = 0.0833333333333333333333333333333*INV(dx); CCTK_REAL const p1o12dy = 0.0833333333333333333333333333333*INV(dy); CCTK_REAL const p1o12dz = 0.0833333333333333333333333333333*INV(dz); - CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx)*INV(dy); - CCTK_REAL const p1o144dxdz = 0.00694444444444444444444444444444*INV(dx)*INV(dz); - CCTK_REAL const p1o144dydz = 0.00694444444444444444444444444444*INV(dy)*INV(dz); + CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx*dy); + CCTK_REAL const p1o144dxdz = 0.00694444444444444444444444444444*INV(dx*dz); + CCTK_REAL const p1o144dydz = 0.00694444444444444444444444444444*INV(dy*dz); CCTK_REAL const pm1o12dx2 = -0.0833333333333333333333333333333*INV(SQR(dx)); CCTK_REAL const pm1o12dy2 = -0.0833333333333333333333333333333*INV(SQR(dy)); CCTK_REAL const pm1o12dz2 = -0.0833333333333333333333333333333*INV(SQR(dz)); @@ -76,7 +75,7 @@ static void WTFO_Gaussian_Body(cGH const * restrict const cctkGH, int const dir, /* Loop over the grid points */ #pragma omp parallel - LC_LOOP3 (WTFO_Gaussian, + CCTK_LOOP3(WTFO_Gaussian, i,j,k, imin[0],imin[1],imin[2], imax[0],imax[1],imax[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) { @@ -108,7 +107,7 @@ static void WTFO_Gaussian_Body(cGH const * restrict const cctkGH, int const dir, v2[index] = v2L; v3[index] = v3L; } - LC_ENDLOOP3 (WTFO_Gaussian); + CCTK_ENDLOOP3(WTFO_Gaussian); } extern "C" void WTFO_Gaussian(CCTK_ARGUMENTS) @@ -127,11 +126,14 @@ extern "C" void WTFO_Gaussian(CCTK_ARGUMENTS) return; } - const char *groups[] = {"ML_WaveToyFO::WT_rho","ML_WaveToyFO::WT_u","ML_WaveToyFO::WT_v"}; + const char *const groups[] = { + "ML_WaveToyFO::WT_rho", + "ML_WaveToyFO::WT_u", + "ML_WaveToyFO::WT_v"}; GenericFD_AssertGroupStorage(cctkGH, "WTFO_Gaussian", 3, groups); - GenericFD_LoopOverEverything(cctkGH, &WTFO_Gaussian_Body); + GenericFD_LoopOverEverything(cctkGH, WTFO_Gaussian_Body); if (verbose > 1) { diff --git a/ML_WaveToyFO/src/WTFO_RHS.cc b/ML_WaveToyFO/src/WTFO_RHS.cc index fb9af18..d197632 100644 --- a/ML_WaveToyFO/src/WTFO_RHS.cc +++ b/ML_WaveToyFO/src/WTFO_RHS.cc @@ -12,6 +12,7 @@ #include "cctk_Parameters.h" #include "GenericFD.h" #include "Differencing.h" +#include "cctk_Loop.h" #include "loopcontrol.h" /* Define macros used in calculations */ @@ -45,8 +46,6 @@ static void WTFO_RHS_Body(cGH const * restrict const cctkGH, int const dir, int DECLARE_CCTK_PARAMETERS; - /* Declare finite differencing variables */ - /* Include user-supplied include files */ /* Initialise finite differencing variables */ @@ -77,9 +76,9 @@ static void WTFO_RHS_Body(cGH const * restrict const cctkGH, int const dir, int CCTK_REAL const p1o12dx = 0.0833333333333333333333333333333*INV(dx); CCTK_REAL const p1o12dy = 0.0833333333333333333333333333333*INV(dy); CCTK_REAL const p1o12dz = 0.0833333333333333333333333333333*INV(dz); - CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx)*INV(dy); - CCTK_REAL const p1o144dxdz = 0.00694444444444444444444444444444*INV(dx)*INV(dz); - CCTK_REAL const p1o144dydz = 0.00694444444444444444444444444444*INV(dy)*INV(dz); + CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx*dy); + CCTK_REAL const p1o144dxdz = 0.00694444444444444444444444444444*INV(dx*dz); + CCTK_REAL const p1o144dydz = 0.00694444444444444444444444444444*INV(dy*dz); CCTK_REAL const pm1o12dx2 = -0.0833333333333333333333333333333*INV(SQR(dx)); CCTK_REAL const pm1o12dy2 = -0.0833333333333333333333333333333*INV(SQR(dy)); CCTK_REAL const pm1o12dz2 = -0.0833333333333333333333333333333*INV(SQR(dz)); @@ -94,7 +93,7 @@ static void WTFO_RHS_Body(cGH const * restrict const cctkGH, int const dir, int /* Loop over the grid points */ #pragma omp parallel - LC_LOOP3 (WTFO_RHS, + CCTK_LOOP3(WTFO_RHS, i,j,k, imin[0],imin[1],imin[2], imax[0],imax[1],imax[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) { @@ -137,7 +136,7 @@ static void WTFO_RHS_Body(cGH const * restrict const cctkGH, int const dir, int v2rhs[index] = v2rhsL; v3rhs[index] = v3rhsL; } - LC_ENDLOOP3 (WTFO_RHS); + CCTK_ENDLOOP3(WTFO_RHS); } extern "C" void WTFO_RHS(CCTK_ARGUMENTS) @@ -156,12 +155,17 @@ extern "C" void WTFO_RHS(CCTK_ARGUMENTS) return; } - const char *groups[] = {"ML_WaveToyFO::WT_rho","ML_WaveToyFO::WT_rhorhs","ML_WaveToyFO::WT_urhs","ML_WaveToyFO::WT_v","ML_WaveToyFO::WT_vrhs"}; + const char *const groups[] = { + "ML_WaveToyFO::WT_rho", + "ML_WaveToyFO::WT_rhorhs", + "ML_WaveToyFO::WT_urhs", + "ML_WaveToyFO::WT_v", + "ML_WaveToyFO::WT_vrhs"}; GenericFD_AssertGroupStorage(cctkGH, "WTFO_RHS", 5, groups); GenericFD_EnsureStencilFits(cctkGH, "WTFO_RHS", 2, 2, 2); - GenericFD_LoopOverInterior(cctkGH, &WTFO_RHS_Body); + GenericFD_LoopOverInterior(cctkGH, WTFO_RHS_Body); if (verbose > 1) { diff --git a/ML_WaveToyFO/src/WTFO_constraints.cc b/ML_WaveToyFO/src/WTFO_constraints.cc index 3c89dcd..fe58e77 100644 --- a/ML_WaveToyFO/src/WTFO_constraints.cc +++ b/ML_WaveToyFO/src/WTFO_constraints.cc @@ -12,6 +12,7 @@ #include "cctk_Parameters.h" #include "GenericFD.h" #include "Differencing.h" +#include "cctk_Loop.h" #include "loopcontrol.h" /* Define macros used in calculations */ @@ -39,8 +40,6 @@ static void WTFO_constraints_Body(cGH const * restrict const cctkGH, int const d DECLARE_CCTK_PARAMETERS; - /* Declare finite differencing variables */ - /* Include user-supplied include files */ /* Initialise finite differencing variables */ @@ -71,9 +70,9 @@ static void WTFO_constraints_Body(cGH const * restrict const cctkGH, int const d CCTK_REAL const p1o12dx = 0.0833333333333333333333333333333*INV(dx); CCTK_REAL const p1o12dy = 0.0833333333333333333333333333333*INV(dy); CCTK_REAL const p1o12dz = 0.0833333333333333333333333333333*INV(dz); - CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx)*INV(dy); - CCTK_REAL const p1o144dxdz = 0.00694444444444444444444444444444*INV(dx)*INV(dz); - CCTK_REAL const p1o144dydz = 0.00694444444444444444444444444444*INV(dy)*INV(dz); + CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx*dy); + CCTK_REAL const p1o144dxdz = 0.00694444444444444444444444444444*INV(dx*dz); + CCTK_REAL const p1o144dydz = 0.00694444444444444444444444444444*INV(dy*dz); CCTK_REAL const pm1o12dx2 = -0.0833333333333333333333333333333*INV(SQR(dx)); CCTK_REAL const pm1o12dy2 = -0.0833333333333333333333333333333*INV(SQR(dy)); CCTK_REAL const pm1o12dz2 = -0.0833333333333333333333333333333*INV(SQR(dz)); @@ -88,7 +87,7 @@ static void WTFO_constraints_Body(cGH const * restrict const cctkGH, int const d /* Loop over the grid points */ #pragma omp parallel - LC_LOOP3 (WTFO_constraints, + CCTK_LOOP3(WTFO_constraints, i,j,k, imin[0],imin[1],imin[2], imax[0],imax[1],imax[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) { @@ -123,7 +122,7 @@ static void WTFO_constraints_Body(cGH const * restrict const cctkGH, int const d w2[index] = w2L; w3[index] = w3L; } - LC_ENDLOOP3 (WTFO_constraints); + CCTK_ENDLOOP3(WTFO_constraints); } extern "C" void WTFO_constraints(CCTK_ARGUMENTS) @@ -142,12 +141,14 @@ extern "C" void WTFO_constraints(CCTK_ARGUMENTS) return; } - const char *groups[] = {"ML_WaveToyFO::WT_v","ML_WaveToyFO::WT_w"}; + const char *const groups[] = { + "ML_WaveToyFO::WT_v", + "ML_WaveToyFO::WT_w"}; GenericFD_AssertGroupStorage(cctkGH, "WTFO_constraints", 2, groups); GenericFD_EnsureStencilFits(cctkGH, "WTFO_constraints", 2, 2, 2); - GenericFD_LoopOverInterior(cctkGH, &WTFO_constraints_Body); + GenericFD_LoopOverInterior(cctkGH, WTFO_constraints_Body); if (verbose > 1) { diff --git a/ML_WaveToyFO/src/make.code.defn b/ML_WaveToyFO/src/make.code.defn index d60b8d6..1b30d1c 100644 --- a/ML_WaveToyFO/src/make.code.defn +++ b/ML_WaveToyFO/src/make.code.defn @@ -1,3 +1,3 @@ # File produced by Kranc -SRCS = Startup.cc RegisterMoL.cc RegisterSymmetries.cc WTFO_Gaussian.cc WTFO_RHS.cc WTFO_constraints.cc Boundaries.cc +SRCS = Startup.cc RegisterSymmetries.cc RegisterMoL.cc WTFO_Gaussian.cc WTFO_RHS.cc WTFO_constraints.cc Boundaries.cc |