From 2f745fb7afac7abc616f64e2592594e7a87bbef2 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 26 May 2013 16:20:21 -0400 Subject: CarpetLib: New function bbox::is_poison to check for poison --- Carpet/CarpetLib/src/bbox.cc | 6 ++++++ Carpet/CarpetLib/src/bbox.hh | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'Carpet/CarpetLib') 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 bbox::poison () return bbox (v, v, v); } +template +bool bbox::is_poison () const +{ + return D > 0 and equal_to () (*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) -- cgit v1.2.3