-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforces.h
More file actions
72 lines (62 loc) · 1.46 KB
/
forces.h
File metadata and controls
72 lines (62 loc) · 1.46 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef FORCES_H
#define FORCES_H
#include "force_element.h"
#include "body.h"
#include "constraint.h"
#include "mbsystem.h"
class SystemGravityForce : public ForceElement
{
public:
caams::matrix g;
System &system;
SystemGravityForce(caams::matrix g, System &system);
~SystemGravityForce(void){}
void Apply(caams::matrix &y_rhs);
};
class BodyGravityForce : public ForceElement
{
public:
caams::matrix g;
Body *body;
BodyGravityForce(caams::matrix g, Body *body);
~BodyGravityForce(void){}
void Apply(caams::matrix &y_rhs);
};
class SystemNewtonianGravityForce : public ForceElement
{
public:
double G_Newton;
System &system;
SystemNewtonianGravityForce(
double G_Newton,
System &system);
~SystemNewtonianGravityForce(){}
void Apply(caams::matrix &y_rhs);
void GravityForcePair(
Body *body1,
Body *body2,
caams::matrix &y_rhs);
};
class LinearSpringDamperForce : public ForceElement
{
public:
Body *body1;
Body *body2;
caams::matrix s1_p;
caams::matrix s2_p;
double length;
double k_spring;
double k_damper;
LinearSpringDamperForce(
Body *body1,
Body *body2,
caams::matrix s1_p,
caams::matrix s2_p,
double l0,
double k_spring,
double k_damper);
~LinearSpringDamperForce(){}
void Apply(caams::matrix &y_rhs);
void Draw(void);
};
#endif