00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef BL_BOXDOMAIN_H
00024 #define BL_BOXDOMAIN_H
00025
00026
00027
00028 #include <iosfwd>
00029
00030 #include <IndexType.H>
00031 #include <Box.H>
00032 #include <IntVect.H>
00033 #include <BoxList.H>
00034
00035
00036
00037 class BoxDomain;
00038
00039 namespace BoxLib
00040 {
00041
00043
00044 BoxDomain complementIn (const Box& b, const BoxDomain& bl);
00045
00049 void coarsen (BoxDomain& dest, const BoxDomain& fin, int ratio);
00050
00054 void refine (BoxDomain& dest,
00055 const BoxDomain& fin,
00056 int ratio);
00057
00061 void intersect (BoxDomain& dest,
00062 const BoxDomain& fin,
00063 const Box& b);
00064
00068 void accrete (BoxDomain& dest,
00069 const BoxDomain& fin,
00070 int sz = 1);
00071 }
00072
00073
00075
00076 std::ostream& operator<< (std::ostream& os, const BoxDomain& bd);
00077
00078
00079
00081
00091 class BoxDomain
00092 :
00093 protected BoxList
00094 {
00095 public:
00096
00097 typedef BoxList::const_iterator const_iterator;
00098
00100
00101 BoxDomain ();
00102
00104
00105 BoxDomain (const Box& bx);
00106
00108
00109 explicit BoxDomain (IndexType itype);
00110
00112
00113 void add (const Box& b);
00114
00116
00117 void add (const BoxList& bl);
00118
00120
00121 BoxDomain& rmBox (const Box& b);
00122
00126 bool ok () const;
00127
00129
00130 using BoxList::clear;
00131
00133
00134 using BoxList::size;
00135
00137
00138 using BoxList::isEmpty;
00139
00141
00142 using BoxList::isNotEmpty;
00143
00145
00146 using BoxList::minimalBox;
00147
00149
00150 using BoxList::ixType;
00151
00153
00154 using BoxList::minimize;
00155
00157
00158 using BoxList::simplify;
00159
00161
00162 using BoxList::begin;
00163
00165
00166 using BoxList::end;
00167
00169
00170 using BoxList::contains;
00171
00173
00174 using BoxList::shift;
00175
00177
00178 using BoxList::shiftHalf;
00179
00181
00182 BoxList boxList () const;
00183
00185
00186 bool operator== (const BoxDomain& rhs) const;
00187
00189
00190 bool operator!= (const BoxDomain& rhs) const;
00191
00193
00194 BoxDomain& refine (int ratio);
00195
00197
00198 BoxDomain& coarsen (int ratio);
00199
00201
00202 BoxDomain& intersect (const Box& b);
00203
00205
00206 BoxDomain& accrete (int sz);
00207
00209
00210 BoxDomain& complementIn (const Box& b,
00211 const BoxDomain& bl);
00212 };
00213
00214 #endif