aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-08-25 11:33:21 -0400
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 18:21:19 +0000
commit3bd1e904a73d01bf4a01e44e61c92109ca6e8c75 (patch)
treea614c1ea57b1da98b2de050fbb4c4a62703e5bcb /Carpet
parent23f9ce038cf4051cb3b2bd5e5e1a09bf08fcc9e2 (diff)
CarpetLib: Add "offset" function
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetLib/src/bbox.hh3
1 files changed, 3 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/bbox.hh b/Carpet/CarpetLib/src/bbox.hh
index c3c346058..1c3d5d407 100644
--- a/Carpet/CarpetLib/src/bbox.hh
+++ b/Carpet/CarpetLib/src/bbox.hh
@@ -101,6 +101,9 @@ public:
/** Get stride. */
vect<T,D> stride () const { return _stride; }
+ /** Get offset. */
+ vect<T,D> offset () const { return (_lower % _stride + _stride) % _stride; }
+
/** Get the shape (or extent). */
vect<T,D> shape () const { return _upper - _lower + _stride; }