This is a static copy of a profile reportHome
plotDeformedProfile (1 call, 0.301 sec)
Generated 18-Mar-2011 23:31:42 using cpu time.
M-function in file /Users/Robert/Documents/Work/Cardiff/postdoc/myrepo/NURBS/isoBEM/plotDeformedProfile.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 |
47 | figure(2); hold on | 1 | 0.176 s | 58.6% |  |
19 | [extrapPoints(point,2)] = NURB... | 400 | 0.062 s | 20.7% |  |
21 | y(point) = NURBSinterpolation(... | 400 | 0.031 s | 10.3% |  |
49 | hold off | 1 | 0.010 s | 3.4% |  |
18 | [extrapPoints(point,1)] = NURB... | 400 | 0.010 s | 3.4% |  |
All other lines | | | 0.010 s | 3.4% |  |
Totals | | | 0.301 s | 100% | |
Children (called functions)
M-Lint results
Line number | Message |
1 | Input argument 'infTraction' might be unused. If this is OK, consider replacing it by ~. |
35 | The value assigned to variable 'r' might be unused. |
36 | The value assigned to variable 'theta' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 63 |
Non-code lines (comments, blank lines) | 42 |
Code lines (lines that can run) | 21 |
Code lines that did run | 21 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
1 function plotDeformedProfile( displacement, nPts, controlPts, infTraction )
2
3 % pass in a vector of control point displacements, and we can plot the
4 % deformed profile using NURBS
5
0.01 1 6 global p knotVec
7
1 8 factor=10; % for exaggerating displacements
9
1 10 newControlPts=controlPts(1:nPts,1:2)+factor*[displacement(1:2:end)' displacement(2:2:end)'];
1 11 newControlCoords=[newControlPts; newControlPts(1,:)]; % add first entry again (for plotting)
12
1 13 numPts=400;
1 14 xi=linspace(0,max(knotVec),numPts);
15
1 16 extrapPoints = zeros(numPts,2); x = zeros(numPts,1); y=zeros(numPts,1);
1 17 for point=1:numPts
0.01 400 18 [extrapPoints(point,1)] = NURBSinterpolation(xi(point), p, knotVec, newControlPts(:,1)', controlPts(:,3)');
0.06 400 19 [extrapPoints(point,2)] = NURBSinterpolation(xi(point), p, knotVec, newControlPts(:,2)', controlPts(:,3)');
400 20 x(point) = NURBSinterpolation(xi(point), p, knotVec, controlPts(:,1)', controlPts(:,3)');
0.03 400 21 y(point) = NURBSinterpolation(xi(point), p, knotVec, controlPts(:,2)', controlPts(:,3)');
400 22 end
23
24 % N=zeros(numPts,numBasisFns);
25 % for i=1:numBasisFns
26 %
27 % for point=1:numPts
28 % N(point,i)=NURBSbasis(i,p,xi(point),knotVec,controlPts(:,3));
29 % end
30 %
31 % end
32 %
33 % x=N*controlPts(:,1);
34 % y=N*controlPts(:,2);
1 35 r=sqrt(x.^2+y.^2)';
1 36 theta=atan2(y,x)';
37
38 % Bit of hardcoding here - dimensions of plate
39 % a=1;
40
41 %disp = getExactDisplacements( r, theta, infTraction );
42
43 % points=zeros(numPts,2);
44 % points(:,1)=x+disp(:,1).*factor;
45 % points(:,2)=y+disp(:,2).*factor;
46
0.18 1 47 figure(2); hold on
1 48 plot(extrapPoints(:,1), extrapPoints(:,2), 'k--')
0.01 1 49 hold off
50
51 %% Plate with hole plotting
52
53 % figure(4); hold on
54 % axis([-4.5 0.5 -0.5 4.5])
55 % axis equal
56 % plot(points(:,1), points(:,2), 'k:', extrapPoints(:,1), extrapPoints(:,2),'k-', newControlCoords(:,1), newControlCoords(:,2), 'ko')
57 % legend('exact','isoBEM', 'isoBEM control points')
58
1 59 save 'dat_files/deformedPoints.dat' newControlCoords -ASCII
1 60 save 'dat_files/deformedProfile.dat' extrapPoints -ASCII
61 %save 'dat_files/exactDeformedProfile.dat' points -ASCII
62
1 63 end
Other subfunctions in this file are not included in this listing.