forked from wozy13/DIAMOND
-
Notifications
You must be signed in to change notification settings - Fork 0
/
direslts.m
183 lines (166 loc) · 4.85 KB
/
direslts.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
%
% Name: DIresults
%
% Usage: DIresults
%
% Description:
% -outputs the Damage index
% inputs:
%
%
% Version PJC960521
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This matlab source code was originally %
% developed as part of "DIAMOND" at %
% Los Alamos National Laboratory. It may %
% be copied, modified, and distributed in %
% any form, provided: %
% a) This notice accompanies the files and %
% appears near the top of all source %
% code files. %
% b) No payment or commercial services are %
% received in exchange for the code. %
% %
% Original copyright is reserved by the %
% Regents of the University of California, %
% in addition to Scott W. Doebling, Phillip %
% J. Cornwell, Erik G. Straser, and Charles %
% R. Farrar. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DImin=[];
if exist('diropt')==0,diropt=1;end;
textin=DItext(xfp,yfp,DI,diropt,2,2,islopt);
%
% set up figure
%
figDIresults=figure( ...
'Name','Strain Energy/Damage Index Method Results', ...
'NumberTitle','off', ...
'visible','on', ...
'Resize','on');
set(figDIresults,'Position',[230 88 500 420]);
%====================================
% General buttons parameters
%====================================
top=.95;
left=.80;
btnwd=.19;
btnht=.06;
spacing=.01;
%====================================
% Set up the console frame
%=====================================
frmborder=0.01;
ypos=.05-frmborder;
frmpos=[left-frmborder ypos btnwd+2*frmborder .9+2*frmborder];
uicontrol(figDIresults, ...
'Style','Frame', ...
'units','normalized', ...
'Position',frmpos, ...
'Visible','on', ...
'BackgroundColor',[.5 .5 .5]);
%
% Display all
%
btnnum=1;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
uicontrol(figDIresults, ...
'style','pushbutton', ...
'units','normalized', ...
'position',btnpos, ...
'string','Display All', ...
'visible','on', ...
'Callback', ...
['textin=DItext(xfp,yfp,DI,diropt,1,DImin,islopt);', ...
'htextDI=ERAtslid(haxDI,textin,htextDI,hslidDI);']);
%
% For filter
%
btnnum=3;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
uicontrol(figDIresults, ...
'style','pushbutton', ...
'units','normalized', ...
'position',btnpos, ...
'string','Filter', ...
'visible','on', ...
'Callback', ...
['DImin=str2num(get(hdimin,''string''));', ...
'textin=DItext(xfp,yfp,DI,diropt,2,DImin,islopt);', ...
'htextDI=ERAtslid(haxDI,textin,htextDI,hslidDI);']);
%
% Damage index value
%
btnnum=4;
ypos=top-(btnnum-1)*(btnht+spacing)+spacing;
btnpos=[left ypos-btnht btnwd*.65 btnht];
uicontrol(figDIresults, ...
'style','text', ...
'units','normalized', ...
'position',btnpos, ...
'string','abs(DI) >', ...
'visible','on');
ypos=top-(btnnum-1)*(btnht+spacing)+spacing;
btnpos=[left+btnwd*.65 ypos-btnht btnwd*.35 btnht];
hdimin= uicontrol(figDIresults, ...
'style','Edit', ...
'units','normalized', ...
'position',btnpos, ...
'back','w', ...
'string','2', ...
'visible','on');
%
% close
%
btnnum=13;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
uicontrol(figDIresults, ...
'style','pushbutton', ...
'units','normalized', ...
'position',btnpos, ...
'string','Close', ...
'visible','on', ...
'Callback','close');
%
% put results into the window
%
%
% axes
%
haxDI=axes('units','normal', ...
'position',[.05 .04 .7 .92], ...
'color',[.8 .8 .8], ...
'XtickLabels',[], ...
'YtickLabels',[], ...
'visible','on');
%
% Add the vertical slider
%
hslidDI = uicontrol('Style','slider', ...
'Units','normal', ...
'Position',[.72 .04 .03 .92], ...
'min',-2, ...
'max',-1, ...
'visible','on', ...
'UserData',[], ...
'Value',-1, ...
'CallBack',['uu=get(gco,''UserData'');', ...
'axes(uu(2));', ...
'rval = get(gco,''Value'');', ...
'dy = uu(1);', ...
'if (rval-round(rval))>eps,', ... % Test for +step
' rval = ceil(rval);', ...
'elseif (rval-round(rval)) < -eps,', ... % Test for -step
' rval = floor(rval);', ...
'end,', ...
'miny = 1+(floor(abs(rval))-1)*abs(dy);', ...
'maxy = miny+20*abs(dy);', ...
'set(gco,''Value'',rval),', ... % Set the step
'axlim = axis;', ...
'axis([axlim(1:2) miny maxy]),']);
htextDI=ERAtslid(haxDI,textin,htextDI,hslidDI);
axis('ij');