PeriodicBox.cpp
1 #include "PeriodicBox.hpp"
2 #include "../../../misc/universal_error.hpp"
3 
4 bool PeriodicBox::PointIsReflective(Vector2D const& /*point*/)const
5 {
6  return false;
7 }
8 
9 bool PeriodicBox::AreWeReflective(Edge const& /*edge*/)const
10 {
11  return false;
12 }
13 
14 PeriodicBox::PeriodicBox(double left, double right,double up, double down)
15  :_left(left),_right(right),_up(up),_down(down)
16 {
17  if(left>=right||down>=up)
18  throw UniversalError("Invalid values for grid boundaries");
19 }
20 
22  const Vector2D& upper_right):
23  _left(lower_left.x),
24  _right(upper_right.x),
25  _up(upper_right.y),
26  _down(lower_left.y)
27 {
28  assert((_up>_down) && (_right>_left));
29 }
30 
31 std::pair<Vector2D, Vector2D> PeriodicBox::getBoundaries(void) const
32 {
33  return std::pair<Vector2D,Vector2D>(Vector2D(_left,_down),
34  Vector2D(_right,_up));
35 }
36 
38 {
39  return Periodic;
40 }
41 
43 {
44  if(dir==Left)
45  return _left;
46  else if(dir==Right)
47  return _right;
48  else if(dir==Up)
49  return _up;
50  else if(dir==Down)
51  return _down;
52  else
53  throw UniversalError("Unknown direction");
54 }
Directions
Directions of boundaries of the computational domain.
Container for error reports.
PeriodicBox(double left, double right, double up, double down)
Class constructor.
Definition: PeriodicBox.cpp:14
Interface between two cells.
Definition: Edge.hpp:13
bool AreWeReflective(Edge const &edge) const
Return wheter an edge is reflective or not.
Definition: PeriodicBox.cpp:9
BoundaryType
Type of boundary.
std::pair< Vector2D, Vector2D > getBoundaries(void) const
Returns the lower left and upper right corners.
Definition: PeriodicBox.cpp:31
BoundaryType GetBoundaryType(void) const
Returns the boundary type.
Definition: PeriodicBox.cpp:37
Square box outer boundary conditions.
double GetGridBoundary(Directions dir) const
Returns the boundary coordinate.
Definition: PeriodicBox.cpp:42
bool PointIsReflective(Vector2D const &point) const
Checks if the point is a reflected point outside the domain.
Definition: PeriodicBox.cpp:4
2D Mathematical vector
Definition: geometry.hpp:15