diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-11-14 19:53:02 +0100 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-11-14 19:53:02 +0100 |
commit | cda73baf0fbca06d75e51ad28ed708d7a087a849 (patch) | |
tree | 4fac3164d827c0713877954ac0730f166714a5ad /Examples/Laplace/src | |
parent | 72b0c57fbcbbc71f55464dfdf751dbdb0b45fcb8 (diff) |
Regenerate examples
Diffstat (limited to 'Examples/Laplace/src')
-rw-r--r-- | Examples/Laplace/src/Laplace_boundary.cc | 23 | ||||
-rw-r--r-- | Examples/Laplace/src/Laplace_initial.cc | 26 | ||||
-rw-r--r-- | Examples/Laplace/src/Laplace_initial_boundary.cc | 26 | ||||
-rw-r--r-- | Examples/Laplace/src/Laplace_relax.cc | 24 | ||||
-rw-r--r-- | Examples/Laplace/src/make.code.defn | 2 |
5 files changed, 50 insertions, 51 deletions
diff --git a/Examples/Laplace/src/Laplace_boundary.cc b/Examples/Laplace/src/Laplace_boundary.cc index 1c8ee2d..ffec3ce 100644 --- a/Examples/Laplace/src/Laplace_boundary.cc +++ b/Examples/Laplace/src/Laplace_boundary.cc @@ -17,10 +17,10 @@ /* Define macros used in calculations */ #define INITVALUE (42) -#define QAD(x) (SQR(SQR(x))) -#define INV(x) ((1.0) / (x)) +#define INV(x) ((CCTK_REAL)1.0 / (x)) #define SQR(x) ((x) * (x)) -#define CUB(x) ((x) * (x) * (x)) +#define CUB(x) ((x) * SQR(x)) +#define QAD(x) (SQR(SQR(x))) extern "C" void Laplace_boundary_SelectBCs(CCTK_ARGUMENTS) { @@ -40,8 +40,6 @@ static void Laplace_boundary_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 */ @@ -72,10 +70,10 @@ static void Laplace_boundary_Body(cGH const * restrict const cctkGH, int const d CCTK_REAL const p1o1 = 1; CCTK_REAL const p1o12dx = 0.0833333333333333333333333333333*INV(dx); CCTK_REAL const p1o12dy = 0.0833333333333333333333333333333*INV(dy); - CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx)*INV(dy); + CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx*dy); CCTK_REAL const p1o2dx = 0.5*INV(dx); CCTK_REAL const p1o2dy = 0.5*INV(dy); - CCTK_REAL const p1o4dxdy = 0.25*INV(dx)*INV(dy); + CCTK_REAL const p1o4dxdy = 0.25*INV(dx*dy); CCTK_REAL const p1odx2 = INV(SQR(dx)); CCTK_REAL const p1ody2 = INV(SQR(dy)); CCTK_REAL const pm1o12dx2 = -0.0833333333333333333333333333333*INV(SQR(dx)); @@ -91,9 +89,9 @@ static void Laplace_boundary_Body(cGH const * restrict const cctkGH, int const d /* Loop over the grid points */ #pragma omp parallel - CCTK_LOOP3 (Laplace_boundary, + CCTK_LOOP3(Laplace_boundary, i,j,k, imin[0],imin[1],imin[2], imax[0],imax[1],imax[2], - cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + cctk_ash[0],cctk_ash[1],cctk_ash[2]) { ptrdiff_t const index = di*i + dj*j + dk*k; @@ -120,7 +118,7 @@ static void Laplace_boundary_Body(cGH const * restrict const cctkGH, int const d /* Copy local copies back to grid functions */ phirhs[index] = phirhsL; } - CCTK_ENDLOOP3 (Laplace_boundary); + CCTK_ENDLOOP3(Laplace_boundary); } extern "C" void Laplace_boundary(CCTK_ARGUMENTS) @@ -139,7 +137,8 @@ extern "C" void Laplace_boundary(CCTK_ARGUMENTS) return; } - const char *groups[] = {"Laplace::phi_grouprhs"}; + const char *const groups[] = { + "Laplace::phi_grouprhs"}; GenericFD_AssertGroupStorage(cctkGH, "Laplace_boundary", 1, groups); switch(fdOrder) @@ -151,7 +150,7 @@ extern "C" void Laplace_boundary(CCTK_ARGUMENTS) break; } - GenericFD_LoopOverBoundary(cctkGH, &Laplace_boundary_Body); + GenericFD_LoopOverBoundary(cctkGH, Laplace_boundary_Body); if (verbose > 1) { diff --git a/Examples/Laplace/src/Laplace_initial.cc b/Examples/Laplace/src/Laplace_initial.cc index f334d59..0e31009 100644 --- a/Examples/Laplace/src/Laplace_initial.cc +++ b/Examples/Laplace/src/Laplace_initial.cc @@ -17,10 +17,10 @@ /* Define macros used in calculations */ #define INITVALUE (42) -#define QAD(x) (SQR(SQR(x))) -#define INV(x) ((1.0) / (x)) +#define INV(x) ((CCTK_REAL)1.0 / (x)) #define SQR(x) ((x) * (x)) -#define CUB(x) ((x) * (x) * (x)) +#define CUB(x) ((x) * SQR(x)) +#define QAD(x) (SQR(SQR(x))) extern "C" void Laplace_initial_SelectBCs(CCTK_ARGUMENTS) { @@ -40,8 +40,6 @@ static void Laplace_initial_Body(cGH const * restrict const cctkGH, int const di DECLARE_CCTK_PARAMETERS; - /* Declare finite differencing variables */ - /* Include user-supplied include files */ /* Initialise finite differencing variables */ @@ -72,10 +70,10 @@ static void Laplace_initial_Body(cGH const * restrict const cctkGH, int const di CCTK_REAL const p1o1 = 1; CCTK_REAL const p1o12dx = 0.0833333333333333333333333333333*INV(dx); CCTK_REAL const p1o12dy = 0.0833333333333333333333333333333*INV(dy); - CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx)*INV(dy); + CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx*dy); CCTK_REAL const p1o2dx = 0.5*INV(dx); CCTK_REAL const p1o2dy = 0.5*INV(dy); - CCTK_REAL const p1o4dxdy = 0.25*INV(dx)*INV(dy); + CCTK_REAL const p1o4dxdy = 0.25*INV(dx*dy); CCTK_REAL const p1odx2 = INV(SQR(dx)); CCTK_REAL const p1ody2 = INV(SQR(dy)); CCTK_REAL const pm1o12dx2 = -0.0833333333333333333333333333333*INV(SQR(dx)); @@ -91,9 +89,9 @@ static void Laplace_initial_Body(cGH const * restrict const cctkGH, int const di /* Loop over the grid points */ #pragma omp parallel - CCTK_LOOP3 (Laplace_initial, + CCTK_LOOP3(Laplace_initial, i,j,k, imin[0],imin[1],imin[2], imax[0],imax[1],imax[2], - cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + cctk_ash[0],cctk_ash[1],cctk_ash[2]) { ptrdiff_t const index = di*i + dj*j + dk*k; @@ -118,12 +116,12 @@ static void Laplace_initial_Body(cGH const * restrict const cctkGH, int const di /* Calculate temporaries and grid functions */ CCTK_REAL phiL = - 4*Csch(Pi*INV(ToReal(Lx))*ToReal(Ly))*INV(Pi)*Sin(xL*Pi*INV(ToReal(Lx)))*Sinh(yL*Pi*INV(ToReal(Lx)))*ToReal(phi0); + 4*cosh(yL*Pi*INV(ToReal(Lx)))*INV(Pi)*INV(sinh(Pi*INV(ToReal(Lx))*ToReal(Ly)))*sin(xL*Pi*INV(ToReal(Lx)))*ToReal(phi0); /* Copy local copies back to grid functions */ phi[index] = phiL; } - CCTK_ENDLOOP3 (Laplace_initial); + CCTK_ENDLOOP3(Laplace_initial); } extern "C" void Laplace_initial(CCTK_ARGUMENTS) @@ -142,7 +140,9 @@ extern "C" void Laplace_initial(CCTK_ARGUMENTS) return; } - const char *groups[] = {"grid::coordinates","Laplace::phi_group"}; + const char *const groups[] = { + "grid::coordinates", + "Laplace::phi_group"}; GenericFD_AssertGroupStorage(cctkGH, "Laplace_initial", 2, groups); switch(fdOrder) @@ -154,7 +154,7 @@ extern "C" void Laplace_initial(CCTK_ARGUMENTS) break; } - GenericFD_LoopOverInterior(cctkGH, &Laplace_initial_Body); + GenericFD_LoopOverInterior(cctkGH, Laplace_initial_Body); if (verbose > 1) { diff --git a/Examples/Laplace/src/Laplace_initial_boundary.cc b/Examples/Laplace/src/Laplace_initial_boundary.cc index 2e288c5..b69fe52 100644 --- a/Examples/Laplace/src/Laplace_initial_boundary.cc +++ b/Examples/Laplace/src/Laplace_initial_boundary.cc @@ -17,10 +17,10 @@ /* Define macros used in calculations */ #define INITVALUE (42) -#define QAD(x) (SQR(SQR(x))) -#define INV(x) ((1.0) / (x)) +#define INV(x) ((CCTK_REAL)1.0 / (x)) #define SQR(x) ((x) * (x)) -#define CUB(x) ((x) * (x) * (x)) +#define CUB(x) ((x) * SQR(x)) +#define QAD(x) (SQR(SQR(x))) extern "C" void Laplace_initial_boundary_SelectBCs(CCTK_ARGUMENTS) { @@ -40,8 +40,6 @@ static void Laplace_initial_boundary_Body(cGH const * restrict const cctkGH, int DECLARE_CCTK_PARAMETERS; - /* Declare finite differencing variables */ - /* Include user-supplied include files */ /* Initialise finite differencing variables */ @@ -72,10 +70,10 @@ static void Laplace_initial_boundary_Body(cGH const * restrict const cctkGH, int CCTK_REAL const p1o1 = 1; CCTK_REAL const p1o12dx = 0.0833333333333333333333333333333*INV(dx); CCTK_REAL const p1o12dy = 0.0833333333333333333333333333333*INV(dy); - CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx)*INV(dy); + CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx*dy); CCTK_REAL const p1o2dx = 0.5*INV(dx); CCTK_REAL const p1o2dy = 0.5*INV(dy); - CCTK_REAL const p1o4dxdy = 0.25*INV(dx)*INV(dy); + CCTK_REAL const p1o4dxdy = 0.25*INV(dx*dy); CCTK_REAL const p1odx2 = INV(SQR(dx)); CCTK_REAL const p1ody2 = INV(SQR(dy)); CCTK_REAL const pm1o12dx2 = -0.0833333333333333333333333333333*INV(SQR(dx)); @@ -91,9 +89,9 @@ static void Laplace_initial_boundary_Body(cGH const * restrict const cctkGH, int /* Loop over the grid points */ #pragma omp parallel - CCTK_LOOP3 (Laplace_initial_boundary, + CCTK_LOOP3(Laplace_initial_boundary, i,j,k, imin[0],imin[1],imin[2], imax[0],imax[1],imax[2], - cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + cctk_ash[0],cctk_ash[1],cctk_ash[2]) { ptrdiff_t const index = di*i + dj*j + dk*k; @@ -116,13 +114,13 @@ static void Laplace_initial_boundary_Body(cGH const * restrict const cctkGH, int } /* Calculate temporaries and grid functions */ - CCTK_REAL phiL = IfThen(10000000000*Abs(-yL + Ly) < + CCTK_REAL phiL = IfThen(10000000000*fabs(-yL + Ly) < 1,ToReal(phi0),0); /* Copy local copies back to grid functions */ phi[index] = phiL; } - CCTK_ENDLOOP3 (Laplace_initial_boundary); + CCTK_ENDLOOP3(Laplace_initial_boundary); } extern "C" void Laplace_initial_boundary(CCTK_ARGUMENTS) @@ -141,7 +139,9 @@ extern "C" void Laplace_initial_boundary(CCTK_ARGUMENTS) return; } - const char *groups[] = {"grid::coordinates","Laplace::phi_group"}; + const char *const groups[] = { + "grid::coordinates", + "Laplace::phi_group"}; GenericFD_AssertGroupStorage(cctkGH, "Laplace_initial_boundary", 2, groups); switch(fdOrder) @@ -153,7 +153,7 @@ extern "C" void Laplace_initial_boundary(CCTK_ARGUMENTS) break; } - GenericFD_LoopOverBoundary(cctkGH, &Laplace_initial_boundary_Body); + GenericFD_LoopOverBoundary(cctkGH, Laplace_initial_boundary_Body); if (verbose > 1) { diff --git a/Examples/Laplace/src/Laplace_relax.cc b/Examples/Laplace/src/Laplace_relax.cc index db6d9c3..a5cb16c 100644 --- a/Examples/Laplace/src/Laplace_relax.cc +++ b/Examples/Laplace/src/Laplace_relax.cc @@ -17,10 +17,10 @@ /* Define macros used in calculations */ #define INITVALUE (42) -#define QAD(x) (SQR(SQR(x))) -#define INV(x) ((1.0) / (x)) +#define INV(x) ((CCTK_REAL)1.0 / (x)) #define SQR(x) ((x) * (x)) -#define CUB(x) ((x) * (x) * (x)) +#define CUB(x) ((x) * SQR(x)) +#define QAD(x) (SQR(SQR(x))) extern "C" void Laplace_relax_SelectBCs(CCTK_ARGUMENTS) { @@ -40,8 +40,6 @@ static void Laplace_relax_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 */ @@ -72,10 +70,10 @@ static void Laplace_relax_Body(cGH const * restrict const cctkGH, int const dir, CCTK_REAL const p1o1 = 1; CCTK_REAL const p1o12dx = 0.0833333333333333333333333333333*INV(dx); CCTK_REAL const p1o12dy = 0.0833333333333333333333333333333*INV(dy); - CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx)*INV(dy); + CCTK_REAL const p1o144dxdy = 0.00694444444444444444444444444444*INV(dx*dy); CCTK_REAL const p1o2dx = 0.5*INV(dx); CCTK_REAL const p1o2dy = 0.5*INV(dy); - CCTK_REAL const p1o4dxdy = 0.25*INV(dx)*INV(dy); + CCTK_REAL const p1o4dxdy = 0.25*INV(dx*dy); CCTK_REAL const p1odx2 = INV(SQR(dx)); CCTK_REAL const p1ody2 = INV(SQR(dy)); CCTK_REAL const pm1o12dx2 = -0.0833333333333333333333333333333*INV(SQR(dx)); @@ -91,9 +89,9 @@ static void Laplace_relax_Body(cGH const * restrict const cctkGH, int const dir, /* Loop over the grid points */ #pragma omp parallel - CCTK_LOOP3 (Laplace_relax, + CCTK_LOOP3(Laplace_relax, i,j,k, imin[0],imin[1],imin[2], imax[0],imax[1],imax[2], - cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + cctk_ash[0],cctk_ash[1],cctk_ash[2]) { ptrdiff_t const index = di*i + dj*j + dk*k; @@ -131,7 +129,7 @@ static void Laplace_relax_Body(cGH const * restrict const cctkGH, int const dir, /* Copy local copies back to grid functions */ phirhs[index] = phirhsL; } - CCTK_ENDLOOP3 (Laplace_relax); + CCTK_ENDLOOP3(Laplace_relax); } extern "C" void Laplace_relax(CCTK_ARGUMENTS) @@ -150,7 +148,9 @@ extern "C" void Laplace_relax(CCTK_ARGUMENTS) return; } - const char *groups[] = {"Laplace::phi_group","Laplace::phi_grouprhs"}; + const char *const groups[] = { + "Laplace::phi_group", + "Laplace::phi_grouprhs"}; GenericFD_AssertGroupStorage(cctkGH, "Laplace_relax", 2, groups); switch(fdOrder) @@ -164,7 +164,7 @@ extern "C" void Laplace_relax(CCTK_ARGUMENTS) break; } - GenericFD_LoopOverInterior(cctkGH, &Laplace_relax_Body); + GenericFD_LoopOverInterior(cctkGH, Laplace_relax_Body); if (verbose > 1) { diff --git a/Examples/Laplace/src/make.code.defn b/Examples/Laplace/src/make.code.defn index 7ced3ce..d65a37f 100644 --- a/Examples/Laplace/src/make.code.defn +++ b/Examples/Laplace/src/make.code.defn @@ -1,3 +1,3 @@ # File produced by Kranc -SRCS = Startup.cc RegisterMoL.cc RegisterSymmetries.cc Laplace_initial.cc Laplace_initial_boundary.cc Laplace_relax.cc Laplace_boundary.cc Boundaries.cc +SRCS = Startup.cc RegisterSymmetries.cc RegisterMoL.cc Laplace_initial.cc Laplace_initial_boundary.cc Laplace_relax.cc Laplace_boundary.cc Boundaries.cc |