diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-03-04 21:11:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-03-04 21:11:00 +0000 |
commit | fd1f888aeaf1d468b44e7ef7ab77255c7ea8e706 (patch) | |
tree | 1843c11d8e2b5c1e9bccf39dc324788a953ab7d4 /Carpet/CarpetLib/src/bbox.cc | |
parent | 85e40cbe4a8ab12d6b893953ea906cbc3ce82124 (diff) |
CarpetLib: Output bboxes more comfortably
When outputting bboxes, also output their size after dividing by the
stride, and output the number of contained grid points.
Update the bbox reader to ignore this information.
darcs-hash:20070304211114-dae7b-be8be8a5bfdc15edc3ca7e327ba95fa1ce791bed.gz
Diffstat (limited to 'Carpet/CarpetLib/src/bbox.cc')
-rw-r--r-- | Carpet/CarpetLib/src/bbox.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Carpet/CarpetLib/src/bbox.cc b/Carpet/CarpetLib/src/bbox.cc index 63f3b73b9..482404b05 100644 --- a/Carpet/CarpetLib/src/bbox.cc +++ b/Carpet/CarpetLib/src/bbox.cc @@ -202,6 +202,23 @@ void bbox<T,D>::input (istream& is) { consume (is, ':'); is >> _stride; skipws (is); + if (is.peek() == '/') { + consume (is, '/'); + T lower_dummy; + is >> lower_dummy; + skipws (is); + consume (is, ':'); + T upper_dummy; + is >> upper_dummy; + skipws (is); + consume (is, '/'); + T shape_dummy; + is >> shape_dummy; + consume (is, '/'); + T size_dummy; + is >> size_dummy; + skipws (is); + } consume (is, ')'); } catch (input_error &err) { cout << "Input error while reading a bbox" << endl; @@ -226,7 +243,10 @@ void bbox<T,D>::input (istream& is) { // Output template<class T,int D> void bbox<T,D>::output (ostream& os) const { - os << "(" << lower() << ":" << upper() << ":" << stride() << ")"; + os << "(" << lower() << ":" << upper() << ":" << stride() + << "/" << lower() / stride() << ":" << upper() / stride() + << "/" << shape() / stride() + << "/" << size() << ")"; } |