aboutsummaryrefslogtreecommitdiff
path: root/Examples/WaveHost/src/Differencing.h
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-03-15 17:23:09 +0100
committerIan Hinder <ian.hinder@aei.mpg.de>2012-03-15 17:23:09 +0100
commitfa52744053f212b79087a40dac8c9df8d6d40158 (patch)
tree8440718606729dfcdfb9fe2030f058c2b95d96d5 /Examples/WaveHost/src/Differencing.h
parent7840f15af87fc2b070da6f49fd2ee5c0f247e78f (diff)
Replace SimpleWaveCaKernel with WaveCaKernel
This script now generates WaveCaKernel and WaveHost which do the same thing, one using CaKernel and one using the host. This allows easy cross-comparison between the two methods.
Diffstat (limited to 'Examples/WaveHost/src/Differencing.h')
-rw-r--r--Examples/WaveHost/src/Differencing.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/Examples/WaveHost/src/Differencing.h b/Examples/WaveHost/src/Differencing.h
new file mode 100644
index 0000000..ef21b0b
--- /dev/null
+++ b/Examples/WaveHost/src/Differencing.h
@@ -0,0 +1,72 @@
+#ifndef KRANC_DIFF_FUNCTIONS
+# define PDstandard2nd1(u) ((-KRANC_GFOFFSET3D(u,-1,0,0) + KRANC_GFOFFSET3D(u,1,0,0))*p1o2dx)
+#else
+# define PDstandard2nd1(u) (PDstandard2nd1_impl(u,p1o2dx,cdj,cdk))
+static CCTK_REAL PDstandard2nd1_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1o2dx, ptrdiff_t const cdj, ptrdiff_t const cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
+static CCTK_REAL PDstandard2nd1_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1o2dx, ptrdiff_t const cdj, ptrdiff_t const cdk)
+{
+ ptrdiff_t const cdi=sizeof(CCTK_REAL);
+ return (-KRANC_GFOFFSET3D(u,-1,0,0) + KRANC_GFOFFSET3D(u,1,0,0))*p1o2dx;
+}
+#endif
+
+#ifndef KRANC_DIFF_FUNCTIONS
+# define PDstandard2nd2(u) ((-KRANC_GFOFFSET3D(u,0,-1,0) + KRANC_GFOFFSET3D(u,0,1,0))*p1o2dy)
+#else
+# define PDstandard2nd2(u) (PDstandard2nd2_impl(u,p1o2dy,cdj,cdk))
+static CCTK_REAL PDstandard2nd2_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1o2dy, ptrdiff_t const cdj, ptrdiff_t const cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
+static CCTK_REAL PDstandard2nd2_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1o2dy, ptrdiff_t const cdj, ptrdiff_t const cdk)
+{
+ ptrdiff_t const cdi=sizeof(CCTK_REAL);
+ return (-KRANC_GFOFFSET3D(u,0,-1,0) + KRANC_GFOFFSET3D(u,0,1,0))*p1o2dy;
+}
+#endif
+
+#ifndef KRANC_DIFF_FUNCTIONS
+# define PDstandard2nd3(u) ((-KRANC_GFOFFSET3D(u,0,0,-1) + KRANC_GFOFFSET3D(u,0,0,1))*p1o2dz)
+#else
+# define PDstandard2nd3(u) (PDstandard2nd3_impl(u,p1o2dz,cdj,cdk))
+static CCTK_REAL PDstandard2nd3_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1o2dz, ptrdiff_t const cdj, ptrdiff_t const cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
+static CCTK_REAL PDstandard2nd3_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1o2dz, ptrdiff_t const cdj, ptrdiff_t const cdk)
+{
+ ptrdiff_t const cdi=sizeof(CCTK_REAL);
+ return (-KRANC_GFOFFSET3D(u,0,0,-1) + KRANC_GFOFFSET3D(u,0,0,1))*p1o2dz;
+}
+#endif
+
+#ifndef KRANC_DIFF_FUNCTIONS
+# define PDstandard2nd11(u) ((-2*KRANC_GFOFFSET3D(u,0,0,0) + KRANC_GFOFFSET3D(u,-1,0,0) + KRANC_GFOFFSET3D(u,1,0,0))*p1odx2)
+#else
+# define PDstandard2nd11(u) (PDstandard2nd11_impl(u,p1odx2,cdj,cdk))
+static CCTK_REAL PDstandard2nd11_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1odx2, ptrdiff_t const cdj, ptrdiff_t const cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
+static CCTK_REAL PDstandard2nd11_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1odx2, ptrdiff_t const cdj, ptrdiff_t const cdk)
+{
+ ptrdiff_t const cdi=sizeof(CCTK_REAL);
+ return (-2*KRANC_GFOFFSET3D(u,0,0,0) + KRANC_GFOFFSET3D(u,-1,0,0) + KRANC_GFOFFSET3D(u,1,0,0))*p1odx2;
+}
+#endif
+
+#ifndef KRANC_DIFF_FUNCTIONS
+# define PDstandard2nd22(u) ((-2*KRANC_GFOFFSET3D(u,0,0,0) + KRANC_GFOFFSET3D(u,0,-1,0) + KRANC_GFOFFSET3D(u,0,1,0))*p1ody2)
+#else
+# define PDstandard2nd22(u) (PDstandard2nd22_impl(u,p1ody2,cdj,cdk))
+static CCTK_REAL PDstandard2nd22_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1ody2, ptrdiff_t const cdj, ptrdiff_t const cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
+static CCTK_REAL PDstandard2nd22_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1ody2, ptrdiff_t const cdj, ptrdiff_t const cdk)
+{
+ ptrdiff_t const cdi=sizeof(CCTK_REAL);
+ return (-2*KRANC_GFOFFSET3D(u,0,0,0) + KRANC_GFOFFSET3D(u,0,-1,0) + KRANC_GFOFFSET3D(u,0,1,0))*p1ody2;
+}
+#endif
+
+#ifndef KRANC_DIFF_FUNCTIONS
+# define PDstandard2nd33(u) ((-2*KRANC_GFOFFSET3D(u,0,0,0) + KRANC_GFOFFSET3D(u,0,0,-1) + KRANC_GFOFFSET3D(u,0,0,1))*p1odz2)
+#else
+# define PDstandard2nd33(u) (PDstandard2nd33_impl(u,p1odz2,cdj,cdk))
+static CCTK_REAL PDstandard2nd33_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1odz2, ptrdiff_t const cdj, ptrdiff_t const cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
+static CCTK_REAL PDstandard2nd33_impl(CCTK_REAL const* restrict const u, CCTK_REAL const p1odz2, ptrdiff_t const cdj, ptrdiff_t const cdk)
+{
+ ptrdiff_t const cdi=sizeof(CCTK_REAL);
+ return (-2*KRANC_GFOFFSET3D(u,0,0,0) + KRANC_GFOFFSET3D(u,0,0,-1) + KRANC_GFOFFSET3D(u,0,0,1))*p1odz2;
+}
+#endif
+