From e31b6615abc9d7211a745eb2679882611fbefd23 Mon Sep 17 00:00:00 2001 From: eschnett <> Date: Wed, 7 Mar 2001 12:00:00 +0000 Subject: Made WaveToyF77 run on multiple processors with CarpetSlab. Made WaveToyF77 run on multiple processors with CarpetSlab. Addes "bases" in gh and dh. They contain the extent of a bounding box enclosing all components on a level. darcs-hash:20010307120057-f6438-829d3c60a80c7b13f850c0ad187257bb6e1b963f.gz --- Carpet/CarpetLib/src/bbox.hh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'Carpet/CarpetLib/src/bbox.hh') diff --git a/Carpet/CarpetLib/src/bbox.hh b/Carpet/CarpetLib/src/bbox.hh index 5cc6fa1ff..6787b9240 100644 --- a/Carpet/CarpetLib/src/bbox.hh +++ b/Carpet/CarpetLib/src/bbox.hh @@ -5,7 +5,7 @@ copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bbox.hh,v 1.2 2001/03/05 21:48:38 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bbox.hh,v 1.3 2001/03/07 13:00:57 eschnett Exp $ ***************************************************************************/ @@ -42,7 +42,7 @@ template class bbox { // Fields - vect _lower, _upper, _stride;// bounds are inclusive + vect _lower, _upper, _stride; // bounds are inclusive public: @@ -63,15 +63,8 @@ public: return any(lower()>upper()); } - T size () const { - if (empty()) return 0; - return prod(shape()); - } - - T num_points () const { - if (empty()) return 0; - return prod((shape()+stride()-1)/stride()); - } + T size () const; + T num_points () const; // Queries bool contains (const vect& x) const; @@ -102,6 +95,14 @@ public: // Find the largest b-compatible box inside *this bbox contracted_for (const bbox& b) const; + // Set operations + // Smallest bbox containing both boxes + bbox operator* (const bbox& b) const; + bbox& operator*= (const bbox& b); + // Largest bbox inside both boxes + bbox operator+ (const bbox& b) const; + bbox& operator+= (const bbox& b); + // Iterators class iterator { protected: -- cgit v1.2.3