-
Notifications
You must be signed in to change notification settings - Fork 14
/
CalcTriDisps.m
286 lines (249 loc) · 16 KB
/
CalcTriDisps.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
function [U] = CalcTriDisps(sx, sy, sz, x, y, z, pr, ss, ts, ds)
% CalcTriDisps.m
%
% Calculates displacements due to slip on a triangular dislocation in an
% elastic half space utilizing the Comninou and Dunders (1975) expressions
% for the displacements due to an angular dislocation in an elastic half
% space.
%
% Arguments
% sx : x-coordinates of observation points
% sy : y-coordinates of observation points
% sz : z-coordinates of observation points
% x : x-coordinates of triangle vertices.
% y : y-coordinates of triangle vertices.
% z : z-coordinates of triangle vertices.
% pr : Poisson's ratio
% ss : strike slip displacement
% ts : tensile slip displacement
% ds : dip slip displacement
%
% Returns
% U : structure containing the displacements (U.x, U.y, U.z)
%
% This paper should and related code should be cited as:
% Brendan J. Meade, Algorithms for the calculation of exact
% displacements, strains, and stresses for Triangular Dislocation
% Elements in a uniform elastic half space, Computers &
% Geosciences (2007), doi:10.1016/j.cageo.2006.12.003.
%
% Use at your own risk and please let me know of any bugs/errors!
%
% Copyright (c) 2006 Brendan Meade
%
% Permission is hereby granted, free of charge, to any person obtaining a
% copy of this software and associated documentation files (the
% "Software"), to deal in the Software without restriction, including
% without limitation the rights to use, copy, modify, merge, publish,
% distribute, sublicense, and/or sell copies of the Software, and to permit
% persons to whom the Software is furnished to do so, subject to the
% following conditions:
%
% The above copyright notice and this permission notice shall be included
% in all copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
% OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
% NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
% DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
% OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
% USE OR OTHER DEALINGS IN THE SOFTWARE.
% Calculate the slip vector in XYZ coordinates
normVec = cross([x(2);y(2);z(2)]-[x(1);y(1);z(1)], [x(3);y(3);z(3)]-[x(1);y(1);z(1)]);
normVec = normVec./norm(normVec);
if (normVec(3) < 0) % Enforce clockwise circulation
normVec = -normVec;
[x(2) x(3)] = swap(x(2), x(3));
[y(2) y(3)] = swap(y(2), y(3));
[z(2) z(3)] = swap(z(2), z(3));
end
strikeVec = [-sin(atan2(normVec(2),normVec(1))) cos(atan2(normVec(2),normVec(1))) 0];
dipVec = cross(normVec, strikeVec);
slipComp = [ss ds ts];
slipVec = [strikeVec(:) dipVec(:) normVec(:)] * slipComp(:);
% Solution vectors
U.x = zeros(size(sx));
U.y = zeros(size(sx));
U.z = zeros(size(sx));
% Add a copy of the first vertex to the vertex list for indexing
x(4) = x(1);
y(4) = y(1);
z(4) = z(1);
for iTri = 1:3
% Calculate strike and dip of current leg
strike = 180/pi*(atan2(y(iTri+1)-y(iTri), x(iTri+1)-x(iTri)));
segMapLength = sqrt((x(iTri)-x(iTri+1))^2 + (y(iTri)-y(iTri+1))^2);
[rx ry] = RotateXyVec(x(iTri+1)-x(iTri), y(iTri+1)-y(iTri), -strike);
dip = 180/pi*(atan2(z(iTri+1)-z(iTri), rx));
if dip >= 0
beta = pi/180*(90-dip);
if beta > pi/2
beta = pi/2-beta;
end
else
beta = -pi/180*(90+dip);
if beta < -pi/2
beta = pi/2-abs(beta);
end
end
ssVec = [cos(strike/180*pi) sin(strike/180*pi) 0];
tsVec = [-sin(strike/180*pi) cos(strike/180*pi) 0];
dsVec = cross(ssVec, tsVec);
lss = dot(slipVec, ssVec);
lts = dot(slipVec, tsVec);
lds = dot(slipVec, dsVec);
if (abs(beta) > 0.000001) && (abs(beta-pi) > 0.000001)
% First angular dislocation
[sx1 sy1] = RotateXyVec(sx-x(iTri), sy-y(iTri), -strike);
[ux1 uy1 uz1] = adv(sx1, sy1, sz-z(iTri), z(iTri), beta, pr, lss, lts, lds);
% Second angular dislocation
[sx2 sy2] = RotateXyVec(sx-x(iTri+1), sy-y(iTri+1), -strike);
[ux2 uy2 uz2] = adv(sx2, sy2, sz-z(iTri+1), z(iTri+1), beta, pr, lss, lts, lds);
% Rotate vectors to correct for strike
[uxn uyn] = RotateXyVec(ux1-ux2, uy1-uy2, strike);
uzn = uz1-uz2;
% Add the displacements from current leg
U.x = U.x + uxn;
U.y = U.y + uyn;
U.z = U.z + uzn;
end
end
% Identify indices for stations under current triangle
inPolyIdx = find(inpolygon(sx, sy, x, y) == 1);
underIdx = [];
for iIdx = 1 : numel(inPolyIdx)
d = LinePlaneIntersect(x, y, z, sx(inPolyIdx(iIdx)), sy(inPolyIdx(iIdx)), sz(inPolyIdx(iIdx)));
if d(3)-sz(inPolyIdx(iIdx)) < 0
underIdx = [underIdx ; inPolyIdx(iIdx)];
end
end
% Apply static offset to the points that lie underneath the current triangle
U.x(underIdx) = U.x(underIdx) - slipVec(1);
U.y(underIdx) = U.y(underIdx) - slipVec(2);
U.z(underIdx) = U.z(underIdx) - slipVec(3);
function d = LinePlaneIntersect(x, y, z, sx, sy, sz)
% Calculate the intersection of a line and a plane using a parametric
% representation of the plane. This is hardcoded for a vertical line.
numerator = [1 1 1 1 ; x(1) x(2) x(3) sx ; y(1) y(2) y(3) sy ; z(1) z(2) z(3) sz];
numerator = det(numerator);
denominator = [1 1 1 0 ; x(1) x(2) x(3) 0 ; y(1) y(2) y(3) 0 ; z(1) z(2) z(3) -sz];
denominator = det(denominator);
if denominator == 0;
denominator = eps;
end
t = numerator/denominator; % parametric curve parameter
d = [sx sy sz]-([sx sy 0]-[sx sy sz])*t;
function [a b] = swap(a, b)
% Swap two values
temp = a;
a = b;
b = temp;
function [xp yp] = RotateXyVec(x, y, alpha)
% Rotate a vector by an angle alpha
x = x(:);
y = y(:);
alpha = pi/180*alpha;
xp = cos(alpha).*x - sin(alpha).*y;
yp = sin(alpha).*x + cos(alpha).*y;
function [v1 v2 v3] = adv(y1, y2, y3, a, beta, nu, B1, B2, B3)
% These are the displacements in a uniform elastic half space due to slip
% on an angular dislocation (Comninou and Dunders, 1975). Some of the
% equations for the B2 and B3 cases have been corrected following Thomas
% 1993. The equations are coded in way such that they roughly correspond
% to each line in original text. Exceptions have been made where it made
% more sense because of grouping symbols.
sinbeta = sin(beta);
cosbeta = cos(beta);
cotbeta = cot(beta);
z1 = y1.*cosbeta - y3.*sinbeta;
z3 = y1.*sinbeta + y3.*cosbeta;
R2 = y1.*y1 + y2.*y2 + y3.*y3;
R = sqrt(R2);
y3bar = y3 + 2.*a;
z1bar = y1.*cosbeta + y3bar.*sinbeta;
z3bar = -y1.*sinbeta + y3bar.*cosbeta;
R2bar = y1.*y1 + y2.*y2 + y3bar.*y3bar;
Rbar = sqrt(R2bar);
F = -atan2(y2, y1) + atan2(y2, z1) + atan2(y2.*R.*sinbeta, y1.*z1+(y2.*y2).*cosbeta);
Fbar = -atan2(y2, y1) + atan2(y2, z1bar) + atan2(y2.*Rbar.*sinbeta, y1.*z1bar+(y2.*y2).*cosbeta);
% Case I: Burgers vector (B1,0,0)
v1InfB1 = 2.*(1-nu).*(F+Fbar) - y1.*y2.*(1./(R.*(R-y3)) + 1./(Rbar.*(Rbar+y3bar))) - ...
y2.*cosbeta.*((R.*sinbeta-y1)./(R.*(R-z3)) + (Rbar.*sinbeta-y1)./(Rbar.*(Rbar+z3bar)));
v2InfB1 = (1-2.*nu).*(log(R-y3)+log(Rbar+y3bar) - cosbeta.*(log(R-z3)+log(Rbar+z3bar))) - ...
y2.*y2.*(1./(R.*(R-y3))+1./(Rbar.*(Rbar+y3bar)) - cosbeta.*(1./(R.*(R-z3))+1./(Rbar.*(Rbar+z3bar))));
v3InfB1 = y2 .* (1./R - 1./Rbar - cosbeta.*((R.*cosbeta-y3)./(R.*(R-z3)) - (Rbar.*cosbeta+y3bar)./(Rbar.*(Rbar+z3bar))));
v1InfB1 = v1InfB1 ./ (8.*pi.*(1-nu));
v2InfB1 = v2InfB1 ./ (8.*pi.*(1-nu));
v3InfB1 = v3InfB1 ./ (8.*pi.*(1-nu));
v1CB1 = -2.*(1-nu).*(1-2.*nu).*Fbar.*(cotbeta.*cotbeta) + (1-2.*nu).*y2./(Rbar+y3bar) .* ((1-2.*nu-a./Rbar).*cotbeta - y1./(Rbar+y3bar).*(nu+a./Rbar)) + ...
(1-2.*nu).*y2.*cosbeta.*cotbeta./(Rbar+z3bar).*(cosbeta+a./Rbar) + a.*y2.*(y3bar-a).*cotbeta./(Rbar.*Rbar.*Rbar) + ...
y2.*(y3bar-a)./(Rbar.*(Rbar+y3bar)).*(-(1-2.*nu).*cotbeta + y1./(Rbar+y3bar) .* (2.*nu+a./Rbar) + a.*y1./(Rbar.*Rbar)) + ...
y2.*(y3bar-a)./(Rbar.*(Rbar+z3bar)).*(cosbeta./(Rbar+z3bar).*((Rbar.*cosbeta+y3bar) .* ((1-2.*nu).*cosbeta-a./Rbar).*cotbeta + 2.*(1-nu).*(Rbar.*sinbeta-y1).*cosbeta) - a.*y3bar.*cosbeta.*cotbeta./(Rbar.*Rbar));
v2CB1 = (1-2.*nu).*((2.*(1-nu).*(cotbeta.*cotbeta)-nu).*log(Rbar+y3bar) -(2.*(1-nu).*(cotbeta.*cotbeta)+1-2.*nu).*cosbeta.*log(Rbar+z3bar)) - ...
(1-2.*nu)./(Rbar+y3bar).*(y1.*cotbeta.*(1-2.*nu-a./Rbar) + nu.*y3bar - a + (y2.*y2)./(Rbar+y3bar).*(nu+a./Rbar)) - ...
(1-2.*nu).*z1bar.*cotbeta./(Rbar+z3bar).*(cosbeta+a./Rbar) - a.*y1.*(y3bar-a).*cotbeta./(Rbar.*Rbar.*Rbar) + ...
(y3bar-a)./(Rbar+y3bar).*(-2.*nu + 1./Rbar.*((1-2.*nu).*y1.*cotbeta-a) + (y2.*y2)./(Rbar.*(Rbar+y3bar)).*(2.*nu+a./Rbar)+a.*(y2.*y2)./(Rbar.*Rbar.*Rbar)) + ...
(y3bar-a)./(Rbar+z3bar).*((cosbeta.*cosbeta) - 1./Rbar.*((1-2.*nu).*z1bar.*cotbeta+a.*cosbeta) + a.*y3bar.*z1bar.*cotbeta./(Rbar.*Rbar.*Rbar) - 1./(Rbar.*(Rbar+z3bar)) .* ((y2.*y2).*(cosbeta.*cosbeta) - a.*z1bar.*cotbeta./Rbar.*(Rbar.*cosbeta+y3bar)));
v3CB1 = 2.*(1-nu).*(((1-2.*nu).*Fbar.*cotbeta) + (y2./(Rbar+y3bar).*(2.*nu+a./Rbar)) - (y2.*cosbeta./(Rbar+z3bar).*(cosbeta+a./Rbar))) + ...
y2.*(y3bar-a)./Rbar.*(2.*nu./(Rbar+y3bar)+a./(Rbar.*Rbar)) + ...
y2.*(y3bar-a).*cosbeta./(Rbar.*(Rbar+z3bar)).*(1-2.*nu-(Rbar.*cosbeta+y3bar)./(Rbar+z3bar).*(cosbeta + a./Rbar) - a.*y3bar./(Rbar.*Rbar));
v1CB1 = v1CB1 ./ (4.*pi.*(1-nu));
v2CB1 = v2CB1 ./ (4.*pi.*(1-nu));
v3CB1 = v3CB1 ./ (4.*pi.*(1-nu));
v1B1 = v1InfB1 + v1CB1;
v2B1 = v2InfB1 + v2CB1;
v3B1 = v3InfB1 + v3CB1;
% Case II: Burgers vector (0,B2,0)
v1InfB2 = -(1-2.*nu).*(log(R-y3) + log(Rbar+y3bar)-cosbeta.*(log(R-z3)+log(Rbar+z3bar))) + ...
y1.*y1.*(1./(R.*(R-y3))+1./(Rbar.*(Rbar+y3bar))) + z1.*(R.*sinbeta-y1)./(R.*(R-z3)) + z1bar.*(Rbar.*sinbeta-y1)./(Rbar.*(Rbar+z3bar));
v2InfB2 = 2.*(1-nu).*(F+Fbar) + y1.*y2.*(1./(R.*(R-y3))+1./(Rbar.*(Rbar+y3bar))) - y2.*(z1./(R.*(R-z3))+z1bar./(Rbar.*(Rbar+z3bar)));
v3InfB2 = -(1-2.*nu).*sinbeta.*(log(R-z3)-log(Rbar+z3bar)) - y1.*(1./R-1./Rbar) + z1.*(R.*cosbeta-y3)./(R.*(R-z3)) - z1bar.*(Rbar.*cosbeta+y3bar)./(Rbar.*(Rbar+z3bar));
v1InfB2 = v1InfB2 ./ (8.*pi.*(1-nu));
v2InfB2 = v2InfB2 ./ (8.*pi.*(1-nu));
v3InfB2 = v3InfB2 ./ (8.*pi.*(1-nu));
v1CB2 = (1-2.*nu).*((2.*(1-nu).*(cotbeta.*cotbeta)+nu).*log(Rbar+y3bar) - (2.*(1-nu).*(cotbeta.*cotbeta)+1).*cosbeta.*log(Rbar+z3bar)) + ...
(1-2.*nu)./(Rbar+y3bar).* (-(1-2.*nu).*y1.*cotbeta+nu.*y3bar-a+a.*y1.*cotbeta./Rbar + (y1.*y1)./(Rbar+y3bar).*(nu+a./Rbar)) - ...
(1-2.*nu).*cotbeta./(Rbar+z3bar).*(z1bar.*cosbeta - a.*(Rbar.*sinbeta-y1)./(Rbar.*cosbeta)) - a.*y1.*(y3bar-a).*cotbeta./(Rbar.*Rbar.*Rbar) + ...
(y3bar-a)./(Rbar+y3bar).*(2.*nu + 1./Rbar.*((1-2.*nu).*y1.*cotbeta+a) - (y1.*y1)./(Rbar.*(Rbar+y3bar)).*(2.*nu+a./Rbar) - a.*(y1.*y1)./(Rbar.*Rbar.*Rbar)) + ...
(y3bar-a).*cotbeta./(Rbar+z3bar).*(-cosbeta.*sinbeta+a.*y1.*y3bar./(Rbar.*Rbar.*Rbar.*cosbeta) + (Rbar.*sinbeta-y1)./Rbar.*(2.*(1-nu).*cosbeta - (Rbar.*cosbeta+y3bar)./(Rbar+z3bar).*(1+a./(Rbar.*cosbeta))));
v2CB2 = 2.*(1-nu).*(1-2.*nu).*Fbar.*cotbeta.*cotbeta + (1-2.*nu).*y2./(Rbar+y3bar).*(-(1-2.*nu-a./Rbar).*cotbeta + y1./(Rbar+y3bar).*(nu+a./Rbar)) - ...
(1-2.*nu).*y2.*cotbeta./(Rbar+z3bar).*(1+a./(Rbar.*cosbeta)) - a.*y2.*(y3bar-a).*cotbeta./(Rbar.*Rbar.*Rbar) + ...
y2.*(y3bar-a)./(Rbar.*(Rbar+y3bar)).*((1-2.*nu).*cotbeta - 2.*nu.*y1./(Rbar+y3bar) - a.*y1./Rbar.*(1./Rbar+1./(Rbar+y3bar))) + ...
y2.*(y3bar-a).*cotbeta./(Rbar.*(Rbar+z3bar)).*(-2.*(1-nu).*cosbeta + (Rbar.*cosbeta+y3bar)./(Rbar+z3bar).*(1+a./(Rbar.*cosbeta)) + a.*y3bar./((Rbar.*Rbar).*cosbeta));
v3CB2 = -2.*(1-nu).*(1-2.*nu).*cotbeta .* (log(Rbar+y3bar)-cosbeta.*log(Rbar+z3bar)) - ...
2.*(1-nu).*y1./(Rbar+y3bar).*(2.*nu+a./Rbar) + 2.*(1-nu).*z1bar./(Rbar+z3bar).*(cosbeta+a./Rbar) + ...
(y3bar-a)./Rbar.*((1-2.*nu).*cotbeta-2.*nu.*y1./(Rbar+y3bar)-a.*y1./(Rbar.*Rbar)) - ...
(y3bar-a)./(Rbar+z3bar).*(cosbeta.*sinbeta + (Rbar.*cosbeta+y3bar).*cotbeta./Rbar.*(2.*(1-nu).*cosbeta - (Rbar.*cosbeta+y3bar)./(Rbar+z3bar)) + a./Rbar.*(sinbeta - y3bar.*z1bar./(Rbar.*Rbar) - z1bar.*(Rbar.*cosbeta+y3bar)./(Rbar.*(Rbar+z3bar))));
v1CB2 = v1CB2 ./ (4.*pi.*(1-nu));
v2CB2 = v2CB2 ./ (4.*pi.*(1-nu));
v3CB2 = v3CB2 ./ (4.*pi.*(1-nu));
v1B2 = v1InfB2 + v1CB2;
v2B2 = v2InfB2 + v2CB2;
v3B2 = v3InfB2 + v3CB2;
% Case III: Burgers vector (0,0,B3)
v1InfB3 = y2.*sinbeta.*((R.*sinbeta-y1)./(R.*(R-z3))+(Rbar.*sinbeta-y1)./(Rbar.*(Rbar+z3bar)));
v2InfB3 = (1-2.*nu).*sinbeta.*(log(R-z3)+log(Rbar+z3bar)) - (y2.*y2).*sinbeta.*(1./(R.*(R-z3))+1./(Rbar.*(Rbar+z3bar)));
v3InfB3 = 2.*(1-nu).*(F-Fbar) + y2.*sinbeta.*((R.*cosbeta-y3)./(R.*(R-z3))-(Rbar.*cosbeta+y3bar)./(Rbar.*(Rbar+z3bar)));
v1InfB3 = v1InfB3 ./ (8.*pi.*(1-nu));
v2InfB3 = v2InfB3 ./ (8.*pi.*(1-nu));
v3InfB3 = v3InfB3 ./ (8.*pi.*(1-nu));
v1CB3 = (1-2.*nu).*(y2./(Rbar+y3bar).*(1+a./Rbar) - y2.*cosbeta./(Rbar+z3bar).*(cosbeta+a./Rbar)) - ...
y2.*(y3bar-a)./Rbar.*(a./(Rbar.*Rbar) + 1./(Rbar+y3bar)) + ...
y2.*(y3bar-a).*cosbeta./(Rbar.*(Rbar+z3bar)).*((Rbar.*cosbeta+y3bar)./(Rbar+z3bar).*(cosbeta+a./Rbar) + a.*y3bar./(Rbar.*Rbar));
v2CB3 = (1-2.*nu).*(-sinbeta.*log(Rbar+z3bar) - y1./(Rbar+y3bar).*(1+a./Rbar) + z1bar./(Rbar+z3bar).*(cosbeta+a./Rbar)) + ...
y1.*(y3bar-a)./Rbar.*(a./(Rbar.*Rbar) + 1./(Rbar+y3bar)) - ...
(y3bar-a)./(Rbar+z3bar).*(sinbeta.*(cosbeta-a./Rbar) + z1bar./Rbar.*(1+a.*y3bar./(Rbar.*Rbar)) - ...
1./(Rbar.*(Rbar+z3bar)).*((y2.*y2).*cosbeta.*sinbeta - a.*z1bar./Rbar.*(Rbar.*cosbeta+y3bar)));
v3CB3 = 2.*(1-nu).*Fbar + 2.*(1-nu).*(y2.*sinbeta./(Rbar+z3bar).*(cosbeta + a./Rbar)) + ...
y2.*(y3bar-a).*sinbeta./(Rbar.*(Rbar+z3bar)).*(1 + (Rbar.*cosbeta+y3bar)./(Rbar+z3bar).*(cosbeta+a./Rbar) + a.*y3bar./(Rbar.*Rbar));
v1CB3 = v1CB3 ./ (4.*pi.*(1-nu));
v2CB3 = v2CB3 ./ (4.*pi.*(1-nu));
v3CB3 = v3CB3 ./ (4.*pi.*(1-nu));
v1B3 = v1InfB3 + v1CB3;
v2B3 = v2InfB3 + v2CB3;
v3B3 = v3InfB3 + v3CB3;
% Sum the for each slip component
v1 = B1.*v1B1 + B2.*v1B2 + B3.*v1B3;
v2 = B1.*v2B1 + B2.*v2B2 + B3.*v2B3;
v3 = B1.*v3B1 + B2.*v3B2 + B3.*v3B3;