MBSim
Project Page
Main Page
Related Pages
Namespaces
Classes
Files
File List
mbsim
gearing.h
1
/* Copyright (C) 2004-2011 MBSim Development Team
2
*
3
* This library is free software; you can redistribute it and/or
4
* modify it under the terms of the GNU Lesser General Public
5
* License as published by the Free Software Foundation; either
6
* version 2.1 of the License, or (at your option) any later version.
7
*
8
* This library is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
12
*
13
* You should have received a copy of the GNU Lesser General Public
14
* License along with this library; if not, write to the Free Software
15
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
*
17
* Contact: martin.o.foerg@gmail.com
18
*/
19
20
#ifndef _GEARING_H_
21
#define _GEARING_H_
22
23
#include "mbsim/link_mechanics.h"
24
#include "mbsim/rigid_body.h"
25
#include "mbsim/frame.h"
26
27
namespace
MBSim {
28
29
class
Gearing
:
public
LinkMechanics
{
30
protected
:
31
Function2<double,double,double>
*func;
32
double
r0, r1;
33
bool
flag;
34
Frame
Z0, Z1;
35
Frame
*P0, *P1;
36
fmatvec::Vec WrP0Z, WrP1Z;
37
fmatvec::Vec Wt;
38
public
:
39
Gearing
(
const
std::string &
name
,
bool
flag =
false
);
40
void
updateh(
double
,
int
i=0);
41
void
updateW(
double
,
int
i=0);
42
void
updateJacobians(
double
t,
int
j=0);
43
void
updateg(
double
);
44
void
updategd(
double
);
45
void
updatewb(
double
t,
int
i=0);
46
void
updatehRef
(
const
fmatvec::Vec &hParent,
int
j=0);
47
void
updateWRef
(
const
fmatvec::Mat &WParent,
int
j=0);
48
void
connect(
double
r1,
Frame
* frame1_,
double
r2,
Frame
* frame2_);
49
virtual
void
updatexd(
double
t);
50
virtual
void
updatedx(
double
t,
double
dt);
51
virtual
void
calcxSize();
52
53
bool
isActive
()
const
{
return
true
; }
54
bool
gActiveChanged
() {
return
false
; }
55
std::string
getType
()
const
{
return
"Gearing"
; }
56
void
init
(
InitStage
stage);
57
bool
isSetValued
()
const
;
58
virtual
void
calclaSize();
59
virtual
void
calcgSize();
60
virtual
void
calcgdSize();
61
62
void
setForceFunction(
Function2<double,double,double>
*func_) { func=func_; }
63
64
void
plot
(
double
t,
double
dt=1);
65
66
private
:
67
};
68
69
}
70
71
#endif
Generated by
1.8.1.1