Program listing for file mechanics/src/joints/JointStopR.hpp

Program listing for file mechanics/src/joints/JointStopR.hpp#

 1#ifndef JointStopRELATION_H
 2#define JointStopRELATION_H
 3
 4#include <MechanicsFwd.hpp>
 5#include <SiconosFwd.hpp>
 6#include <NewtonEulerR.hpp>
 7#include <NewtonEulerJointR.hpp>
 8#include <Tools.hpp>
 9#include <SiconosVector.hpp>
10
11
12class JointStopR : public NewtonEulerR
13{
14protected:
15
16  ACCEPT_SERIALIZATION(JointStopR);
17  JointStopR() : NewtonEulerR() {}
18
19  SP::NewtonEulerJointR _joint;
20
21  SP::UnsignedIntVector _axis;
22  SP::SiconosVector _pos;
23  SP::SiconosVector _dir;
24
25  unsigned int _axisMin, _axisMax;
26  SP::SimpleMatrix _jachqTmp;
27
28public:
29
30
31  JointStopR(SP::NewtonEulerJointR joint, double pos, bool dir,
32             unsigned int axis=0);
33
34
35  JointStopR(SP::NewtonEulerJointR joint, SP::SiconosVector pos,
36             SP::SiconosVector dir, SP::UnsignedIntVector axes);
37
38
39#if 0
40
41  JointStopR(SP::NewtonEulerJointR joint, double pos, double neg,
42             unsigned int axis=0);
43#endif
44
45
46  virtual void computeh(double time, const BlockVector& q0, SiconosVector& y);
47
48  virtual void computeJachq(double time, Interaction& inter, SP::BlockVector q0);
49
50  virtual unsigned int numberOfConstraints();
51
52
53  unsigned int axis(unsigned int _index) { return _axis->at(_index); }
54
55
56  double position(unsigned int _index) { return _pos->getValue(_index); }
57
58
59  double direction(unsigned int _index) { return _dir->getValue(_index); }
60
61
62  SP::NewtonEulerJointR joint() { return _joint; }
63
64
65  unsigned int numberOfAxes() { return _axis->size(); }
66
67
68  virtual ~JointStopR() {};
69};
70#endif