aboutsummaryrefslogtreecommitdiff
path: root/Examples/Laplace/src/Laplace_initial_boundary.cc
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-11-14 19:53:02 +0100
committerIan Hinder <ian.hinder@aei.mpg.de>2012-11-14 19:53:02 +0100
commitcda73baf0fbca06d75e51ad28ed708d7a087a849 (patch)
tree4fac3164d827c0713877954ac0730f166714a5ad /Examples/Laplace/src/Laplace_initial_boundary.cc
parent72b0c57fbcbbc71f55464dfdf751dbdb0b45fcb8 (diff)
Regenerate examples
Diffstat (limited to 'Examples/Laplace/src/Laplace_initial_boundary.cc')
-rw-r--r--Examples/Laplace/src/Laplace_initial_boundary.cc26
1 files changed, 13 insertions, 13 deletions
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)
{