Acoustic FDTD Solver
Circle.hpp
Go to the documentation of this file.
1 #ifndef CIRCLE_HPP
2 #define CIRCLE_HPP
3 
4 #include "Shape.hpp"
5 
6 
7 class Circle:public Shape {
10 public:
11  Circle() {};
16  Circle(const CartPosition &p, const double r);
17  Circle(const Circle &the_circle);
18 
19  inline CartPosition getUpper() const {
20  return upper;
21  }
22  inline CartPosition getLower() const {
23  return lower;
24  }
25  inline double getXLength() const {
26  return 0;
27  }
28  inline double getYLength() const {
29  return std::abs(lower.y - upper.y);
30  }
31  inline double getZLength() const {
32  return std::abs(lower.z - upper.z);
33  }
34  inline double getLargestLength() const {
35  return getZLength();
36  }
37  inline double getRadius() const {
38  return std::abs(upper.y-lower.y)/2.0;
39  }
40  inline CartPosition getCenter() const {
41  return CartPosition(lower.x,
42  lower.y+getRadius(),
43  lower.z+getRadius());
44  }
45  inline unsigned getType() const {
46  return SHAPE_CIRCLE;
47  }
48  std::vector<unsigned> getDimension(const Grid &grid) const;
49  inline Circle * clone() const {
50  return new Circle(*this);
51  }
52  std::vector<std::vector<unsigned> > getCoordinateIndex(const Grid &grid) const;
53  ~Circle() {}
54 };
55 
56 #endif