aboutsummaryrefslogtreecommitdiff
path: root/Auxiliary/Cactus/KrancNumericalTools
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2009-04-27 11:27:38 -0500
committerIan Hinder <ian.hinder@aei.mpg.de>2009-04-27 21:51:04 +0200
commit269ff945b9bbed7724db0d960c671a6e5f15b801 (patch)
tree269f1ef9ab8e74f622782801833c26cce5353e08 /Auxiliary/Cactus/KrancNumericalTools
parentef0e1e9a215cd69f1d95e8bd3c6207d19112916f (diff)
Add commented out code for helping accessing grid functions near boundaries:
Define a macro CCTK_GFACCESS3D which returns grid point values if inside the domain, and zero otherwise.
Diffstat (limited to 'Auxiliary/Cactus/KrancNumericalTools')
-rw-r--r--Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
index d15b7ab..6dd1067 100644
--- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
+++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
@@ -684,6 +684,25 @@ void GenericFD_GetBoundaryInfo(cGH const * restrict cctkGH,
CCTK_INT * restrict is_physbnd,
CCTK_INT * restrict is_ipbnd);
+#if 0
+/* Finite differencing near boundaries */
+
+/* The array var is to be accessed at the location
+ [i+ioff,j+joff,k+koff]. idir,jdir,kdir specify whether there is a
+ lower (dir<0), upper (dir>0), or no boundary nearby. If a boundary
+ is in the way, the value 0 is returned instead of the array
+ content. */
+#define CCTK_GFACCESS3D(cctkGH, var, i,j,k, ioff,joff,koff, idir,jdir,kdir) \
+ (((idir)<0 && (ioff)<0) || \
+ ((jdir)<0 && (joff)<0) || \
+ ((kdir)<0 && (koff)<0) || \
+ ((idir)>0 && (ioff)>0) || \
+ ((jdir)>0 && (joff)>0) || \
+ ((kdir)>0 && (koff)>0) || \
+ ? 0 \
+ : (var)[CCTK_GFINDEX3D((cctkGH), (i)+(ioff),(j)+(joff),(k)+(koff))])
+#endif
+
/* Summation by parts */
static inline CCTK_REAL sbp_deriv_x(int i, int j, int k,