10 #ifndef _PROTO_PROBLEMDOMAIN_H_ 11 #define _PROTO_PROBLEMDOMAIN_H_ 26 array<bool,DIM> m_isPeriodic;
34 define(a_bx,a_isPeriodic);
38 inline void define(
const Box& a_bx,
const array<bool,DIM> a_isPeriodic)
41 m_isPeriodic = a_isPeriodic;
43 PROTO_ASSERT(m_bx.
low() == Point::Zeros(),
"Low corner of the problem domain not zero");
54 for (
int dir = 0; dir < DIM; dir++)
56 if (!m_isPeriodic[dir])
58 lowCorner[dir] = max(lowCorner[dir],m_bx.
low()[dir]);
59 highCorner[dir] = min(highCorner[dir],m_bx.
high()[dir]);
62 return Box(lowCorner,highCorner);
66 PR_assert( !( (*
this) &
Box(a_pt,a_pt) ).empty() );
67 return a_pt % (Point::Ones()*(m_bx.
high() + 1));
77 inline Point size()
const{
return m_bx.
high()+Point::Ones();};
80 return (m_bx== a_input.m_bx)&&(m_isPeriodic==a_input.m_isPeriodic)
81 &&(m_isDefined==a_input.m_isDefined);
84 inline Box box()
const {
return m_bx;};
92 PR_assert(this->coarsenable(a_refRatio));
94 retval.m_bx = m_bx.
coarsen(a_refRatio);
95 retval.m_isPeriodic = m_isPeriodic;
96 retval.m_isDefined = m_isDefined;
97 PR_assert(m_isDefined);
104 retval.m_bx = m_bx.
refine(a_refRatio);
105 retval.m_isPeriodic = m_isPeriodic;
106 retval.m_isDefined = m_isDefined;
113 os <<
"ProblemDomain: Box = " << a_pd.
box() <<
114 " , periodicity = [" ;
115 for (
int d = 0; d < DIM; d++)
118 if (d < DIM-1) os <<
" , ";
Point high() const
Access High Corner.
Definition: Proto_Box.H:174
Point low() const
Access Low Corner.
Definition: Proto_Box.H:168
Box box() const
Returns Box that defines the *this.
Definition: Proto_ProblemDomain.H:84
std::ostream & operator<<(std::ostream &a_os, const CInterval &a_int)
CInterval IOStream Operator.
Definition: Proto_BoxData.H:259
Box refine(const Point &a_pt) const
Anisotropic Refine Operation.
Definition: Proto_Box.H:477
An interval in DIM dimensional space.
Definition: Proto_Box.H:26
ProblemDomain refine(Point a_refRatio) const
Returns a ProblemDomain with a Box given by this->box.coarsen(a_refRatio).
Definition: Proto_ProblemDomain.H:101
Definition: Proto_Box.H:11
Integer Valued Vector.
Definition: Proto_Point.H:21
ProblemDomain coarsen(Point a_refRatio) const
Returns a ProblemDomain with a box given by this->box.coarsen(a_refRatio).
Definition: Proto_ProblemDomain.H:90
ProblemDomain(const Box &a_bx, const array< bool, DIM > a_isPeriodic)
Constructor constructs a ProblemDomain with Box a_bx, and periodic directions given by a_periodic...
Definition: Proto_ProblemDomain.H:32
array< bool, DIM > periodicflags() const
Returns the array of bools defining the periodic directions.
Definition: Proto_ProblemDomain.H:86
Box coarsen(unsigned int a_ratio) const
Isotropic Coarsen Operation.
Definition: Proto_Box.H:387
bool coarsenable(const int &a_ratio) const
(Isotropic) Coarsenable Query
Definition: Proto_Box.H:455
void define(const Box &a_bx, const array< bool, DIM > a_isPeriodic)
Define - same arguments as constructor, but allows weak construction.
Definition: Proto_ProblemDomain.H:38
Represents a rectangular domain over which a problem can be defined, including periodic images...
Definition: Proto_ProblemDomain.H:22
bool coarsenable(Point a_boxSize) const
Checks to see whether the ProblemDomain Box is coarsenable by a_boxsize.
Definition: Proto_ProblemDomain.H:73