0001 function plot_tensor(md,options_structure,width,i,type);
0002
0003
0004
0005
0006
0007
0008
0009 h=subplot(width,width,i); axis off; pos=get(h,'Position');
0010
0011 plot_options.offsetx=pos(1);
0012 plot_options.offsety=pos(2);
0013 plot_options.width=pos(3);
0014 plot_options.height=pos(4);
0015
0016
0017 if strcmpi(type(1:6),'strain'),
0018 tensor=md.strainrate;
0019 elseif strcmpi(type(1:6),'stress'),
0020 tensor=md.stress;
0021 elseif strcmpi(type(1:16),'deviatoricstress'),
0022 tensor=md.deviatoricstress;
0023 else
0024 error('plot_tensor error message: unsupported type of tensor');
0025 end
0026
0027
0028 if strcmpi(type(end-5:end),'tensor') | strcmpi(type,'strainrate') | strcmpi(type,'deviatoricstress') | strcmpi(type,'stress'),
0029 plot_tensor_components(md,options_structure,width,i,tensor,type,plot_options);
0030 return;
0031 elseif strcmpi(type(end-8:end),'principal'),
0032 plot_tensor_principal(md,options_structure,width,i,tensor,type,plot_options);
0033 return;
0034 elseif strcmpi(type(end-13:end-1),'principalaxis'),
0035 plot_tensor_principalaxis(md,options_structure,width,i,tensor,type,plot_options);
0036 return;
0037 else
0038 error('plot_tensor error message: unsurported type of plot');
0039 end