28 #include "NamespaceHeader.H" 116 void unset (
int dir);
123 bool test (
int dir)
const;
250 friend std::ostream&
operator<< (std::ostream& os,
258 friend std::istream&
operator>> (std::istream& is,
265 static unsigned char mask (
int k);
309 itype =
D_TERM6((iv[0]?1:0), | ((iv[1]?1:0)<<1), | ((iv[2]?1:0)<<2),
310 | ((iv[3]?1:0)<<3), | ((iv[4]?1:0)<<4), | ((iv[5]?1:0)<<5));
316 itype =
D_TERM6((iv[0]?1:0), | ((iv[1]?1:0)<<1), | ((iv[2]?1:0)<<2),
317 | ((iv[3]?1:0)<<3), | ((iv[4]?1:0)<<4), | ((iv[5]?1:0)<<5));
326 | (l<<3), | (m<<4), | (n<<5));
536 void define(
const IntVect& small,
558 void define(
const IntVect& small,
569 void define(
const Box& b);
583 const IntVect& smallEnd ()
const;
599 int smallEnd (
int dir)
const;
606 const IntVect& bigEnd ()
const;
615 int bigEnd (
int dir)
const;
624 const int* loVect ()
const;
633 const int* hiVect ()
const;
642 const int* getVect ()
const;
651 long index (
const IntVect& v)
const;
696 int size (
int dir)
const;
705 size_t numPts ()
const;
714 size_t volume ()
const;
723 int longside (
int& dir)
const;
730 int longside ()
const;
739 int shortside (
int& dir)
const;
746 int shortside ()
const;
771 bool contains (
const IntVect& p)
const;
780 bool contains (
const Box& b)
const;
789 bool intersects (
const Box& b)
const;
800 bool intersectsNotEmpty (
const Box& b)
const;
808 bool sameSize (
const Box& b)
const;
815 bool sameType (
const Box &b)
const;
825 bool eq(
const Box& b)
const;
833 bool neq(
const Box& b)
const;
854 bool lt(
const Box& rhs)
const;
882 Box& setSmall (
int dir,
902 Box& setBig (
int dir,
911 Box& setRange (
int dir,
956 Box& convert (
int dir,
980 Box& surroundingNodes_int(
int dir);
1026 Box& enclosedCells_int (
int dir);
1062 Box& shift (
int dir,
1089 Box& shiftHalf (
int dir,
1093 void convertOldToNew(
const IntVect& a_permutation,
1095 const IntVect& a_translation);
1099 void convertNewToOld(
const IntVect& a_permutation,
1101 const IntVect& a_translation);
1245 Box operator& (
const Box&)
const;
1254 Box& operator&= (
const Box&);
1257 friend Box adjCellBox (
const Box& b,
1349 Box& growLo (
int idir,
1357 Box& growDir (
int a_idir,
1371 Box& growHi (
int idir,
1404 int refinement_ratio);
1434 const IntVect& refinement_ratio);
1446 return (test==*
this);
1484 int refinement_ratio);
1520 const IntVect& refinement_ratio);
1535 const int* shv)
const;
1569 void degenerate(
Box& a_to,
const SliceSpec& a_sliceSpec,
1570 bool* a_outofbounds=0 )
const;
1579 friend std::ostream&
operator<< (std::ostream& os,
1587 friend std::istream&
operator>> (std::istream& os,
1602 void dumpOn (std::ostream& strm)
const;
1625 void computeBoxLen ();
1626 void computeBoxLenNotEmpty();
1629 static void setTempestOutputFormat(
bool );
1632 Box(Proto::Box a_box)
1634 define(a_box.low(), a_box.high());
1637 operator Proto::Box()
const 1639 return Proto::Box(smallend, bigend);
1654 #include "NamespaceFooter.H" 1666 void linearIn(CH_XDIR::Box& a_outputT,
const void*
const a_inBuf);
1670 void linearOut(
void*
const a_outBuf,
const CH_XDIR::Box& a_inputT);
1690 #include "NamespaceHeader.H" 1718 const IntVect& refinement_ratio);
1720 int refinement_ratio);
1722 const IntVect& refinement_ratio);
1724 int refinement_ratio);
1762 retval = smallEnd();
1779 return smallend[dir];
1807 return btype.ixType();
1814 return btype.ixType(dir);
1822 bigend[1]-smallend[1]+1,
1823 bigend[2]-smallend[2]+1,
1824 bigend[3]-smallend[3]+1,
1825 bigend[4]-smallend[4]+1,
1826 bigend[5]-smallend[5]+1));
1834 return bigend[dir]-smallend[dir]+1;
1841 return smallend.getVect();
1848 return bigend.getVect();
1855 return smallend.getVect();
1865 return D_TERM6((bigend[0] < smallend[0]),
1866 || (bigend[1] < smallend[1]),
1867 || (bigend[2] < smallend[2]),
1868 || (bigend[3] < smallend[3]),
1869 || (bigend[4] < smallend[4]),
1870 || (bigend[5] < smallend[5]) );
1882 return (bigend >= smallend);
1891 return (p >= smallend && p <= bigend);
1898 return btype == b.
btype;
1941 return !btype.any();
1949 long result = v.
vect[0]-smallend.vect[0];
1950 #if CH_SPACEDIM == 1 1952 #elif CH_SPACEDIM==2 1953 int len0=(bigend[0]-smallend[0]+1);
1954 result += len0*(v.
vect[1]-smallend.vect[1]);
1955 #elif CH_SPACEDIM==3 1956 long int len0=(bigend[0]-smallend[0]+1);
1957 long int len1=(bigend[1]-smallend[1]+1);
1958 long int dif1= v.
vect[1]-smallend.vect[1];
1959 long int dif2= v.
vect[2]-smallend.vect[2];
1960 result += len0*(dif1
1962 #elif CH_SPACEDIM==4 1963 int len0=(bigend[0]-smallend[0]+1);
1964 int len1=(bigend[1]-smallend[1]+1);
1965 int len2=(bigend[2]-smallend[2]+1);
1966 result += len0*((v.
vect[1]-smallend.vect[1])
1967 +len1*((v.
vect[2]-smallend.vect[2])
1968 +len2*(v.
vect[3]-smallend[3])));
1969 #elif CH_SPACEDIM==5 1970 int len0=(bigend[0]-smallend[0]+1);
1971 int len1=(bigend[1]-smallend[1]+1);
1972 int len2=(bigend[2]-smallend[2]+1);
1973 int len3=(bigend[3]-smallend[3]+1);
1974 result += len0*(v.
vect[1]-smallend.vect[1]
1975 +len1*(v.
vect[2]-smallend.vect[2]
1976 +len2*(v.
vect[3]-smallend[3]
1977 +len3*(v.
vect[4]-smallend[4]))));
1978 #elif CH_SPACEDIM==6 1979 int len0=(bigend[0]-smallend[0]+1);
1980 int len1=(bigend[1]-smallend[1]+1);
1981 int len2=(bigend[2]-smallend[2]+1);
1982 int len3=(bigend[3]-smallend[3]+1);
1983 int len4=(bigend[4]-smallend[4]+1);
1984 result += len0*(v.
vect[1]-smallend.vect[1]
1985 +len1*(v.
vect[2]-smallend.vect[2]
1986 +len2*(v.
vect[3]-smallend[3]
1987 +len3*(v.
vect[4]-smallend[4]
1988 +len4*(v.
vect[5]-smallend[5])))));
2039 smallend.setVal(dir,sm_index);
2062 bigend.setVal(dir,bg_index);
2075 smallend.setVal(dir,sm_index);
2076 bigend.setVal(dir,sm_index+n_cells-1);
2088 smallend.
shift(dir,nzones);
2089 bigend.
shift(dir,nzones);
2113 IntVect shft(typ - btype.ixType());
2129 bigend.
shift(dir,1);
2148 bigend.
shift(dir,-1);
2211 return(
Box().convert(btype));
2219 return Box(small,big,btype);
2249 return(
Box().convert(btype));
2257 return Box(small,big,btype);
2267 smallend.diagShift(-i);
2268 bigend.diagShift(i);
2269 if (!(bigend >= smallend)) *
this =
Box().
convert(btype);
2287 if (!(big >= small))
2302 if (!(bigend >= smallend)) *
this =
Box().
convert(btype);
2321 if (!(big >= small))
2339 smallend.
shift(idir, -n_cell);
2340 bigend.
shift(idir, n_cell);
2341 if (!(bigend >= smallend)) *
this =
Box().
convert(btype);
2354 smallend.
shift(idir, -n_cell);
2355 if (!(bigend >= smallend)) *
this =
Box().
convert(btype);
2369 growLo(idir, n_cell);
2373 growHi(idir, n_cell);
2385 bigend.
shift(idir,n_cell);
2386 if (!(bigend >= smallend)) *
this =
Box().
convert(btype);
2403 #include "NamespaceFooter.H" #define D_DECL6(a, b, c, d, e, f)
Definition: CHArray.H:39
Box & coarsen(int refinement_ratio)
Box & operator-=(const IntVect &v)
Definition: Box.H:2225
void unset(int dir)
Definition: Box.H:338
bool operator<(const Box &rhs) const
Definition: Box.H:2237
Box & refine(int refinement_ratio)
refinement
C::self_type operator-(const C &, const C &)
Definition: GenericArithmeticI.H:124
IntVect size() const
size functions
Definition: Box.H:1819
const int * hiVect() const
Definition: Box.H:1846
#define D_TERM6(a, b, c, d, e, f)
Definition: CHArray.H:40
bool operator!=(const Box &b) const
Definition: Box.H:1932
#define CH_SPACEDIM
Definition: SPACE.H:51
#define CH_assert(cond)
Definition: CHArray.H:37
Box refine(const Box &b, const IntVect &refinement_ratio)
bool operator==(const Box &b) const
Definition: Box.H:1925
bool test(int dir) const
Definition: Box.H:345
friend std::istream & operator>>(std::istream &is, IndexType &itype)
const int * getVect() const
Definition: Box.H:1853
bool cellCentered() const
Definition: Box.H:1939
bool sameSize(const Box &b) const
Definition: Box.H:1912
bool operator!=(const IndexType &t) const
Definition: Box.H:401
Box coarsen(const Box &b, const IntVect &refinement_ratio)
one dimensional dynamic array
Definition: Vector.H:53
Box operator &(const Box &) const
intersection functions
friend std::ostream & operator<<(std::ostream &os, const IndexType &itype)
const int * loVect() const
Definition: Box.H:1839
void clear()
Definition: Box.H:359
IndexType btype
Definition: Box.H:1649
Definition: SliceSpec.H:41
void flip(int i)
Definition: Box.H:380
IndexTM< T, N > diagShift(const IndexTM< T, N > &a_p, T a_s)
Definition: IndexTMI.H:388
IntVect type() const
Definition: Box.H:1805
bool contains(const IntVect &p) const
Definition: Box.H:1887
IndexType()
Definition: Box.H:286
Box copy() const
Definition: Box.H:571
int isEmpty(const box2d *)
Box operator-(const IntVect &v) const
Definition: Box.H:2245
void linearOut(void *const a_outBuf, const CH_XDIR::Box &a_inputT)
bool ok() const
Definition: Box.H:373
IntVect sideEnd(Side::LoHiSide a_side) const
Definition: Box.H:1758
Box minBox(const Box &b1, const Box &b2)
void setType(int dir, CellIndex t)
Definition: Box.H:422
const IntVect & bigEnd() const
Definition: Box.H:1784
C::self_type operator+(const C &, const C &)
Definition: GenericArithmeticI.H:120
IntVect bigend
Definition: Box.H:1647
Box & setSmall(const IntVect &sm)
{ Modification Functions}
Definition: Box.H:2023
IntVect ixType() const
Definition: Box.H:444
static const IntVect Unit
Definition: IntVect.H:663
static IndexType TheNodeType()
const IntVect & smallEnd() const
{ Accessors}
Definition: Box.H:1770
int vect[CH_SPACEDIM]
Definition: IntVect.H:705
Box surroundingNodes(const Box &b, int dir)
Definition: Box.H:2161
IndexType ixType() const
centering
Definition: Box.H:1798
Box bdryBox(const Box &b, int dir, Side::LoHiSide a_sd, int len=1)
Box & growDir(int a_idir, const Side::LoHiSide &a_sd, int a_cell)
Definition: Box.H:2363
Box grow(const Box &b, int i)
Definition: Box.H:2277
Box adjCellLo(const Box &b, int dir, int len=1)
static IndexType TheCellType()
void linearIn(CH_XDIR::Box &a_outputT, const void *const a_inBuf)
Box enclosedCells(const Box &b, int dir)
Definition: Box.H:2178
LoHiSide
Definition: LoHiSide.H:27
void set(int dir)
Definition: Box.H:331
bool nodeCentered() const
Definition: Box.H:415
Box & setRange(int dir, int sm_index, int n_cells=1)
Definition: Box.H:2069
IntVect smallend
Definition: Box.H:1646
static const IntVect Zero
Definition: IntVect.H:658
Box adjCellHi(const Box &b, int dir, int len=1)
bool sameType(const Box &b) const
Definition: Box.H:1896
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
long index(const IntVect &v) const
Definition: Box.H:1947
int linearSize(const CH_XDIR::Box &a_input)
void setall()
Definition: Box.H:352
static bool s_tempestOutputFormat
Definition: Box.H:1651
unsigned char itype
Definition: Box.H:270
Box & convert(IndexType typ)
centering type conversion functions
Handle to a particular group in an HDF file.
Definition: CH_HDF5.H:294
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: LoHiSide.H:30
Cell-Based or Node-Based Indices.
Definition: Box.H:45
void computeBoxLen()
{ Box Constants}
Definition: Box.H:1998
bool operator==(const IndexType &t) const
Definition: Box.H:387
Box & shift(int dir, int nzones)
shift functions
Definition: Box.H:2083
static unsigned char mask(int k)
Definition: Box.H:280
Box & operator+=(const IntVect &v)
Definition: Box.H:2195
bool cellCentered() const
Definition: Box.H:408
Box & grow(int i)
grow functions
Definition: Box.H:2263
Box & setBig(const IntVect &bg)
Definition: Box.H:2046
Box & growLo(int idir, int n_cell=1)
Definition: Box.H:2349
Box bdryHi(const Box &b, int dir, int len=1)
Box operator+(const IntVect &v) const
Definition: Box.H:2207
CellIndex
Definition: Box.H:53
bool coarsenable(int refrat) const
coarsening
Definition: Box.H:1441
IndexType & operator=(const IndexType &rhs)
Definition: Box.H:300
void computeBoxLenNotEmpty()
Definition: Box.H:2014
bool isEmpty() const
{ Comparison Functions}
Definition: Box.H:1862
bool ok() const
Definition: Box.H:1875
bool any() const
Definition: Box.H:366
Box bdryLo(const Box &b, int dir, int len=1)
bool operator<(const IndexType &t) const
Definition: Box.H:394
Box & growHi(int idir, int n_cell=1)
Definition: Box.H:2380
int operator[](int dir) const
Definition: Box.H:437