00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _INTVECTSET_H_ 00012 #define _INTVECTSET_H_ 00013 00014 #include "SPACE.H" 00015 00016 #ifndef WRAPPER 00017 #include <iostream> 00018 #include "Box.H" 00019 #include "IntVect.H" 00020 #include "TreeIntVectSet.H" 00021 #include "DenseIntVectSet.H" 00022 #include "parstream.H" 00023 #include "NamespaceHeader.H" 00024 00025 #endif 00026 00027 /// An irregular domain on an integer lattice 00028 /** 00029 \nosubgrouping 00030 IntVectSet represents an irregular region in an integer lattice 00031 SpaceDim-dimensional index space as an arbitrary collection of 00032 IntVects. A full set calculus is defined. Any IntVect or 00033 cell-centered Box can be fully represented as an IntVectSet. There 00034 is an iterator that provides access to the contents of an 00035 IntVectSet. IntVectSets are implicitly cell-centered. 00036 Intersection, union, and complement operations are defined for 00037 pairs of IntVectSets (and, by extension, an IntVectSet and an 00038 IntVect or an IntVectSet and a Box). The minimum Box of an 00039 IntVectSet is defined as the smallest Box that contains every 00040 IntVect in the IntVectSet. 00041 00042 The IntVects in an IntVectSet do not have a canonical ordering. 00043 */ 00044 class IntVectSet 00045 { 00046 public: 00047 friend 00048 class IVSIterator; 00049 00050 /** 00051 \name Constructors, Destructor, and defines 00052 */ 00053 00054 /*@{*/ 00055 00056 ~IntVectSet(); 00057 00058 /// default constructor: defines an empty IntVectSet. 00059 IntVectSet(); 00060 /// default define: modifies this IntVectSet to be empty. 00061 void 00062 define(); 00063 00064 /// copy constructor 00065 IntVectSet(const IntVectSet& ivs); 00066 /// copy define: modifies this IntVectSet into a copy of \a ivs 00067 void 00068 define(const IntVectSet& ivs); 00069 /// copy define: same as \c define(IntVectSet) 00070 void 00071 define_intvectset(const IntVectSet& ivs) 00072 { 00073 define(ivs); 00074 } 00075 /// return a copy of this IntVectSet 00076 IntVectSet 00077 copy() const 00078 { 00079 return *this; 00080 } 00081 00082 /// conversion constructor 00083 explicit 00084 IntVectSet(const DenseIntVectSet& a_dense); 00085 /// conversion define 00086 void 00087 define (const DenseIntVectSet& a_dense); 00088 /// conversion constructor 00089 explicit 00090 IntVectSet(const TreeIntVectSet& a_tree); 00091 /// conversion define 00092 void 00093 define (const TreeIntVectSet& a_tree); 00094 00095 /// IntVect constructor 00096 /** construct this to be an IntVectSet with just one IntVect. */ 00097 explicit 00098 IntVectSet(const IntVect& iv); 00099 /// IntVect define: modifies this IntVectSet to have just one IntVect 00100 void 00101 define(const IntVect& iv); 00102 /// IntVect define: same as \c define(IntVect) 00103 void 00104 define_intvect(const IntVect& iv) 00105 { 00106 define(iv); 00107 } 00108 00109 /// Box constructor 00110 /** construct this to be an IntVectSet with all the IntVects in the Box \b. */ 00111 explicit 00112 IntVectSet(const Box& b); 00113 /// Box define 00114 /** modifies this IntVect to have all the IntVects in the Box \b. */ 00115 void 00116 define(const Box& b); 00117 /// Box define: same as \c define(Box) 00118 void 00119 define_box(const Box& b) 00120 { 00121 define(b); 00122 } 00123 /// Define this IntVectSet to have all the corners of the input box. 00124 void 00125 define_boxCorners(const Box& b); 00126 00127 /*@}*/ 00128 00129 /** 00130 \name Union operators 00131 */ 00132 /*@{*/ 00133 00134 /// unions another IntVectSet \a ivs into this IntVectSet 00135 IntVectSet& 00136 operator|=(const IntVectSet& ivs); 00137 00138 /// same as operator|= except it doesn't return *this 00139 void 00140 or_intvectset(const IntVectSet& ivs) 00141 { 00142 *this |= ivs; 00143 } 00144 00145 /// unions a single IntVect \a iv into this IntVectSet 00146 IntVectSet& 00147 operator|=(const IntVect& iv); 00148 /// same as operator|= except it doesn't return *this 00149 void 00150 or_intvect(const IntVect& ivs) 00151 { 00152 *this |= ivs; 00153 } 00154 00155 /// unions the IntVects in the Box \b into this IntVectSet 00156 IntVectSet& 00157 operator|=(const Box& b); 00158 /// same as operator|= except it doesn't return *this 00159 void 00160 or_box(const Box& b) 00161 { 00162 *this |= b; 00163 } 00164 00165 /// Returns a new IntVectSet that is the union of two IntVectSets 00166 friend 00167 IntVectSet 00168 operator|(const IntVectSet& ivs1, const IntVectSet& ivs2); 00169 00170 /// Returns a new IntVectSet that is the union of an IntVectSet and an IntVect 00171 friend 00172 IntVectSet 00173 operator|(const IntVectSet& ivs, const IntVect& iv); 00174 00175 /// Returns a new IntVectSet that is the union of an IntVectSet and an IntVect 00176 friend 00177 IntVectSet 00178 operator|(const IntVect& iv, const IntVectSet& ivs); 00179 00180 /// Returns a new IntVectSet that is the union of an IntVectSet and a Box 00181 friend 00182 IntVectSet 00183 operator|(const IntVectSet& ivs, const Box& b); 00184 00185 /// Returns a new IntVectSet that is the union of an IntVectSet and a Box 00186 friend 00187 IntVectSet 00188 operator|(const Box& b, const IntVectSet& ivs); 00189 00190 /*@}*/ 00191 00192 /** 00193 \name Complement operators 00194 */ 00195 /*@{*/ 00196 00197 /// Returns the complement of the IntVectSet \a ivs within this IntVectSet 00198 IntVectSet 00199 operator-(const IntVectSet& ivs) const; 00200 00201 /// Returns the complement of the Box \a b within this IntVectSet 00202 IntVectSet 00203 operator-(const Box& b) const; 00204 00205 /// Returns the complement of the IntVect \a iv within this IntVectSet 00206 IntVectSet 00207 operator-(const IntVect& iv) const; 00208 00209 /// Remove the IntVects in the IntVectSet \a ivs from this IntVectSet 00210 /** 00211 * Modifies this IntVectSet to be the complement of the IntVectSet \a ivs 00212 * within this IntVectSet. 00213 */ 00214 IntVectSet& 00215 operator-=(const IntVectSet& ivs); 00216 /// same as operator-= except it doesn't return *this 00217 void 00218 minus(const IntVectSet& ivs) 00219 { 00220 *this -= ivs; 00221 } 00222 00223 /// Remove the IntVects in the Box \a b from this IntVectSet 00224 /** 00225 * Modifies this IntVectSet to be the complement of the argument 00226 * Box within this IntVectSet. 00227 */ 00228 IntVectSet& 00229 operator-=(const Box& b); 00230 /// same as operator-= except it doesn't return *this 00231 void 00232 minus_box(const Box& b) 00233 { 00234 *this -=b; 00235 } 00236 00237 /// Remove the IntVect \a iv from this IntVectSet 00238 /** 00239 Modifies this IntVectSet to be the complement of the argument 00240 IntVect within this IntVectSet. 00241 */ 00242 IntVectSet& 00243 operator-=(const IntVect& iv); 00244 /// same as operator-= except it doesn't return *this 00245 void 00246 minus_intvect(const IntVect& iv) 00247 { 00248 *this -=iv; 00249 } 00250 00251 /*@}*/ 00252 00253 /** 00254 \name Intersection operators */ 00255 /*@{*/ 00256 00257 /// Returns a new IntVectSet that is the intersection of two IntVectSets 00258 /** 00259 * The result may be empty. 00260 */ 00261 friend 00262 IntVectSet 00263 operator&(const IntVectSet& ivs1, const IntVectSet& ivs2); 00264 00265 /// Returns a new IntVectSet that is the intersection of an IntVectSet and a Box 00266 /** 00267 * The result may be empty. 00268 */ 00269 friend 00270 IntVectSet 00271 operator&(const IntVectSet& ivs, const Box& b); 00272 00273 /// Returns a new IntVectSet that is the intersection of an IntVectSet and a Box 00274 /** 00275 * The result may be empty. 00276 */ 00277 friend 00278 IntVectSet 00279 operator&(const Box& b, const IntVectSet& ivs); 00280 00281 /// Modifies this IntVectSet to its intersection with another IntVectSet 00282 IntVectSet& 00283 operator&=(const IntVectSet& ivs); 00284 /// same as operator&= except it doesn't return *this 00285 void 00286 and_intvectset(const IntVectSet& ivs) 00287 { 00288 *this &= ivs; 00289 } 00290 00291 /// Modifies this IntVectSet to be its intersection with a Box 00292 IntVectSet& 00293 operator&=(const Box& b); 00294 /// same as operator&= except it doesn't return *this 00295 void 00296 and_box(const Box& b) 00297 { 00298 *this &= b; 00299 } 00300 00301 /// Modifies this IntVectSet to be its intersection with the Box in a ProblemDomain 00302 IntVectSet& 00303 operator&=(const ProblemDomain& domain); 00304 /// same as operator&= except it doesn't return *this 00305 void 00306 and_domain(const ProblemDomain& d) 00307 { 00308 *this &= d; 00309 } 00310 00311 /*@}*/ 00312 00313 /** 00314 \name Modification functions */ 00315 /*@{*/ 00316 00317 /// Add IntVects to this IntVectSet in all directions 00318 /** 00319 Modifies this IntVectSet by growing it by the specified number 00320 of IntVects in all directions, including diagonal. It is an error 00321 if \a igrow < 0. 00322 */ 00323 void 00324 grow(int igrow); 00325 00326 /// Add IntVects to an IntVectSet in all directions 00327 /** 00328 Creates a new IntVectSet that is a copy of the argument IntVectSet \a ivs 00329 grown by the specified number of IntVects in all directions \a igrow, including 00330 diagonal. It is an error if \a igrow < 0. 00331 */ 00332 friend 00333 IntVectSet 00334 grow(const IntVectSet& ivs, int igrow); 00335 00336 /// Add IntVects to this IntVectSet in one direction 00337 /** 00338 Modifies this IntVectSet by growing it by the specified number of 00339 IntVects \a igrow in the specified coordinate direction \a idir. 00340 Directions are zero-based. 00341 */ 00342 IntVectSet& 00343 grow(int idir, int igrow); 00344 /// same as \c grow(idir,igrow) except doesn't return *this 00345 void 00346 grow_dir(int idir, int igrow) 00347 { 00348 grow(idir, igrow); 00349 } 00350 00351 /// Analogous to surroundingNodes() for a Box. 00352 /** 00353 Modifies this IntVectSet by adding IntVects to the high-side of each 00354 direction. 00355 */ 00356 void 00357 growHi(); 00358 00359 /// Analogous to surroundingNodes(dir) for a Box. 00360 /** 00361 Modifies this IntVectSet by adding IntVects to the high-side of a specified 00362 direction. 00363 */ 00364 void 00365 growHi(const int a_dir); 00366 00367 /// Refine all the IntVects in this IntVecSet 00368 /** 00369 Modifies this IntVectSet by refining it by the factor \a iref. It is 00370 an error if \a iref <= 0. Definition of refinement: for each IntVect \p iv 00371 in the original IntVectSet, the refined IntVectSet will contain the Box 00372 defined by <b>refine( Box(iv,iv), iref )</b>. 00373 */ 00374 IntVectSet& 00375 refine(int iref = 2); 00376 00377 /// Refine all the IntVects in an IntVectSet 00378 /** 00379 Creates a new IntVectSet that is a copy of the argument IntVectSet \a ivs 00380 refined by the factor \a iref. It is an error if \a iref <= 0. 00381 Definition of refinement: for each IntVect \p iv in the original 00382 IntVectSet \a ivs, the refined IntVectSet will contain the Box defined by 00383 <b>refine( Box(iv,iv), iref )<b>. 00384 */ 00385 friend 00386 IntVectSet 00387 refine(const IntVectSet& ivs, int iref); 00388 00389 /// Coarsen all the IntVects in this IntVectSet 00390 /** 00391 Modifies this IntVectSet by coarsening it by the factor \a iref. It is 00392 an error if \a iref <= 0. Definition of coarsening: for each IntVect 00393 \p iv in the original IntVectSet, the refined IntVectSet will contain the 00394 IntVect defined by <b>coarsen( iv, iref )</b>. 00395 */ 00396 IntVectSet& 00397 coarsen(int iref = 2); 00398 00399 /// Coarsen all the IntVects in an IntVectSet 00400 /** 00401 Creates a new IntVectSet that is a copy of the argument IntVectSet \a ivs coarsened 00402 by the factor \a iref. It is an error if \a iref <= 0. 00403 Definition of coarsening: for each IntVect \p iv in the original 00404 IntVectSet, the refined IntVectSet will contain the IntVect defined by 00405 <b>coarsen( iv, iref )</b>. 00406 */ 00407 friend 00408 IntVectSet 00409 coarsen(const IntVectSet& ivs, int iref); 00410 00411 /// Increment all the IntVects in this IntVectSet by the IntVect \a iv 00412 void 00413 shift(const IntVect& iv); 00414 00415 /// Make this IntVectSet be properly nested 00416 /** 00417 Modifies this IntVectSet to remove all IntVects that are not at least 00418 \a radius from the the edge of the IntVectSet in any direction. \a 00419 radius must be positive. IntVects that border the Box \a domain are 00420 spared from this trimming. 00421 */ 00422 void 00423 nestingRegion(int radius, const Box& domain, int granularity = 1); 00424 00425 /// Make this IntVectSet be properly nested 00426 /** 00427 Modifies this IntVectSet to remove all IntVects that are not at least 00428 \a radius from the the edge of the IntVectSet in any direction. \a 00429 radius must be positive. IntVects that border non-periodic boundaries 00430 are spared from this trimming. Radius extends across periodic images. 00431 */ 00432 void 00433 nestingRegion(int radius, const ProblemDomain& probdomain, int granularity = 1); 00434 /// same as \c nestingRegion() except it doesn't return *this 00435 void 00436 nestingRegion_prob(int radius, const ProblemDomain& probdomain) 00437 { 00438 nestingRegion(radius, probdomain); 00439 } 00440 00441 /// Modifies this IntVectSet to be empty 00442 void 00443 makeEmpty(); 00444 00445 /// Modifies this IntVectSet to empty but leaves dense domain box unchanged. 00446 /** 00447 This leaves unchanged the domain box for a dense IntVectSet - it only sets 00448 all bits to zero. So you can still do unions later (in the domain box) and 00449 not be converted to a tree representation. There is no difference from 00450 makeEmpty() for a tree IntVectSet 00451 */ 00452 void 00453 makeEmptyBits(); 00454 00455 /// Chop the IntVectSet at the \a chop_pnt index in the \a dir direction. 00456 /** 00457 Returns one IntVectSet and modifies this IntVectSet. The union of the 00458 two is the original IntVectSet. This IntVectSet gets the IntVects with 00459 \a dir index >= \a chop_pnt, and the returned IntVectSet gets the 00460 IntVects with \a dir index < \a chop_pnt. It is an error if \a dir is 00461 invalid. 00462 */ 00463 IntVectSet chop(int dir, int chop_pnt); 00464 00465 void chop(int dir, int chop_pnt, IntVectSet& a_hi); 00466 /// 00467 /** 00468 Set the max box size for IntVectSet::define(Box) which will 00469 make the IntVectSet dense. Default is 6.4^6. 00470 */ 00471 static void setMaxDense(const int& a_maxDense); 00472 00473 /*@}*/ 00474 00475 /** 00476 \name Accessor and Inquiry functions */ 00477 /*@{*/ 00478 00479 /// Returns the number of IntVects in this IntVectSet 00480 int 00481 numPts() const; 00482 00483 /// Returns the minimum enclosing box of this IntVectSet 00484 const Box& 00485 minBox() const; 00486 00487 /// Forces recalculation of the minimum enclosing box of this IntVectSet 00488 void 00489 recalcMinBox() const; 00490 00491 /// Returns true if no IntVects are in this IntVectSet 00492 bool 00493 isEmpty() const; 00494 00495 /// Returns true if this IntVectSet is currently being represented in a dense fashion 00496 bool 00497 isDense() const; 00498 00499 /// Returns true if this IntVectSet contains \a iv 00500 bool 00501 contains(const IntVect& iv) const; 00502 00503 /// Returns true if this IntVectSet contains all the IntVects in \a ivs 00504 bool 00505 contains(const IntVectSet& ivs) const; 00506 /// same as \c contains(ivs) 00507 bool 00508 contains_intvectset(const IntVectSet& ivs) const 00509 { 00510 return contains(ivs); 00511 } 00512 00513 /// Returns true if this IntVectSet contains all the IntVects in \a box 00514 /** 00515 * Note: this is done using an algorithm that is much faster than looping 00516 * through all the IntVects. 00517 */ 00518 bool 00519 contains(const Box& box) const; 00520 /// same as \c contains(b) 00521 bool 00522 contains_box(const Box& b) const 00523 { 00524 return contains(b); 00525 } 00526 00527 /// Returns a Vector<Box> representation of this IntVectSet. 00528 /** 00529 * The returned Boxes contain only the IntVects in this IntVectSet, so 00530 * the union of the Boxes in the Vector == this IntVectSet. 00531 */ 00532 Vector<Box> 00533 boxes() const; 00534 00535 /// Optimize memory usage of this IntVectSet 00536 /** 00537 Attempts to optimize storage for IntVectSet. This will also 00538 optimize iteration through the IntVectSet later. Best to call 00539 it when you are no longer modifying the IntVectSet 00540 */ 00541 void 00542 compact() const; 00543 00544 /*@}*/ 00545 00546 /** 00547 \name Linearization functions */ 00548 /*@{*/ 00549 00550 /// Returns the number of bytes in a linear representation of *this 00551 int 00552 linearSize() const; 00553 00554 /// Modify *this using the data in the linear representation in \a a_inBuf 00555 void 00556 linearIn(const void* const a_inBuf); 00557 00558 /// Write a linear representation of *this to \a a_outBuf 00559 /** 00560 Assumes a_outBuf is at least linearSize() bytes long. 00561 */ 00562 void 00563 linearOut(void* const a_outBuf) const; 00564 00565 /*@}*/ 00566 00567 /// Returns true if this IntVectSet has the same IntVects as \a a_ivs 00568 bool 00569 operator==(const IntVectSet& a_ivs) const; 00570 00571 /** Primary sorting criterion: being dense; if *this is dense and \a a_ivs is 00572 not, then *this is smaller, and vice versa. 00573 Secondary sorting criterion: operator< as defined on DenseIntVectSet or 00574 TreeIntVectSet. 00575 In a total tie, returns false. 00576 00577 These criteria might not seem natural, but that doesn't matter as the only 00578 reason for this operator is to support using IntVectSet as the key to an 00579 std::map. 00580 */ 00581 bool 00582 operator<(const IntVectSet& a_ivs) const; 00583 00584 /// Writes a Vector<Box> representation to an output stream. 00585 void 00586 printBoxes(std::ostream& a_ostream) const; 00587 00588 /// Writes a Vector<Box> representation to the parallel stdout. 00589 void 00590 p() const 00591 { 00592 printBoxes(pout()); 00593 } 00594 00595 /// Writes a text representation of an IntVectSet to an output stream 00596 friend 00597 std::ostream& 00598 operator<<(std::ostream& os, const IntVectSet& ivs); 00599 00600 void convert() const; // turn dense rep into Tree rep. very costly. 00601 // it is 'logically' const, but does modify data structures; 00602 00603 // not for public consumption. used in memory tracking. 00604 static long int count; 00605 static long int peakcount; 00606 00607 //set to 6400000 as default. resettable. 00608 static int s_maxDense; 00609 00610 private: 00611 00612 bool m_isdense; 00613 TreeIntVectSet m_ivs; 00614 DenseIntVectSet m_dense; 00615 // not a user function. called by memory tracking system on 00616 // exit to clean up static allocation pools used for the optimization 00617 // of these routines. 00618 friend void dumpmemoryatexit(); 00619 static void clearStaticMemory(); // after this functon is called, you cannot 00620 // do any other operations with IntVectSet. 00621 }; 00622 00623 /// Iterator for an IntVectSet 00624 /** 00625 IVSIterator iterates over every point (IntVect) 00626 in an IntVectSet. It has exactly the same 00627 syntax and sematic as BoxIterator. Typical usage: 00628 00629 \code 00630 IntVectSet ivs; 00631 ... 00632 IVSIterator ivsit (ivs); 00633 for (ivsit.begin(); ivsit.ok(); ++ivsit) 00634 { 00635 IntVect iv = ivsit(); 00636 (do operations involving iv) 00637 } 00638 \endcode 00639 */ 00640 class IVSIterator 00641 { 00642 public: 00643 00644 /** 00645 * A default constructed iterator iterates over an empty IntVectSet. 00646 * It starts in the \c begin() state, and is never \c ok(). 00647 */ 00648 IVSIterator():m_isdense(true) 00649 {} 00650 00651 /** 00652 * Iterates over IntVectSet \a ivs. There is no canonical ordering. 00653 * Starts in the \c begin() state. 00654 */ 00655 IVSIterator(const IntVectSet& ivs); 00656 00657 ~IVSIterator() 00658 {} 00659 00660 /** 00661 * Modifies this IVSIterator to iterate over the IntVectSet \a ivs. 00662 * There is no canonical ordering. Starts in the \c begin() state. 00663 */ 00664 void define(const IntVectSet& ivs); 00665 00666 /// returns the IntVect that this iterator is at 00667 const IntVect& operator()() const ; 00668 00669 /// same as operator() 00670 const IntVect& iv() const 00671 { 00672 return this->operator()(); 00673 } 00674 00675 /// returns true if this iterator is still in its IntVectSet 00676 bool ok() const; 00677 00678 /// move iterator to the next IntVect in its IntVectSet 00679 void operator++(); 00680 00681 /// same as operator++ 00682 void incr() 00683 { 00684 ++(*this); 00685 } 00686 00687 /// initialize this iterator to the first IntVect in its IntVectSet 00688 void begin(); 00689 00690 /// same as begin() 00691 void reset(); 00692 00693 /// move this iterator to after the last IntVect in the set 00694 /** The iterator will be !ok() afterwards. */ 00695 void end(); 00696 00697 private: 00698 bool m_isdense; 00699 DenseIntVectSetIterator m_dense; 00700 TreeIntVectSetIterator m_tree; 00701 }; 00702 00703 #ifndef WRAPPER 00704 00705 inline const IntVect& IVSIterator::operator()() const 00706 { 00707 if (m_isdense) return m_dense(); 00708 return m_tree(); 00709 } 00710 00711 inline bool IVSIterator::ok() const 00712 { 00713 if (m_isdense) return m_dense.ok(); 00714 return m_tree.ok(); 00715 } 00716 00717 inline void IVSIterator::operator++() 00718 { 00719 if (m_isdense) ++m_dense; 00720 else ++m_tree; 00721 } 00722 inline void IVSIterator::reset() 00723 { 00724 begin(); 00725 } 00726 00727 inline void IVSIterator::begin() 00728 { 00729 if (m_isdense) m_dense.begin(); 00730 else m_tree.begin(); 00731 } 00732 00733 inline void IVSIterator::end() 00734 { 00735 if (m_isdense) m_dense.end(); 00736 else m_tree.end(); 00737 } 00738 00739 inline IntVectSet::IntVectSet(): m_isdense(true) 00740 { 00741 count++; 00742 if (count > peakcount) peakcount = count; 00743 } 00744 00745 inline void IntVectSet::define(const IntVectSet& ige_in) 00746 { 00747 *this = ige_in; 00748 } 00749 00750 inline IntVectSet::IntVectSet(const IntVectSet& ige_in) 00751 { 00752 count++; 00753 if (count > peakcount) peakcount = count; 00754 00755 *this = ige_in; 00756 } 00757 00758 inline bool 00759 IntVectSet::isDense() const 00760 { 00761 return m_isdense; 00762 } 00763 00764 /// Refine all the IntVects in an IntVectSet 00765 /** 00766 Creates a new IntVectSet that is a copy of the argument IntVectSet \a ivs 00767 refined by the factor \a iref. It is an error if \a iref <= 0. 00768 Definition of refinement: for each IntVect \p iv in the original 00769 IntVectSet \a ivs, the refined IntVectSet will contain the Box defined by 00770 <b>refine( Box(iv,iv), iref )<b>. 00771 */ 00772 IntVectSet 00773 refine(const IntVectSet& ivs, int iref = 2); 00774 00775 /// Coarsen all the IntVects in an IntVectSet 00776 /** 00777 Creates a new IntVectSet that is a copy of the argument IntVectSet \a ivs coarsened 00778 by the factor \a iref. It is an error if \a iref <= 0. 00779 Definition of coarsening: for each IntVect \p iv in the original 00780 IntVectSet, the refined IntVectSet will contain the IntVect defined by 00781 <b>coarsen( iv, iref )</b>. 00782 */ 00783 IntVectSet 00784 coarsen(const IntVectSet& ivs, int iref = 2); 00785 00786 #endif /* WRAPPER */ 00787 00788 #include "NamespaceFooter.H" 00789 #endif