-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAMLS_plus_LIR.m
More file actions
executable file
·149 lines (124 loc) · 4.5 KB
/
Copy pathAMLS_plus_LIR.m
File metadata and controls
executable file
·149 lines (124 loc) · 4.5 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
function [K_AMLS,M_AMLS,dof_sets_mod,varargout] = AMLS_plus_LIR(i_ss_dofs,dof_sets,K_free,M_free,w_i,options)
%
% Dimitri Krattiger
%
% Description
% ===========
% This code computes the Automated Multi Level Substructure (AMLS)
% representation mass and stiffness matrices, and the local interface
% reduction (LIR), and then applies residual mode enhancement to the
% interior reduction (plus).
%
% Inputs
% ======
% i_ss_dofs = tree shaped cell array containing DOF indices of partitioned
% substructures
%
% dof_sets = DOF set structure for full model
%
% K_free = free stiffness matrix
%
% M_free = free mass matrix
%
% w_i = cutoff frequency for fixed-interface mode calculations
%
% options = structure containing optional parameters
%
%
% Outputs
% =======
% K_AMLS = AMLS stiffness matrix
%
% M_AMLS = AMLS mass matrix
%
% dof_sets_mod = DOF set structure for reduced order model
%
% T_AMLS = transformation between full DOF vector and AMLS DOF
% vector
%% Get options arguments and set defaults
% ======================================================================= %
% set_default values for options
defaults.BoundaryMethod = 'none';
defaults.n_CC = [];
defaults.w_b = [];
defaults.verbose = false;
defaults.verboseTab = '%% ';
defaults.verboseTabSum = '';
defaults.outputT = false;
defaults.LIRorthotype = 'qr';
options = setstructfields(defaults,options);
%% Display Timing info
% ======================================================================= %
if options.verbose
t_start_AMLSpl = tic;
tb = options.verboseTabSum;
options.verboseTabSum = [options.verboseTabSum,options.verboseTab];
tbi = options.verboseTabSum;
fprintf([tb,'\n'])
fprintf([tb,'Residual Enhanced Multi-Level Substructuring (AMLS+)\n'])
fprintf([tb,repmat('%%',1,60-length(sprintf(tb))),'\n'])
end
%% perform basic AMLS transform
% ======================================================================= %
options_AMLS = options;
options_AMLS.outputT = true;
options_AMLS.resPlus = true;
[K_AMLS.w0,M_AMLS.w0,n_FI_ss,T_AMLS.w0,Frs,Psi_hat] = AMLS(i_ss_dofs,K_free,M_free,w_i,dof_sets,options_AMLS);
%% Update dof_sets structure
% ======================================================================= %
% update number of fixed interface modes
n_FI = sum(n_FI_ss(1:end-1));
% Create new dof-sets structure that contains info about interior dofs
% and boundary dof sets
% new degree of freedom sets
dof_set_names = fieldnames(dof_sets);
dof_sets_mod.i = (1:n_FI)';
count = n_FI;
% boundary order hasn't changed so just assign new number sets to the
% dof_sets structure
for i = 2:27
n_dof_set = length(dof_sets.(dof_set_names{i}));
dof_sets_mod.(dof_set_names{i}) = count + (1:n_dof_set)';
count = count + n_dof_set;
end
%% Perform LIR reduction
% ======================================================================= %
if ~strcmpi(options.BoundaryMethod,'none')
% perform LIR reduction
[K_AMLS.w0,M_AMLS.w0,dof_sets_mod,T_LIR] = LIR(K_AMLS.w0,M_AMLS.w0,...
dof_sets_mod,options);
% update transformation matrix
T_AMLS.w0 = T_AMLS.w0*T_LIR;
end
%% form residual correction transformation
t_start = tic;
T_AMLS.w2 = Psi_hat*(Frs*(Psi_hat'*(M_free*T_AMLS.w0)));
% print timing info to screen
if options.verbose
fprintf([tbi,'T_AMLS+ assembly time: %6.2f \n'],toc(t_start))
end
% calculate residual correction mass and stiffness components
t_start = tic;
% residual enhanced stiffness terms
K_AMLS.w4 = T_AMLS.w2'*K_free*T_AMLS.w2;
K_AMLS.w2 = 0;
% residual enhanced mass terms
M_AMLS.w4 = T_AMLS.w2'*M_free*T_AMLS.w2;
M_AMLS.w2 = K_AMLS.w4;
% print timing info to screen
if options.verbose
fprintf([tbi,'Time to apply transformations to K and M: %6.2f \n'],toc(t_start))
end
% Make sure that matrices that should be symmetric are symmetric
% ======================================================================= %
K_AMLS.w0 = (1/2)*(K_AMLS.w0 + K_AMLS.w0);
K_AMLS.w4 = (1/2)*(K_AMLS.w4 + K_AMLS.w4);
M_AMLS.w0 = (1/2)*(M_AMLS.w0 + M_AMLS.w0);
M_AMLS.w4 = (1/2)*(M_AMLS.w4 + M_AMLS.w4);
% place AMLS transformation in output cell
varargout{1} = T_AMLS;
if options.verbose
fprintf([tbi,'Residual Enhanced AMLS calculation time: %5.2f s\n'],toc(t_start_AMLSpl))
fprintf([tb,repmat('%%',1,60-length(sprintf(tb))),'\n'])
fprintf([tb,'\n'])
end