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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef JointFrictionRELATION_H
#define JointFrictionRELATION_H

#include <MechanicsFwd.hpp>
#include <SiconosFwd.hpp>
#include <NewtonEulerR.hpp>
#include <NewtonEulerJointR.hpp>
#include <Tools.hpp>


class JointFrictionR : public NewtonEulerR
{
protected:

  ACCEPT_SERIALIZATION(JointFrictionR);
  JointFrictionR() : NewtonEulerR() {}

  SP::NewtonEulerJointR _joint;

  SP::UnsignedIntVector _axis;

  unsigned int _axisMin, _axisMax;
  SP::SimpleMatrix _jachqTmp;

public:


  JointFrictionR(SP::NewtonEulerJointR joint, unsigned int axis);


  JointFrictionR(SP::NewtonEulerJointR joint,
                 SP::UnsignedIntVector axes=SP::UnsignedIntVector());

  virtual void computeh(double time, BlockVector& q0, SiconosVector& y);

  virtual void computeJachq(double time, Interaction& inter, SP::BlockVector q0);

  virtual unsigned int numberOfConstraints();


  unsigned int axis(unsigned int _index) { return _axis->at(_index); }


  SP::NewtonEulerJointR joint() { return _joint; }


  unsigned int numberOfAxes() { return _axis->size(); }


  virtual ~JointFrictionR() {};
};
#endif