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);
202 void define(
const Box& a_domBox);
210 void define(
const Box& a_domBox,
const bool* a_isPeriodic);
217 void define (
const IntVect& small,
227 void define (
const IntVect& small,
229 const bool* a_isPeriodic);
236 void define (
const IntVect& small,
246 void define (
const IntVect& small,
248 const bool* a_isPeriodic);
260 const Box& domainBox()
const;
265 bool isPeriodic(
int a_dir)
const;
270 bool isPeriodic()
const;
287 int size (
const int& a_idir)
const;
301 bool contains (
const IntVect& p)
const;
315 bool contains (
const Box& b)
const;
331 bool intersects (
const Box& a_box)
const;
342 bool intersectsNotEmpty (
const Box& a_box)
const;
347 bool periodicAdjacent(
const Box& a_box)
const;
352 void insertImages(std::list<Box>& a_list,
const Box& a_box)
const;
359 bool intersects(
const Box& box1,
const Box& box2)
const;
391 void setPeriodic(
int a_dir,
bool a_isPeriodic);
535 Box operator& (
const Box& a_b)
const;
553 int a_refinement_ratio);
570 const IntVect& a_refinement_ratio);
590 int a_refinement_ratio);
607 const IntVect& a_refinement_ratio);
613 m_domainBox.shift(a_shift);
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 ;
630 void unshiftIt(
Box& a_box,
int shiftIndex)
const ;
635 void dumpOn (std::ostream& strm)
const;
693 if (!(m_domain == a_domain)) define(a_domain);
779 for (
int dir=0; dir<
SpaceDim; dir++)
781 m_isPeriodic[dir] =
false;
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
bool contains(const IntVect &p) const
Returns true if argument is contained within this ProblemDomain.
Definition: ProblemDomain.H:980
bool contains_box(const Box &b) const
Equivalent to contains() function.
Definition: ProblemDomain.H:318
IntVect size() const
size functions
Definition: Box.H:1814
#define D_TERM6(a, b, c, d, e, f)
Definition: CHArray.H:40
#define CH_assert(cond)
Definition: CHArray.H:37
Box refine(const Box &b, const IntVect &refinement_ratio)
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
const Box & box() const
Definition: ProblemDomain.H:681
IntVect i() const
Equivalent to the () operator.
Definition: ProblemDomain.H:62
IntVect type() const
Definition: Box.H:1800
bool contains(const IntVect &p) const
Definition: Box.H:1888
ProblemDomain & operator=(const ProblemDomain &b)
The assignment operator.
Definition: ProblemDomain.H:842
IntVect size() const
Return the size of the domainBox.
Definition: ProblemDomain.H:973
int isEmpty(const box2d *)
bool m_isPeriodic[SpaceDim]
Definition: ProblemDomain.H:644
IntVect operator()() const
Returns the current shift unit vector.
Definition: ProblemDomain.H:734
ShiftIterator shiftIterator() const
Returns the shiftIterator for this ProblemDomain.
Definition: ProblemDomain.H:952
ProblemDomain m_domain
Definition: ProblemDomain.H:697
const int SpaceDim
Definition: SPACE.H:39
bool ok()
Definition: ProblemDomain.H:676
void incr()
Equivalent to the ++ operator.
Definition: ProblemDomain.H:70
const ProblemDomain & domain() const
Definition: ProblemDomain.H:686
IndexTM< T, N > coarsen(const IndexTM< T, N > &a_p, T a_s)
Definition: IndexTMI.H:432
ShiftIterator()
Basic constructor.
Definition: ProblemDomain.H:711
const IntVect & bigEnd() const
Definition: Box.H:1779
std::ostream & operator<<(std::ostream &a_os, const IndexTM< T, N > &a_iv)
void begin(const Box &a_box)
Definition: ProblemDomain.H:667
Class to manage box-shifting used to enforce periodic BC's.
Definition: ProblemDomain.H:33
bool isPeriodic() const
Returns true is BC is periodic in any direction.
Definition: ProblemDomain.H:882
void shiftIt(Box &a_box, int shiftIndex) const
Definition: ProblemDomain.H:854
const IntVect & smallEnd() const
{ Accessors}
Definition: Box.H:1765
void computeShifts(const bool *a_isPeriodic)
Recompute shift vectors based on periodic directions.
std::istream & operator>>(std::istream &a_os, IndexTM< T, N > &a_iv)
void begin()
Equivalent to reset()
Definition: ProblemDomain.H:763
bool operator==(const ProblemDomain &a_otherDomain) const
Returns true if the two domain are equivalent.
Definition: ProblemDomain.H:810
bool isEmpty() const
Returns true if this ProblemDomain is empty or undefined.
Definition: ProblemDomain.H:959
Box adjCellLo(const Box &b, int dir, int len=1)
ShiftIterator m_shiftIt
Definition: ProblemDomain.H:654
Vector< IntVect > m_shift_vectors
Definition: ProblemDomain.H:104
size_t size() const
Definition: Vector.H:177
int m_counter
Definition: ProblemDomain.H:702
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
bool image(IntVect &p) const
Returns the periodic image of this IntVect inside of the ProblemDomain.
Definition: ProblemDomain.H:1007
Box adjCellHi(const Box &b, int dir, int len=1)
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
bool ok() const
Is the iterator still within its range of shift vectors?
Definition: ProblemDomain.H:749
ImageIterator(const ProblemDomain &a_domain)
Definition: ProblemDomain.H:660
void operator++()
Increment to the next shift unit vector.
Definition: ProblemDomain.H:742
Handle to a particular group in an HDF file.
Definition: CH_HDF5.H:267
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
ProblemDomain()
The default constructor. The constructed domain box is empty.
Definition: ProblemDomain.H:776
int index() const
which periodic image is this
Definition: ProblemDomain.H:79
ProblemDomain grow(const ProblemDomain &pd, int i)
Definition: ProblemDomain.H:902
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
bool operator!=(const ProblemDomain &a_otherDomain) const
Returns true if the two domain are not equivalent.
Definition: ProblemDomain.H:835
Box m_box
Definition: ProblemDomain.H:700
Box & grow(int i)
grow functions
Definition: Box.H:2268
const IntVect & operator[](int index) const
Definition: ProblemDomain.H:84
Box & growLo(int idir, int n_cell=1)
Definition: Box.H:2354
Box bdryHi(const Box &b, int dir, int len=1)
ProblemDomain & grow(int i)
Grows (or shrinks) the domain Box by i in all directions.
Definition: ProblemDomain.H:894
Definition: ProblemDomain.H:657
const Box & domainBox() const
Returns the logical computational domain.
Definition: ProblemDomain.H:868
bool isEmpty() const
{ Comparison Functions}
Definition: Box.H:1863
Box m_current
Definition: ProblemDomain.H:701
~ShiftIterator()
Destructor.
Box bdryLo(const Box &b, int dir, int len=1)
void end()
Skip the iterator to the end.
Definition: ProblemDomain.H:770
Box & growHi(int idir, int n_cell=1)
Definition: Box.H:2385