Program listing for file mechanics/src/collision/native/bodies/DiskPlanR.hpp#
Return to documentation for this file
1#ifndef DiskPlanR_h
2#define DiskPlanR_h
3
4#include "MechanicsFwd.hpp"
5#include "LagrangianScleronomousR.hpp"
6
7
8class DiskPlanR : public LagrangianScleronomousR, public std::enable_shared_from_this<DiskPlanR>
9{
10private:
11
12 ACCEPT_SERIALIZATION(DiskPlanR);
13
14 double r, A, B, C, sqrA2pB2,
15 AC, B2, A2, AB, BC, xCenter, yCenter, width, halfWidth, x1, x2, y1, y2;
16 bool finite;
17
18 void init(double, double, double, double, double, double, double);
19
20public:
21
22
23 DiskPlanR(double r, double A, double B, double C);
24
25
26 DiskPlanR(double disk, double A, double B, double C,
27 double xCenter, double yCenter, double width);
28
29
30 DiskPlanR(double, double, double, double, double);
31
32 ~DiskPlanR() noexcept = default;
33
34
35 double distance(double x, double y, double r) const;
36
37 double getRadius() const
38 {
39 return r;
40 };
41
42 double getA() const
43 {
44 return A;
45 };
46
47 double getB() const
48 {
49 return B;
50 };
51
52 double getC() const
53 {
54 return C;
55 };
56
57 double gethypotAB() const
58 {
59 return sqrA2pB2;
60 };
61
62 double getXCenter() const
63 {
64 return xCenter;
65 };
66
67 double getYCenter() const
68 {
69 return yCenter;
70 };
71
72 double getWidth() const
73 {
74 return width;
75 };
76
77 using LagrangianScleronomousR::computeh;
78
79 void computeh(const BlockVector& q, BlockVector& z, SiconosVector& y);
80
81
82 void computeJachq(const BlockVector& q, BlockVector& z);
83
84 bool equal(double, double, double, double) const;
85
86 bool equal(double, double, double, double, double, double, double) const;
87
88 bool equal(const DiskPlanR&) const;
89
90 bool isFinite() const
91 {
92 return finite;
93 };
94
95 ACCEPT_VISITORS();
96
97};
98#endif