function [xfp,yfp,DI]=findDI1D(slicefp1,xrows,shapeundam,shapedam,Nodes,interpopt,numdiv,mode_anal,diropt)
%
%  Name: findDI1D.m
%
%  Usage: 
%
%  This m-file calculated the fractional energies for each mode
%
%   input:	
%  	
%  	
%
%   output:
%	
%

%  Version SWD970109
%
%  Author(s): Phillip Cornwell, cornwell@lanl.gov
%	modified by Scott W. Doebling, doebling@lanl.gov
%
%  Institution: Los Alamos National Laboratory,
%               ESA-EA
%
%  Copyright (c) 1996-1997, The Regents of the University
%       of California. (See top level of code for
%       full copyright statement.)
%


%
% Define the number of subdivisions for the numerical integration
%

fprintf(1,'Calculating damage index using 1-D technique...');
   
for i=1:length(slicefp1); 
   xvalloc=xrows(:,i);
   xvalloc(find(xvalloc==0))=[];
   sud=shapeundam(xvalloc,:);
   sd=shapedam(xvalloc,:);
   if diropt==1,
   	xvalues=Nodes(xvalloc,3);
   else,
	xvalues=Nodes(xvalloc,2);
   end,
   [xloc,Efrac,Etot]=fracten(xvalues,sud,interpopt,numdiv,mode_anal);
   [xloc,Efracd,Etotd]=fracten(xvalues,sd,interpopt,numdiv,mode_anal);
   betat=findBeta(Etot,Efrac,Etotd,Efracd,mode_anal);
   nanloc=find(isnan(betat)==1);
   betat(nanloc)=ones(size(nanloc));
   beta(1:length(betat),i)=betat';
   slicefp2(1:numdiv,i)=(xloc(1:numdiv)+xloc(2:numdiv+1))'/2;
end,
avebeta=mean(beta(:));
stdbeta=std(beta(:));
DI=(beta-avebeta)/stdbeta;


temp = slicefp1;
slicefp1 = zeros(size(DI));

for i = 1:size(slicefp1,1),

   slicefp1(i,:) = temp';

end


if diropt == 2,

	xfp = slicefp2;
	yfp = slicefp1;

else

	xfp = slicefp1;
	yfp = slicefp2;

end

fprintf(1,'done\n')

return
