-
Notifications
You must be signed in to change notification settings - Fork 1
/
MBforce.m
37 lines (31 loc) · 867 Bytes
/
MBforce.m
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
classdef MBforce < matlab.mixin.Heterogeneous
%MBforce Base class for force elements
% Detailed explanation goes here
properties
id
bodyI
bodyJ = [];
end
methods
function obj = MBforce(id, bodyI, bodyJ)
if nargin > 0
obj.id = id;
obj.bodyI = bodyI;
obj.bodyJ = bodyJ;
end
end
function print(obj)
fprintf('ForceElement %i type: %s\n', obj.id, obj.getType);
if isempty(obj.bodyJ)
fprintf(' body: %i\n', obj.bodyI);
else
fprintf(' bodyI: %i bodyJ: %i\n', obj.bodyI, obj.bodyJ);
end
end
end
methods(Static)
function type = getType()
type = 'Generic';
end
end
end