This is a static copy of a profile reportHome
integrateHsubmatrixSST (31 calls, 0.311 sec)
Generated 18-Mar-2011 23:31:44 using cpu time.
M-function in file /Users/Robert/Documents/Work/Cardiff/postdoc/myrepo/NURBS/isoBEM/integrateHsubmatrixSST.m
Copy to new window for comparing multiple runs
Parents (calling functions)
No parent Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
16 | [gpt gwt]=lgwt(ngp,-1,1); ... | 31 | 0.145 s | 46.7% |  |
58 | Ttemp(i,j)=DBIEkernels(i,j,r,d... | 744 | 0.073 s | 23.3% |  |
51 | [jacob_xi,normals, r, dr, drdn... | 186 | 0.052 s | 16.7% |  |
48 | [N(lclBasis) dN(lclBasis)]=NUR... | 558 | 0.021 s | 6.7% |  |
70 | tempMatrix=tempMatrix./(xi-src... | 186 | 0.010 s | 3.3% |  |
All other lines | | | 0.010 s | 3.3% |  |
Totals | | | 0.311 s | 100% | |
Children (called functions)
M-Lint results
No M-Lint messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 91 |
Non-code lines (comments, blank lines) | 38 |
Code lines (lines that can run) | 53 |
Code lines that did run | 53 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
1 function [ Hsubmatrix ] = integrateHsubmatrixSST( ngp, elcoords, bsFnConn, collocCoords, srcXi_param, range, jumpTerm)
2 % A function which calculate the H matrix for the singular case using the
3 % subtraction of singularity technique by Guiggiani and Casalini
4
5 % We pass in ....
6
7 % ngp: # of gauss points
8 % elcoords: the coordinates of the element we are on
9 % bsFnConn the global basis Fns which are non zero in this element
10 % collocCoords: the coordinates of the collocation points (do we need this?)
11 % srcXi_param: the coordinate of our source point in parameter space
12 % range: the range of our 'element' [xi_i xi_i+1]
13
0.01 31 14 global const3 const4 p knotVec controlPts
15
0.15 31 16 [gpt gwt]=lgwt(ngp,-1,1); % get the gauss points
17
31 18 Hsubmatrix=zeros(2,6);
19
31 20 numBasisFns=length(bsFnConn);
31 21 srcN=zeros(1,numBasisFns); N=zeros(1,numBasisFns);
31 22 srcdN=zeros(1,numBasisFns); dN=zeros(1,numBasisFns);
23
31 24 if srcXi_param==range(1) % Annoying, but I need to evaluate the parameters
9 25 nudgedXi=srcXi_param+eps; % at the source point a small distance away from the actual point
22 26 elseif srcXi_param==range(2)
9 27 nudgedXi=srcXi_param-eps;
13 28 else
13 29 nudgedXi=srcXi_param;
13 30 end
31 31 srcXi=convertToParentCoordSpace(srcXi_param, range);
32
31 33 for c=1:length(bsFnConn)
93 34 [srcN(c) srcdN(c)]=NURBSbasis( bsFnConn(c), p, nudgedXi, knotVec, controlPts(:,3)' );
93 35 end
36
31 37 hterm=[0 -const4*const3; const4*const3 0];
31 38 htermMatrix=[hterm.*srcN(1) hterm.*srcN(2) hterm.*srcN(3)];
39
31 40 jacob_param=(range(2)-range(1)) / 2; % jacobian from parent to parameter space
41
31 42 for pt=1:ngp % integrate using Gaussian quadrature
186 43 xi=gpt(pt);
186 44 xi_param=convertToParamSpace( xi, range); % get the gauss point in parameter space
45
186 46 for lclBasis=1:numBasisFns
558 47 i=bsFnConn(lclBasis);
0.02 558 48 [N(lclBasis) dN(lclBasis)]=NURBSbasis(i, p, xi_param, knotVec, controlPts(:,3)' );
558 49 end
50
0.05 186 51 [jacob_xi,normals, r, dr, drdn] = getKernelParameters( elcoords, collocCoords, N, dN );
186 52 jacob=jacob_xi*jacob_param; % the final jacobian we use
53
186 54 Ttemp=zeros(2,2);
55
186 56 for i=1:2
372 57 for j=1:2
0.07 744 58 Ttemp(i,j)=DBIEkernels(i,j,r,dr,drdn,normals);
744 59 end
372 60 end
61
62 % figure(3)
63 % hold on
64 % plot(xi, N(1)*Ttemp(1,2)*jacob, 'ko-')
65 % hold off
66
186 67 tempMatrix=[N(1)*Ttemp N(2)*Ttemp N(3)*Ttemp]...
68 *(xi-srcXi)*jacob*gwt(pt);
186 69 tempMatrix=tempMatrix-htermMatrix;
0.01 186 70 tempMatrix=tempMatrix./(xi-srcXi);
186 71 Hsubmatrix=Hsubmatrix + tempMatrix;
72
186 73 end
74
75 % and add the analytical integral on at the end
31 76 if abs(srcXi)<(1-100*eps)
13 77 Hsubmatrix=Hsubmatrix+htermMatrix*log(abs((1-srcXi)/(1+srcXi)));
18 78 else
18 79 jacob_xi=getKernelParameters(elcoords, collocCoords, srcN, srcdN);
18 80 jacob_s=jacob_xi*jacob_param;
18 81 beta_m=1/jacob_s;
18 82 Hsubmatrix=Hsubmatrix+htermMatrix*log(abs(2/beta_m))*sign(xi-srcXi);
18 83 end
84
85 % and add the jump terms at the end
31 86 if abs(srcXi_param-range(2)) > 100*eps
22 87 jumpMatrix=[jumpTerm.*srcN(1) jumpTerm.*srcN(2) jumpTerm.*srcN(3)];
22 88 Hsubmatrix=Hsubmatrix+jumpMatrix;
22 89 end
90
31 91 end
Other subfunctions in this file are not included in this listing.