chombo-discharge
CD_RealBox.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_RealBox_H
13 #define CD_RealBox_H
14 
15 // Chombo includes
16 #include <RealVect.H>
17 #include <Box.H>
18 
19 // Our includes
20 #include <CD_NamespaceHeader.H>
21 
25 class RealBox
26 {
27 public:
31  RealBox();
32 
38  RealBox(const RealVect a_lo, const RealVect a_hi);
39 
47  RealBox(const Box a_box, const RealVect a_probLo, const Real a_dx);
48 
52  ~RealBox();
53 
57  RealVect
58  getLo() const;
59 
63  RealVect
64  getHi() const;
65 
69  Vector<RealVect>
70  getCorners() const;
71 
76  bool
77  intersect(const RealBox& a_box) const;
78 
83  bool
84  isPointInside(const RealVect a_point) const;
85 
91  bool
92  isBoxInside(const RealBox& a_box) const;
93 
94 protected:
98  RealVect m_lo;
99 
103  RealVect m_hi;
104 };
105 
106 #include <CD_NamespaceFooter.H>
107 
108 #endif
Rectangular box in real space.
Definition: CD_RealBox.H:26
bool isBoxInside(const RealBox &a_box) const
Check if a_box is completely inside this box. For this to be true, all the corners of a_box must be c...
Definition: CD_RealBox.cpp:133
bool isPointInside(const RealVect a_point) const
Check if a_point is inside this box.
Definition: CD_RealBox.cpp:116
RealVect m_lo
Low corner.
Definition: CD_RealBox.H:98
~RealBox()
Destructor (does nothing)
Definition: CD_RealBox.cpp:41
Vector< RealVect > getCorners() const
Get all the corners of this box (4 in 2D, 8 in 3D);.
Definition: CD_RealBox.cpp:57
RealVect getHi() const
Get high corner.
Definition: CD_RealBox.cpp:51
RealBox()
Default constructor. Must subsequently set the corners.
Definition: CD_RealBox.cpp:19
RealVect m_hi
High corner.
Definition: CD_RealBox.H:103
RealVect getLo() const
Get low corner.
Definition: CD_RealBox.cpp:45
bool intersect(const RealBox &a_box) const
Check if a_box intersects this box. This is done by checking if.
Definition: CD_RealBox.cpp:84