aboutsummaryrefslogtreecommitdiff
path: root/CarpetExtra/CarpetEFenceTest/src
diff options
context:
space:
mode:
Diffstat (limited to 'CarpetExtra/CarpetEFenceTest/src')
-rw-r--r--CarpetExtra/CarpetEFenceTest/src/breach_fence.c21
-rw-r--r--CarpetExtra/CarpetEFenceTest/src/make.code.defn7
2 files changed, 28 insertions, 0 deletions
diff --git a/CarpetExtra/CarpetEFenceTest/src/breach_fence.c b/CarpetExtra/CarpetEFenceTest/src/breach_fence.c
new file mode 100644
index 000000000..3d41795e5
--- /dev/null
+++ b/CarpetExtra/CarpetEFenceTest/src/breach_fence.c
@@ -0,0 +1,21 @@
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+void CarpetEFenceTest_BreachFence(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_PARAMETERS;
+ DECLARE_CCTK_ARGUMENTS;
+
+ int idx;
+ if(CCTK_EQUALS(breach_at,"lower")) {
+ idx = -1;
+ } else if(CCTK_EQUALS(breach_at,"upper")) {
+ idx = CCTK_GFINDEX3D(cctkGH, cctk_lsh[0], cctk_lsh[1]-1, cctk_lsh[2]-1);
+ } else {
+ /* this should never happen */
+ CCTK_ERROR("Uknown breach_at value");
+ }
+
+ sheep[idx] = 42;
+}
diff --git a/CarpetExtra/CarpetEFenceTest/src/make.code.defn b/CarpetExtra/CarpetEFenceTest/src/make.code.defn
new file mode 100644
index 000000000..75ae6086f
--- /dev/null
+++ b/CarpetExtra/CarpetEFenceTest/src/make.code.defn
@@ -0,0 +1,7 @@
+# Main make.code.defn file for thorn CarpetEFenceTest
+
+# Source files in this directory
+SRCS = breach_fence.c
+
+# Subdirectories containing source files
+SUBDIRS =