function Bars = addbars(Bars,ibar,inode1,inode2)
%
%  Name: addbars
% 
%  Usage: Bars = addbars(Bars,ibar,inode1,inode2)
% 
%   Description:
%     Updates Bars list -- called
%     from GUI geometry definition function 
%     'generategeom'

%  Version SWD960321
%
%  Copyright (c) 1996 by Scott W. Doebling
%	Los Alamos National Laboratory
%	ESA-EA, doebling@lanl.gov
%

if ~isempty(Bars),

  ribar = find(Bars(:,1) == ibar);

else

  ribar = [];

end

if isempty(ribar),

%   This is a new bar element

   Bars= [Bars; ibar, inode1, inode2];

else

%   Replace an existing bar element

   Bars(ribar,:) = [ibar, inode1, inode2];

end

return
