-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcomputeLeftHandIntegrand.m
61 lines (51 loc) · 2.15 KB
/
computeLeftHandIntegrand.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
52
53
54
55
56
57
58
59
60
61
%
% Project: Approximation and Finite Elements in Isogeometric Problems
% Author: Luca Carlon
% Date: 2009.11.24
%
% Copyright (c) 2009-2021 Luca Carlon. All rights reserved.
%
% 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/>.
%
function [s] = leftHandIntegrand(n, p, Xi, m, q, Eta, Pw, xi, eta, ki, li, kj, lj)
for l = 1:length(xi)
% Determination of the derivatives.
SKL = computeNURBSSurfDerivsPoint(n, p, Xi, m, q, Eta, Pw, xi(l), eta, 1);
% Definition of the jacobian matrix.
DxDxi = [SKL(1+1, 0+1, 1), SKL(1+1, 0+1, 2);...
SKL(0+1, 1+1, 1), SKL(0+1, 1+1, 2)];
% Evaluate the Jacobian.
Jx = det(DxDxi);
% Compute the inverse of the jacobian matrix.
DxiDx = inv(DxDxi);
% Definition of the weights.
wixi = Pw(:, li+1, end)';
wieta = Pw(ki+1, :, end);
wjxi = Pw(:, lj+1, end)';
wjeta = Pw(kj+1, :, end);
% Computation of the derivatives of the NURBS bivariate basis functions.
dRidxi = computeNURBSBasisDeriv(ki, xi(l), p, Xi, wixi).*...
computeNURBSBasisFun(li, eta, m, q, Eta, wieta);
dRideta = computeNURBSBasisDeriv(li, eta, q, Eta, wieta).*...
computeNURBSBasisFun(ki, xi(l), n, p, Xi, wixi);
dRjdxi = computeNURBSBasisDeriv(kj, xi(l), p, Xi, wjxi).*...
computeNURBSBasisFun(lj, eta, m, q, Eta, wjeta);
dRjdeta = computeNURBSBasisDeriv(lj, eta, q, Eta, wjeta).*...
computeNURBSBasisFun(kj, xi(l), n, p, Xi, wjxi);
gradRi = [dRidxi; dRideta];
gradRj = [dRjdxi; dRjdeta];
% Integrand.
s(l) = Jx.*1.*(DxiDx'*gradRi)'*(DxiDx'*gradRj);
%s(l) = gradRi'*gradRj;
end