Program listing for file mechanics/src/collision/native/bodies/SphereLDS.hpp#
Return to documentation for this file
1#ifndef SphereLDS_h
2#define SphereLDS_h
3
4#include "MechanicsFwd.hpp"
5#include "LagrangianDS.hpp"
6
7class SphereLDS : public LagrangianDS, public std::enable_shared_from_this<SphereLDS>
8{
9protected:
10
11 ACCEPT_SERIALIZATION(SphereLDS);
12
13 double radius;
14 double massValue;
15 double I;
16
17 SphereLDS() {};
18
19public:
20
21 SphereLDS(double, double, SP::SiconosVector, SP::SiconosVector);
22
23 ~SphereLDS();
24
25 inline double getQ(unsigned int pos)
26 {
27 assert(pos < _ndof);
28 return (*_q[0])(pos);
29 };
30 inline double getVelocity(unsigned int pos)
31 {
32 assert(pos < _ndof);
33 return (*_q[1])(pos);
34 };
35
36 inline double getMassValue() const
37 {
38 return massValue;
39 };
40
41 inline double getRadius() const
42 {
43 return radius;
44 };
45
46 void computeMass();
47 void computeMass(SP::SiconosVector)
48 {
49 THROW_EXCEPTION("SphereLDS::computeMass(vector) - not implemented");
50 }
51
52 void computeFGyr(SP::SiconosVector, SP::SiconosVector);
53
54 void computeFGyr();
55
56 void computeJacobianFGyrq();
57 void computeJacobianFGyrqDot();
58
59 void computeJacobianFGyrq(SP::SiconosVector, SP::SiconosVector);
60 void computeJacobianFGyrqDot(SP::SiconosVector, SP::SiconosVector);
61
62 ACCEPT_BASE_VISITORS(LagrangianDS);
63
64};
65#endif