-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDOF.m
More file actions
64 lines (57 loc) · 2.16 KB
/
DOF.m
File metadata and controls
64 lines (57 loc) · 2.16 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
classdef DOF
%UNTITLED3 Summary of this class goes here
% Detailed explanation goes here
properties
ndof
idx
vR
vL
end
methods
% Constructor
function obj = DOF(linearTriangle,connec,nunkn,npnod,fixnodes)
% Compute idx
lnods = connec';
for i = 1:linearTriangle.nnode
for j = 1:nunkn
obj.idx(nunkn*i-nunkn+j,:) = nunkn.*lnods(i,:) - nunkn + j;
end
end
obj.ndof = nunkn*npnod;
% *************************************************************
switch linearTriangle.type
case {'TRIANGLE','QUADRILATERAL'}
if (size(fixnodes,1)>0)
vR = (fixnodes(:,1)-1)*nunkn + fixnodes(:,2); % Finds the equation number
vL = setdiff (1:obj.ndof, vR);
else
vL = (1:obj.ndof);
vR = [];
end
case 'LINEAR_TRIANGLE_MIX'
if (size(fixnodes,1)>0)
vR = (fixnodes(:,1)-1)*3 + fixnodes(:,2); % Finds the equation number
vL = setdiff (1:obj.ndof, vR);
else
vL = (1:obj.ndof);
vR = [];
end
case 'LINEAR_TRIANGLE_MIX_COUPLED'
vR = (fixnodes(:,1)-1)*3 + fixnodes(:,2); % Finds the equation number
vL = setdiff (1:obj.ndof, vR);
case 'HEXAHEDRON'
if (size(fixnodes,1)>0)
vR = (fixnodes(:,1)-1)*3 + fixnodes(:,2); % Finds the equation number
vL = setdiff (1:obj.ndof, vR);
else
vL = (1:obj.ndof);
vR = [];
end
otherwise
error('No existe es tipo de elemento o no ha sido implementado')
end
obj.vR = vR;
obj.vL = vL;
end
end
end