function [dvecs,dvecsdof] = reducedv(dvecs, dvecsdof, saveDOF)
%
% Function: reduceDI.m
% 
% Usage: [dvecs,dvecsdof] = reducedv(dvecs, dvecsdof, saveDOF)
% 
% Description:
%    Reduces the damage vector dvecs with [node dir] in dvecsdof
%	to save only the DOF with directions in saveDOF
%

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

%
% Form vector of dvecs rows to keep
%


keepvec = [];

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

    if ~isempty(find(dvecsdof(i,2)==saveDOF)), 

	keepvec = [keepvec;i];

    end

end

%
%  Reduce dvecs and dvecsdof to the indices listed in keepvec
%

dvecs = dvecs(keepvec);

dvecsdof = dvecsdof(keepvec,:);

return
