11 #ifndef _PROBLEMDOMAIN_H_
12 #define _PROBLEMDOMAIN_H_
24 #include "NamespaceHeader.H"
87 inline bool ok()
const;
183 const bool* a_isPeriodic);
202 const bool* a_isPeriodic);
221 void define(
const Box& a_domBox,
const bool* a_isPeriodic);
240 const bool* a_isPeriodic);
259 const bool* a_isPeriodic);
304 int size (
const int& a_idir)
const;
569 int a_refinement_ratio);
586 const IntVect& a_refinement_ratio);
606 int a_refinement_ratio);
623 const IntVect& a_refinement_ratio);
640 friend std::ostream&
operator<< (std::ostream& os,
646 friend std::istream&
operator>> (std::istream& is,
649 void shiftIt(
Box& a_box,
int shiftIndex)
const ;
655 void dumpOn (std::ostream& strm)
const;
732 : m_index(100), m_shift_vectors()
799 for (
int dir=0; dir<
SpaceDim; dir++)
808 : m_domainBox(b.m_domainBox), m_shiftIt(b.m_shiftIt)
810 for (
int dir=0; dir<
SpaceDim; dir++)
822 for (
int dir=0; dir<
SpaceDim; dir++)
840 for (
int dir=0; dir<
SpaceDim; dir++)
857 return !(*
this == a_otherDomain);
865 for (
int dir=0; dir<
SpaceDim; dir++)
1098 for (
int dir = 0; dir <
SpaceDim; dir++)
1100 if (b.
type(dir) != domainBox.
type(dir))
1225 #include "NamespaceFooter.H"
Box m_domainBox
Definition: ProblemDomain.H:669
Box m_quadrant[D_TERM6(3,*3,*3,*3,*3,*3)]
Definition: ProblemDomain.H:718
bool image(IntVect &p) const
Returns the periodic image of this IntVect inside of the ProblemDomain.
Definition: ProblemDomain.H:1026
#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:141
ProblemDomain & growLo(int idir, int n_cell=1)
Grow this ProblemDomain on the low side.
Definition: ProblemDomain.H:955
void shift(const IntVect &a_shift)
Definition: ProblemDomain.H:626
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:335
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 bdryLo(const ProblemDomain &a_pd, int a_dir, int a_len)
Returns a face-centered Box at the low side of a_pd.
bool operator<(const ProblemDomain &rhs) const
Definition: ProblemDomain.H:631
friend Box operator&(const Box &a_box, const ProblemDomain &a_probdomain)
Returns a Box which is the interesection of a_box and a_probdomain.
const bool * isPeriodicVect() const
Returns bool[SpaceDim vector of periodicity info.
Definition: ProblemDomain.H:281
IntVect size() const
size functions
Definition: Box.H:1803
bool isEmpty() const
Returns true if this ProblemDomain is empty or undefined.
Definition: ProblemDomain.H:978
ProblemDomain & operator=(const ProblemDomain &b)
The assignment operator.
Definition: ProblemDomain.H:862
ShiftIterator shiftIterator() const
Returns the shiftIterator for this ProblemDomain.
Definition: ProblemDomain.H:971
bool m_isPeriodic[SpaceDim]
Definition: ProblemDomain.H:664
ProblemDomain m_domain
Definition: ProblemDomain.H:717
const int SpaceDim
Definition: SPACE.H:38
const Box & box() const
Definition: ProblemDomain.H:701
bool ok()
Definition: ProblemDomain.H:696
void incr()
Equivalent to the ++ operator.
Definition: ProblemDomain.H:81
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:731
void begin(const Box &a_box)
Definition: ProblemDomain.H:687
bool isPeriodic() const
Returns true if BC is periodic in any direction.
Definition: ProblemDomain.H:901
IntVect i() const
Equivalent to the () operator.
Definition: ProblemDomain.H:73
Class to manage box-shifting used to enforce periodic BC's.
Definition: ProblemDomain.H:33
friend Box adjCellLo(const ProblemDomain &a_pd, int a_dir, int a_len)
Returns the cell-centered Box adjacent to the low side of a_pd.
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:783
bool ok() const
Is the iterator still within its range of shift vectors?
Definition: ProblemDomain.H:769
friend std::ostream & operator<<(std::ostream &os, const ProblemDomain &bx)
Write an ASCII representation to the ostream.
const IntVect & bigEnd() const
Definition: Box.H:1768
ShiftIterator m_shiftIt
Definition: ProblemDomain.H:674
const Box & domainBox() const
Returns the logical computational domain.
Definition: ProblemDomain.H:887
Vector< IntVect > m_shift_vectors
Definition: ProblemDomain.H:115
void insertImages(std::list< Box > &a_list, const Box &a_box) const
int m_counter
Definition: ProblemDomain.H:722
bool isEmpty() const
{ Comparison Functions}
Definition: Box.H:1846
IntVect type() const
Definition: Box.H:1789
static const IntVect Zero
Definition: IntVect.H:654
void define(const Box &a_domBox)
Construct ProblemDomain with a_domBox as computational domain.
friend Box bdryHi(const ProblemDomain &a_pd, int a_dir, int a_len)
Returns a face-centered Box at the high side of a_pd.
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.
void checkDefine(const ProblemDomain &a_domain)
Definition: ProblemDomain.H:711
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:830
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:963
void unshiftIt(Box &a_box, int shiftIndex) const
Definition: ProblemDomain.H:880
ImageIterator(const ProblemDomain &a_domain)
Definition: ProblemDomain.H:680
void operator++()
Increment to the next shift unit vector.
Definition: ProblemDomain.H:762
bool contains(const IntVect &p) const
Definition: Box.H:1871
friend Box adjCellHi(const ProblemDomain &a_pd, int a_dir, int a_len)
Returns the cell-centered Box adjacent to the low side of a_pd.
Handle to a particular group in an HDF file.
Definition: CH_HDF5.H:292
IntVect m_shifter[D_TERM6(3,*3,*3,*3,*3,*3)]
Definition: ProblemDomain.H:719
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
ProblemDomain & coarsen(int a_refinement_ratio)
Coarsen this ProblemDomain.
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.
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:754
ProblemDomain()
The default constructor. The constructed domain box is empty.
Definition: ProblemDomain.H:796
bool contains(const IntVect &p) const
Returns true if argument is contained within this ProblemDomain.
Definition: ProblemDomain.H:999
ProblemDomain grow(const ProblemDomain &pd, int i)
Definition: ProblemDomain.H:921
size_t size() const
Definition: Vector.H:192
ShiftIterator & operator=(const ShiftIterator &a_src)
Assignment operator.
Definition: ProblemDomain.H:745
void reset()
Reset to first shift unit vector.
Definition: ProblemDomain.H:776
Box & shift(int dir, int nzones)
shift functions
Definition: Box.H:2067
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.
unsigned int index() const
which periodic image is this
Definition: ProblemDomain.H:90
Box m_box
Definition: ProblemDomain.H:720
Box & grow(int i)
grow functions
Definition: Box.H:2247
Box & growLo(int idir, int n_cell=1)
Definition: Box.H:2333
ProblemDomain & grow(int i)
Grows (or shrinks) the domain Box by i in all directions.
Definition: ProblemDomain.H:913
Definition: ProblemDomain.H:677
IntVect size() const
Return the size of the domainBox.
Definition: ProblemDomain.H:992
Box m_current
Definition: ProblemDomain.H:721
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.
~ShiftIterator()
Destructor.
const IntVect & smallEnd() const
{ Accessors}
Definition: Box.H:1754
bool operator!=(const ProblemDomain &a_otherDomain) const
Returns true if the two domain are not equivalent.
Definition: ProblemDomain.H:855
void end()
Skip the iterator to the end.
Definition: ProblemDomain.H:790
unsigned int m_index
Definition: ProblemDomain.H:113
Box & growHi(int idir, int n_cell=1)
Definition: Box.H:2364
void shiftIt(Box &a_box, int shiftIndex) const
Definition: ProblemDomain.H:874
const ProblemDomain & domain() const
Definition: ProblemDomain.H:706
void dumpOn(std::ostream &strm) const
Gives more detail than printOn.
const IntVect & operator[](int index) const
Definition: ProblemDomain.H:95