This is a static copy of a profile report

Home

calculateL2BoundaryNorm (1 call, 0.083 sec)
Generated 18-Mar-2011 23:31:44 using cpu time.
M-function in file /Users/Robert/Documents/Work/Cardiff/postdoc/myrepo/NURBS/isoBEM/calculateL2BoundaryNorm.m
Copy to new window for comparing multiple runs

Parents (calling functions)
No parent
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
42
exactDisp=getExactDisplacement...
780.041 s50.0%
28
xi_param=convertToParamSpace( ...
780.021 s25.0%
10
[gpt gwt]=lgwt(ngp,-1,1);
10.010 s12.5%
5
global controlPts knotVec p el...
10.010 s12.5%
53
end
10 s0%
All other lines  0 s0%
Totals  0.083 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
getExactDisplacementsM-function780.041 s50.0%
convertToParamSpaceM-function780.021 s25.0%
lgwtM-function10.010 s12.5%
NURBSbasisMEX-function2340 s0%
Self time (built-ins, overhead, etc.)  0.010 s12.5%
Totals  0.083 s100% 
M-Lint results
No M-Lint messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function53
Non-code lines (comments, blank lines)18
Code lines (lines that can run)35
Code lines that did run35
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
1 function [ L2relNorm ] = calculateL2BoundaryNorm( displacement, dispConn, bsFnConn, traction )
2
3 % calculate the L2 norm for disps around the boundary
4
0.01 1 5 global controlPts knotVec p elRange
6
1 7 ne=size(dispConn,1);
8
1 9 ngp=6;
0.01 1 10 [gpt gwt]=lgwt(ngp,-1,1);
11
1 12 L2Norm=0;
1 13 L2exactNorm=0;
14
1 15 numBasisFns=size(bsFnConn,2);
1 16 N=zeros(1,numBasisFns); dN=zeros(1,numBasisFns);
17
1 18 for element=1:ne
13 19 elConn=dispConn(element,:);
13 20 elCoords=controlPts(elConn,1:2);
13 21 uxDof=elConn*2-1;
13 22 uyDof=elConn*2;
23
13 24 range=elRange(element,:);
13 25 jacob_param=(range(2)-range(1)) / 2; % jacobian from parent to parameter space
26
13 27 for pt=1:ngp
0.02 78 28 xi_param=convertToParamSpace( gpt(pt), range);
29
78 30 for lclBasis=1:numBasisFns
234 31 i=bsFnConn(element,lclBasis);
234 32 [N(lclBasis) dN(lclBasis)]=NURBSbasis(i, p, xi_param, knotVec, controlPts(:,3)' );
234 33 end
34
78 35 dxydxi=dN*elCoords; % the geometry derivatives
78 36 jacobXi=norm(dxydxi); % jacobian
78 37 jacob=jacobXi*jacob_param;
38
78 39 pointCoords=N*elCoords;
78 40 r=norm(pointCoords);
78 41 theta=atan2(pointCoords(2),pointCoords(1));
0.04 78 42 exactDisp=getExactDisplacements(r,theta,traction);
43
78 44 approxDisp=N*[displacement(uxDof)' displacement(uyDof)'];
45
78 46 L2Norm=L2Norm + norm(approxDisp-exactDisp)*gwt(pt)*jacob;
78 47 L2exactNorm=L2exactNorm + norm(exactDisp) * gwt(pt)*jacob;
78 48 end
13 49 end
50
1 51 L2relNorm=L2Norm/L2exactNorm;
52
1 53 end

Other subfunctions in this file are not included in this listing.