-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAssembleJacobian.m
51 lines (48 loc) · 1.91 KB
/
AssembleJacobian.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
%% Assembles the Jacobi matrix of the RB method
% cf. equation (29) in the paper
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% COPYRIGHT NOTES
%
% AssembleJacobian.m
% Copyright (C) 2019 by Oliver Kunc
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
% (the full license is distributed together with the software
% in a file name LICENSE)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This software package is related to the research article
%
% Authors: Oliver Kunc and Felix Fritzen
% Title: Finite strain homogenization using a reduced basis and efficient sampling
% Journal: Mathematical and Computational Applications
% Special Issue "Machine Learning, Low-Rank Approximations and Reduced Order Modeling in Computational Mechanics"
% Year: 2019
% Volume: 24
% Number: 2
% DOI : 10.3390/mca24020056
% URL : https://dx.doi.org/10.3390/mca24020056
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Jacobian] = AssembleJacobian() % cf. equation (29)
global N N_qp B C w
Jacobian = zeros(N,N);
for i_qp=1:N_qp
Jacobian = Jacobian + ...
B((i_qp-1)*9+1:i_qp*9,:)' * ...
reshape(C((i_qp-1)*81+1:i_qp*81),9,9)' * ...
B((i_qp-1)*9+1:i_qp*9,:) * w(i_qp);
end
end