% Function: sedambar.m
% 
% Usage: sedambar
% 
% Description:
%    Computes and plots the strain energy
%    damage indicators for bar geometry
%

% Version SWD970703
%
% Author(s): Scott W. Doebling, doebling@lanl.gov
%
% Institution: Los Alamos National Laboratory, ESA-EA
%
% Copyright (c) 1996-1997, The Regents of the University
%     	of California.

numdiv=str2num(get(onHndlVector(10),'string'));
iopt=get(onHndlVector(12),'value');

if iopt==1,
	interpopt='spline';
elseif iopt==2,
	interpopt='cubic';	
end,

%
%  Compute the damage index for each subdivision of each element
%

[DImat,DIlocs] = dibars(Nodes,SEMbeams,phir_resp_u,phir_resp_d,respDOF_u,interpopt,numdiv,mode_anal);

%
%  Set plot parameters
%

ngrad = 0;  % ngrad not used for elemental DI values

inodal = 0;  % DI values are elemental

colormap cool

ptdambar(Nodes,Bars,DImat,haxes,inodal,ngrad,DIlocs);

%  Plot undeformed geometry

damscale(hlegax,DImat);

axes(haxes)
damtitstr = damtitle(['Strain Energy Method - Bar Elements'],pathname_u,filename_u,...
   pathname_d,filename_d,['Number of Divs:',num2str(numdiv),', ','Modes: ',num2str(mode_anal)]);
title(['Strain Energy Method - Bar Elements'])

rotate3d on