11 #ifndef _PROBLEMDOMAIN_H_
12 #define _PROBLEMDOMAIN_H_
24 #include "NamespaceHeader.H"
76 inline bool ok()
const;
172 const bool* a_isPeriodic);
191 const bool* a_isPeriodic);
210 void define(
const Box& a_domBox,
const bool* a_isPeriodic);
229 const bool* a_isPeriodic);
248 const bool* a_isPeriodic);
287 int size (
const int& a_idir)
const;
553 int a_refinement_ratio);
570 const IntVect& a_refinement_ratio);
590 int a_refinement_ratio);
607 const IntVect& a_refinement_ratio);
620 friend std::ostream&
operator<< (std::ostream& os,
626 friend std::istream&
operator>> (std::istream& is,
629 void shiftIt(
Box& a_box,
int shiftIndex)
const ;
635 void dumpOn (std::ostream& strm)
const;
712 : m_index(100), m_shift_vectors()
779 for (
int dir=0; dir<
SpaceDim; dir++)
788 : m_domainBox(b.m_domainBox), m_shiftIt(b.m_shiftIt)
790 for (
int dir=0; dir<
SpaceDim; dir++)
802 for (
int dir=0; dir<
SpaceDim; dir++)
820 for (
int dir=0; dir<
SpaceDim; dir++)
837 return !(*
this == a_otherDomain);
845 for (
int dir=0; dir<
SpaceDim; dir++)
1079 for (
int dir = 0; dir <
SpaceDim; dir++)
1081 if (b.
type(dir) != domainBox.
type(dir))
1118 #include "NamespaceFooter.H"
Box m_domainBox
Definition: ProblemDomain.H:649
Box m_quadrant[D_TERM6(3,*3,*3,*3,*3,*3)]
Definition: ProblemDomain.H:698
bool image(IntVect &p) const
Returns the periodic image of this IntVect inside of the ProblemDomain.
Definition: ProblemDomain.H:1007
friend Box bdryHi(const ProblemDomain &a_pd, int a_dir, int a_len=1)
Returns a face-centered Box at the high side of a_pd.
#define D_TERM6(a, b, c, d, e, f)
Definition: CHArray.H:40
#define CH_assert(cond)
Definition: CHArray.H:37
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
ProblemDomain & growLo(int idir, int n_cell=1)
Grow this ProblemDomain on the low side.
Definition: ProblemDomain.H:936
int m_index
Definition: ProblemDomain.H:102
void shift(const IntVect &a_shift)
Definition: ProblemDomain.H:611
bool intersectsNotEmpty(const Box &a_box) const
Returns true if this ProblemDomain and the argument intersect.
bool contains_box(const Box &b) const
Equivalent to contains() function.
Definition: ProblemDomain.H:318
friend std::istream & operator>>(std::istream &is, ProblemDomain &bx)
Read from istream.
friend void operator&=(Box &a_box, const ProblemDomain &a_probdomain)
Modifies a_box to be the intersection of a_box and a_probdomain.
friend Box adjCellLo(const ProblemDomain &a_pd, int a_dir, int a_len=1)
Returns the cell-centered Box adjacent to the low side of a_pd.
friend Box operator&(const Box &a_box, const ProblemDomain &a_probdomain)
Returns a Box which is the interesection of a_box and a_probdomain.
IntVect size() const
size functions
Definition: Box.H:1814
bool isEmpty() const
Returns true if this ProblemDomain is empty or undefined.
Definition: ProblemDomain.H:959
ProblemDomain & operator=(const ProblemDomain &b)
The assignment operator.
Definition: ProblemDomain.H:842
ShiftIterator shiftIterator() const
Returns the shiftIterator for this ProblemDomain.
Definition: ProblemDomain.H:952
bool m_isPeriodic[SpaceDim]
Definition: ProblemDomain.H:644
ProblemDomain m_domain
Definition: ProblemDomain.H:697
const int SpaceDim
Definition: SPACE.H:39
const Box & box() const
Definition: ProblemDomain.H:681
bool ok()
Definition: ProblemDomain.H:676
void incr()
Equivalent to the ++ operator.
Definition: ProblemDomain.H:70
int index() const
which periodic image is this
Definition: ProblemDomain.H:79
void setPeriodic(int a_dir, bool a_isPeriodic)
Sets whether BC is periodic in direction a_dir (true == periodic)
ShiftIterator()
Basic constructor.
Definition: ProblemDomain.H:711
friend Box adjCellHi(const ProblemDomain &a_pd, int a_dir, int a_len=1)
Returns the cell-centered Box adjacent to the low side of a_pd.
void begin(const Box &a_box)
Definition: ProblemDomain.H:667
bool isPeriodic() const
Returns true is BC is periodic in any direction.
Definition: ProblemDomain.H:882
IntVect i() const
Equivalent to the () operator.
Definition: ProblemDomain.H:62
Class to manage box-shifting used to enforce periodic BC's.
Definition: ProblemDomain.H:33
void computeShifts(const bool *a_isPeriodic)
Recompute shift vectors based on periodic directions.
void define(const ProblemDomain &a_domain)
bool intersects(const Box &a_box) const
Returns true if this ProblemDomain and the argument intersect.
void begin()
Equivalent to reset()
Definition: ProblemDomain.H:763
bool ok() const
Is the iterator still within its range of shift vectors?
Definition: ProblemDomain.H:749
friend std::ostream & operator<<(std::ostream &os, const ProblemDomain &bx)
Write an ASCII representation to the ostream.
const IntVect & bigEnd() const
Definition: Box.H:1779
ShiftIterator m_shiftIt
Definition: ProblemDomain.H:654
const Box & domainBox() const
Returns the logical computational domain.
Definition: ProblemDomain.H:868
Vector< IntVect > m_shift_vectors
Definition: ProblemDomain.H:104
void insertImages(std::list< Box > &a_list, const Box &a_box) const
int m_counter
Definition: ProblemDomain.H:702
bool isEmpty() const
{ Comparison Functions}
Definition: Box.H:1863
IntVect type() const
Definition: Box.H:1800
static const IntVect Zero
Definition: IntVect.H:627
void define(const Box &a_domBox)
Construct ProblemDomain with a_domBox as computational domain.
void checkDefine(const ProblemDomain &a_domain)
Definition: ProblemDomain.H:691
ProblemDomain & refine(int a_refinement_ratio)
Refine this problem domain.
bool operator==(const ProblemDomain &a_otherDomain) const
Returns true if the two domain are equivalent.
Definition: ProblemDomain.H:810
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
ProblemDomain & growHi(int idir, int n_cell=1)
Grow this ProblemDomain on the high side.
Definition: ProblemDomain.H:944
void unshiftIt(Box &a_box, int shiftIndex) const
Definition: ProblemDomain.H:860
ImageIterator(const ProblemDomain &a_domain)
Definition: ProblemDomain.H:660
void operator++()
Increment to the next shift unit vector.
Definition: ProblemDomain.H:742
bool contains(const IntVect &p) const
Definition: Box.H:1888
Handle to a particular group in an HDF file.
Definition: CH_HDF5.H:267
IntVect m_shifter[D_TERM6(3,*3,*3,*3,*3,*3)]
Definition: ProblemDomain.H:699
friend Box bdryLo(const ProblemDomain &a_pd, int a_dir, int a_len=1)
Returns a face-centered Box at the low side of a_pd.
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
ProblemDomain & coarsen(int a_refinement_ratio)
Coarsen this ProblemDomain.
bool periodicAdjacent(const Box &a_box) const
Returns true if this argument is adjacent to a periodic boundary.
IntVect operator()() const
Returns the current shift unit vector.
Definition: ProblemDomain.H:734
ProblemDomain()
The default constructor. The constructed domain box is empty.
Definition: ProblemDomain.H:776
bool contains(const IntVect &p) const
Returns true if argument is contained within this ProblemDomain.
Definition: ProblemDomain.H:980
ProblemDomain grow(const ProblemDomain &pd, int i)
Definition: ProblemDomain.H:902
size_t size() const
Definition: Vector.H:177
ShiftIterator & operator=(const ShiftIterator &a_src)
Assignment operator.
Definition: ProblemDomain.H:725
void reset()
Reset to first shift unit vector.
Definition: ProblemDomain.H:756
Box & shift(int dir, int nzones)
shift functions
Definition: Box.H:2088
Box m_box
Definition: ProblemDomain.H:700
Box & grow(int i)
grow functions
Definition: Box.H:2268
Box & growLo(int idir, int n_cell=1)
Definition: Box.H:2354
ProblemDomain & grow(int i)
Grows (or shrinks) the domain Box by i in all directions.
Definition: ProblemDomain.H:894
Definition: ProblemDomain.H:657
IntVect size() const
Return the size of the domainBox.
Definition: ProblemDomain.H:973
Box m_current
Definition: ProblemDomain.H:701
~ShiftIterator()
Destructor.
const IntVect & smallEnd() const
{ Accessors}
Definition: Box.H:1765
bool operator!=(const ProblemDomain &a_otherDomain) const
Returns true if the two domain are not equivalent.
Definition: ProblemDomain.H:835
void end()
Skip the iterator to the end.
Definition: ProblemDomain.H:770
Box & growHi(int idir, int n_cell=1)
Definition: Box.H:2385
void shiftIt(Box &a_box, int shiftIndex) const
Definition: ProblemDomain.H:854
const ProblemDomain & domain() const
Definition: ProblemDomain.H:686
void dumpOn(std::ostream &strm) const
Gives more detail than printOn.
const IntVect & operator[](int index) const
Definition: ProblemDomain.H:84