summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authoreschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2010-11-24 02:58:40 +0000
committereschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2010-11-24 02:58:40 +0000
commit232b81cc03dbdb548dffcf1f9b6e92659e2bd441 (patch)
tree30c700b12479072997f314e5625df78f964e82d7 /src/main
parentde4f1951d4d50293271482585e8fcc1cf273b72c (diff)
Add CCTK_VECTGFINDEX3D and friends
Add functions CCTK_VectGF1D, CCTK_VectGF2D etc. and the corresponding macros CCTK_VECTGFINDEX1D etc. that allow indexing into vector grid variables. Vector grid variables require an additional index, namely the vector index; these functions simplify using them. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4654 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r--src/main/DebugDefines.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/DebugDefines.c b/src/main/DebugDefines.c
index 43383489..76f70b2f 100644
--- a/src/main/DebugDefines.c
+++ b/src/main/DebugDefines.c
@@ -66,3 +66,24 @@ int CCTK_GFIndex4D (const cGH *GH, int i, int j, int k, int l)
{
return (i + GH->cctk_lsh[0]*(j + GH->cctk_lsh[1]*(k + GH->cctk_lsh[2] * l)));
}
+
+int CCTK_VectGFIndex1D (const cGH *GH, int i, int n)
+{
+ return (i + GH->cctk_lsh[0]*n);
+}
+
+int CCTK_VectGFIndex2D (const cGH *GH, int i, int j, int n)
+{
+ return (i + GH->cctk_lsh[0]*(j + GH->cctk_lsh[1]*n));
+}
+
+int CCTK_VectGFIndex3D (const cGH *GH, int i, int j, int k, int n)
+{
+ return (i + GH->cctk_lsh[0]*(j + GH->cctk_lsh[1]*(k + GH->cctk_lsh[2]*n)));
+}
+
+int CCTK_VectGFIndex4D (const cGH *GH, int i, int j, int k, int l, int n)
+{
+ return (i + GH->cctk_lsh[0]*(j + GH->cctk_lsh[1]*(k + GH->cctk_lsh[2]*
+ (l + GH->cctk_lsh[3]*n))));
+}