This is a static copy of a profile reportHome
assignDirichletAndNeumannNodes (1 call, 0.062 sec)
Generated 18-Mar-2011 23:31:42 using cpu time.
M-function in file /Users/Robert/Documents/Work/Cardiff/postdoc/myrepo/NURBS/isoBEM/assignDirichletAndNeumannNodes.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 |
130 | presTracDOFs = setxor(allTracD... | 1 | 0.052 s | 83.3% |  |
143 | end | 1 | 0 s | 0% |  |
141 | nonZeroXTracDOFs = []; | 1 | 0 s | 0% |  |
140 | nonZeroYTracDOFs = sctrY*2; | 1 | 0 s | 0% |  |
137 | sctrY = [tracConn(prevElmt,end... | 1 | 0 s | 0% |  |
All other lines | | | 0.010 s | 16.7% |  |
Totals | | | 0.062 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
setxor | M-function | 1 | 0.041 s | 66.7% |  |
unique | M-function | 1 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.021 s | 33.3% |  |
Totals | | | 0.062 s | 100% | |
M-Lint results
No M-Lint messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 143 |
Non-code lines (comments, blank lines) | 117 |
Code lines (lines that can run) | 26 |
Code lines that did run | 26 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
1 function [ presDispDOFs, presTracDOFs, dirichletVals, nonZeroXTracDOFs, nonZeroYTracDOFs ] = assignDirichletAndNeumannNodes(n, elConn, tracConn)
2
3 % we work out the nodes where disp is specified and trac specified
4
5 % n: number of elements per line
6 % elConn: the displacement element connectivity matrix
7 % tracConn: the traction element Connectivity matrix
8 % traction: the traction that is applied on the upper and left edges
9 % X- Displacements are specified on line 5 while y-displacements are
10 % specified on line 1
11
12 %% Hole in infinite plate problem
13
14 % % y-disps prescribed on first line
15 % elms=1:n;
16 % sctrY=elConn(elms,:);
17 % sctrY=unique(reshape(sctrY,1,numel(sctrY)));
18 %
19 % % x-disps
20 % elms=(2*n+1):(3*n);
21 % sctrX=elConn(elms,:);
22 % sctrX=unique(reshape(sctrX,1,numel(sctrX)));
23 %
24 % presDispDOFs=sort([sctrX*2-1 sctrY*2]);
25 % dirichletVals=zeros(1,length(presDispDOFs));
26 %
27 %
28 % % and now for the tractions
29 %
30 % % x-tracs
31 % elms=[1:2*n (3*n+1):5*n];
32 % sctrX=tracConn(elms,:);
33 % sctrX=unique(reshape(sctrX,1,numel(sctrX)));
34 %
35 % % y-tracs
36 % elms=(n+1):(5*n);
37 % sctrY=tracConn(elms,:);
38 % sctrY=unique(reshape(sctrY,1,numel(sctrY)));
39 %
40 % presTracDOFs=sort([sctrX*2-1 sctrY*2]);
41 %
42 % % work out the traction DOFs where we specify a nonzero traction
43 %
44 % % nonzero y-tractions
45 % elms=(3*n+1):4*n;
46 % sctrY=tracConn(elms,:);
47 % sctrY=reshape(sctrY,1,numel(sctrY));
48 % nonZeroYTracDOFs=unique(sctrY*2);
49 %
50 % % nonzero x-tractions
51 % elms=(4*n+1):5*n;
52 % sctrX=tracConn(elms,:);
53 % sctrX=unique(reshape(sctrX,1,numel(sctrX)));
54 % nonZeroXTracDOFs=sctrX*2-1;
55
56 %% L-plate problem
57
58 % The only displacements that we prescribe are the nodes in the notch and
59 % at the right hand corner
60
61 % elms=[4]*n + 1;
62 % sctrX = elConn(elms,1);
63 % sctrX=reshape(sctrX,1,numel(sctrX));
64 %
65 % elms=[1 4]*n + 1;
66 % sctrY = elConn(elms,1);
67 % sctrY=reshape(sctrY,1,numel(sctrY));
68 %
69 % presDispDOFs=sort([sctrX*2-1 sctrY*2]);
70 % dirichletVals=zeros(1,length(presDispDOFs));
71 %
72 %
73 % % Now let's prescribe our tractions - this is everywhere except the two
74 % % dirichlet nodes
75 % tracEndElms = [4]*n;
76 % tracStartElms = tracEndElms + 1;
77 % sctrX = [tracConn(tracEndElms,end) tracConn(tracStartElms,1)];
78 % sctrX = reshape(sctrX,1, numel(sctrX));
79 %
80 % tracEndElms = [1 4]*n;
81 % tracStartElms = tracEndElms + 1;
82 % sctrY = [tracConn(tracEndElms,end) tracConn(tracStartElms,1)];
83 % sctrY = reshape(sctrY,1, numel(sctrY));
84 %
85 % allTracDOFs = 1:2*max(tracConn(:,end));
86 % presTracDOFs = setxor(allTracDOFs, [sctrX*2-1 sctrY*2]);
87 %
88 % % and our non-zero trac DOF
89 %
90 % % and now get the nonzero x and y tractions
91 % nonZeroYTracDOFs = presTracDOFs(find(mod(presTracDOFs,2)==0));
92 % nonZeroXTracDOFs = presTracDOFs(find(mod(presTracDOFs,2)==1));
93
94 % nonzero tractions
95 % elms=[1:3*n 5*n+1:6*n];
96 % sctr=tracConn(elms,:);
97 % sctr=reshape(sctr,1,numel(sctr));
98 % nonZeroYTracDOFs=unique(sctr*2);
99 % nonZeroXTracDOFs=unique(sctr*2-1);
100
101 %% spanner example
102
103 % prescribe our Dirichlet nodes
104
1 105 elms=[1 12] *n + 1;
1 106 sctrX = elConn(elms,1);
1 107 sctrX=reshape(sctrX,1,numel(sctrX));
108
1 109 elms=[1 2 11 12]*n + 1;
1 110 sctrY = elConn(elms,1);
1 111 sctrY=reshape(sctrY,1,numel(sctrY));
112
1 113 presDispDOFs=sort([sctrX*2-1 sctrY*2]);
1 114 dirichletVals=zeros(1,length(presDispDOFs));
115
116
117 % Now let's prescribe our tractions - this is everywhere except the two
118 % dirichlet nodes
1 119 tracEndElms = [1 12]*n;
1 120 tracStartElms = tracEndElms + 1;
1 121 sctrX = [tracConn(tracEndElms,end) tracConn(tracStartElms,1)];
1 122 sctrX = reshape(sctrX,1, numel(sctrX));
123
1 124 tracEndElms = [1 2 11 12]*n;
1 125 tracStartElms = tracEndElms + 1;
1 126 sctrY = [tracConn(tracEndElms,end) tracConn(tracStartElms,1)];
1 127 sctrY = reshape(sctrY,1, numel(sctrY));
128
1 129 allTracDOFs = 1:2*max(tracConn(:,end));
0.05 1 130 presTracDOFs = setxor(allTracDOFs, [sctrX*2-1 sctrY*2]);
131
132 % and our non-zero trac DOF
1 133 prevElmt=6*n;
1 134 tracElms = 6*n+1:7*n;
1 135 procElmt=7*n+1;
1 136 rightSideDOF = unique(reshape(tracConn(tracElms,:),1,numel(tracConn(tracElms,:))));
1 137 sctrY = [tracConn(prevElmt,end) rightSideDOF tracConn(procElmt,1)];
138
139 % and now get the nonzero x and y tractions
1 140 nonZeroYTracDOFs = sctrY*2;
1 141 nonZeroXTracDOFs = [];
142
1 143 end
Other subfunctions in this file are not included in this listing.