1 | function plot_tensor(md,options,width,i,type);
|
---|
2 | %PLOT_TENSOR - plot tensor components
|
---|
3 | %
|
---|
4 | % Usage:
|
---|
5 | % plot_tensor(md,options,width,i);
|
---|
6 | %
|
---|
7 | % See also: PLOTMODEL
|
---|
8 |
|
---|
9 | h=subplot(width,width,i); axis off; pos=get(h,'Position');
|
---|
10 |
|
---|
11 | plot_options.offsetx=pos(1);
|
---|
12 | plot_options.offsety=pos(2);
|
---|
13 | plot_options.width=pos(3);
|
---|
14 | plot_options.height=pos(4);
|
---|
15 |
|
---|
16 | %Figure out tensor type:
|
---|
17 | %FIXME does not work anymore
|
---|
18 | if strncmpi(type,'strain',6),
|
---|
19 | tensor=md.results.strainrate;
|
---|
20 | elseif strncmpi(type,'stress',6),
|
---|
21 | tensor=md.results.stress;
|
---|
22 | elseif strncmpi(type,'deviatoricstress',16),
|
---|
23 | tensor=md.results.deviatoricstress;
|
---|
24 | else
|
---|
25 | error('plot_tensor error message: unsupported type of tensor');
|
---|
26 | end
|
---|
27 |
|
---|
28 | %Figure out type of plot being requested
|
---|
29 | if strncmpi(fliplr(type),fliplr('tensor'),6) | strcmpi(type,'strainrate') | strcmpi(type,'deviatoricstress') | strcmpi(type,'stress'),
|
---|
30 | plot_tensor_components(md,options,width,i,tensor,type,plot_options);
|
---|
31 | return;
|
---|
32 | elseif strncmpi(fliplr(type),fliplr('principal'),9),
|
---|
33 | plot_tensor_principal(md,options,width,i,tensor,type,plot_options);
|
---|
34 | return;
|
---|
35 | elseif strncmpi(fliplr(type(1:end-1)),fliplr('principalaxis'),13),
|
---|
36 | plot_tensor_principalaxis(md,options,width,i,tensor,type,plot_options);
|
---|
37 | return;
|
---|
38 | else
|
---|
39 | error('plot_tensor error message: unsurported type of plot');
|
---|
40 | end
|
---|