-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSM_plotstressvect.m
More file actions
59 lines (37 loc) · 1.1 KB
/
SM_plotstressvect.m
File metadata and controls
59 lines (37 loc) · 1.1 KB
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
function SM_plotstressvect(Gr)
% FUNCTIONNAME Short description
% [H] = FUNCTIONNAME(INPUT VARIABLES)
%
% Long description
%
% Created by Alan Baird on 2012-02-23.
% Copyright (c) . All rights reserved.
[nx,ny]=size(Gr);
total=nx*ny;
list=reshape(Gr,1,total)
%X = zeros(total) ;
%Y = zeros(total) ;
%ugrid = zeros(total) ;
%vgrid = zeros(total) ;
for i = 1:total
estress= [ -list(i).STRESS(1)-list(i).PRESSURE, -list(i).STRESS(4), -list(i).STRESS(6); ...
-list(i).STRESS(4), -list(i).STRESS(2)-list(i).PRESSURE, -list(i).STRESS(5); ...
-list(i).STRESS(6), -list(i).STRESS(5), -list(i).STRESS(3)-list(i).PRESSURE ];
[V(:,:),D(:,:)] = eig(estress);
[V(:,:),D(:,:)] =sortem(V(:,:),D(:,:));
X(i)=list(i).x;
Y(i)=list(i).y;
sdiff=(D(1,1)-D(3,3))*10^(-6)
V(:,1)
ugrid(i)=V(1,1)*sdiff;
vgrid(i)=V(2,1)*sdiff;
end
%quiver(X,Y,ugrid,vgrid)
X=reshape(X,nx,ny);
Y=reshape(Y,nx,ny);
ugrid=reshape(ugrid,nx,ny);
vgrid=reshape(vgrid,nx,ny);
ncquiverref(X,Y,ugrid,vgrid,'',100,'true','b')
axis equal;
axis tight;
end % function