aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-05-26 16:20:21 -0400
committerErik Schnetter <schnetter@gmail.com>2013-05-26 16:20:21 -0400
commit2f745fb7afac7abc616f64e2592594e7a87bbef2 (patch)
tree049a0c46db0878b2c12250ccab1c072de4688160 /Carpet/CarpetLib
parent95fcc84d481e21c97833054a78ff38d544c7117f (diff)
CarpetLib: New function bbox::is_poison to check for poison
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r--Carpet/CarpetLib/src/bbox.cc6
-rw-r--r--Carpet/CarpetLib/src/bbox.hh4
2 files changed, 9 insertions, 1 deletions
diff --git a/Carpet/CarpetLib/src/bbox.cc b/Carpet/CarpetLib/src/bbox.cc
index a0041edae..1e68b8d17 100644
--- a/Carpet/CarpetLib/src/bbox.cc
+++ b/Carpet/CarpetLib/src/bbox.cc
@@ -51,6 +51,12 @@ bbox<T,D> bbox<T,D>::poison ()
return bbox (v, v, v);
}
+template<typename T, int D>
+bool bbox<T,D>::is_poison () const
+{
+ return D > 0 and equal_to<bbox> () (*this, poison());
+}
+
// Accessors
diff --git a/Carpet/CarpetLib/src/bbox.hh b/Carpet/CarpetLib/src/bbox.hh
index 82464aea9..d65928e02 100644
--- a/Carpet/CarpetLib/src/bbox.hh
+++ b/Carpet/CarpetLib/src/bbox.hh
@@ -84,7 +84,9 @@ public:
}
// Poison
- static bbox poison () CCTK_MEMBER_ATTRIBUTE_PURE;
+ static bbox poison () CCTK_ATTRIBUTE_PURE;
+
+ bool is_poison () const CCTK_MEMBER_ATTRIBUTE_PURE;
// Accessors
// (Don't return references; *this might be a temporary)