aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/bbox.cc
diff options
context:
space:
mode:
authoreschnett <>2001-03-12 15:54:00 +0000
committereschnett <>2001-03-12 15:54:00 +0000
commitab4d9e37cb9d453f8e5f3d2e3e0494ed62202dfa (patch)
tree35a5cc8e5c98ef850661beb7e1ccba6daad352ac /Carpet/CarpetLib/src/bbox.cc
parenteff21f37df207cc02ce609bf0a3060556f35d8b6 (diff)
Make the Carpet WaveToy almost-work with two refinement levels. The
Make the Carpet WaveToy almost-work with two refinement levels. The basic error was that the Carpet time levels were set to the Cactus time levels, but they need to be different. In Carpet, level 0 is always the current level, and not so in Cactus. darcs-hash:20010312155417-f6438-7c09703fc594525f2d68d4f9da2e3f3eeaec9c57.gz
Diffstat (limited to 'Carpet/CarpetLib/src/bbox.cc')
-rw-r--r--Carpet/CarpetLib/src/bbox.cc34
1 files changed, 5 insertions, 29 deletions
diff --git a/Carpet/CarpetLib/src/bbox.cc b/Carpet/CarpetLib/src/bbox.cc
index 7ae17fe5d..de281f582 100644
--- a/Carpet/CarpetLib/src/bbox.cc
+++ b/Carpet/CarpetLib/src/bbox.cc
@@ -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.cc,v 1.3 2001/03/07 13:00:57 eschnett Exp $
+ $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bbox.cc,v 1.4 2001/03/12 16:54:25 eschnett Exp $
***************************************************************************/
@@ -133,14 +133,14 @@ bbox<T,D> bbox<T,D>::operator& (const bbox& b) const {
// Containment
template<class T, int D>
-bool bbox<T,D>::contained_in (const bbox& b) const {
+bool bbox<T,D>::is_contained_in (const bbox& b) const {
// no alignment check
return all(lower()>=b.lower() && upper()<=b.upper());
}
// Alignment check
template<class T, int D>
-bool bbox<T,D>::aligned_with (const bbox& b) const {
+bool bbox<T,D>::is_aligned_with (const bbox& b) const {
return all(stride()==b.stride() && (lower()-b.lower()) % stride() == 0);
}
@@ -175,42 +175,18 @@ bbox<T,D> bbox<T,D>::contracted_for (const bbox& b) const {
return bbox(lo,up,str);
}
-// Set operations
// Smallest bbox containing both boxes
template<class T, int D>
-bbox<T,D> bbox<T,D>::operator* (const bbox& b) const {
+bbox<T,D> bbox<T,D>::expanded_containing (const bbox& b) const {
if (empty()) return b;
if (b.empty()) return *this;
- assert (aligned_with(b));
+ assert (is_aligned_with(b));
const vect<T,D> lo = min(lower(), b.lower());
const vect<T,D> up = max(upper(), b.upper());
const vect<T,D> str = min(stride(), b.stride());
return bbox(lo,up,str);
}
-template<class T, int D>
-bbox<T,D>& bbox<T,D>::operator*= (const bbox& b) {
- *this = *this * b;
- return *this;
-}
-
-// Largest bbox inside both boxes
-template<class T, int D>
-bbox<T,D> bbox<T,D>::operator+ (const bbox& b) const {
- if (empty() || b.empty()) return bbox();
- assert (aligned_with(b));
- const vect<T,D> lo = max(lower(), b.lower());
- const vect<T,D> up = min(upper(), b.upper());
- const vect<T,D> str = min(stride(), b.stride());
- return bbox(lo,up,str);
-}
-
-template<class T, int D>
-bbox<T,D>& bbox<T,D>::operator+= (const bbox& b) {
- *this = *this + b;
- return *this;
-}
-
// Iterators
template<class T, int D>
bbox<T,D>::iterator::iterator (const bbox& box, const vect<T,D>& pos)