%
%  circular_plate_bc_apply.m  ver 1.0  August 31, 2012
%
function[mass,stiff,pp,con]=circular_plate_bc_apply(mass,stiff,itype)
%
%%    disp(' ');
%%    disp(' The constraint matrix must have three four columns:  node number   TZ RX RY ');
%%    disp(' A value of 1 indicates a constraint.  A value of 0 indicates free. ');
%%    disp(' ');
%%    clear THM;
%%    THM = input(' Enter constraint matrix name:  ');
%
    [THM]=circular_plate_bc_reference(itype);    
%
    sz = size(THM);
    nc=sz(1);
%
    clear con;
    ij=1;
%
        progressbar;
        for i=1:nc
            progressbar(i/nc);
%        
            nodec=THM(i,1);
%        
            if(THM(i,2)==1)
                con(ij)=3*nodec-2;
                ij=ij+1;
            end
%        
            if(THM(i,3)==1)
                con(ij)=3*nodec-1;
                ij=ij+1;
            end
%     
            if(THM(i,4)==1)
                con(ij)=3*nodec;
                ij=ij+1;
            end       
%
        end
        progressbar(1);
%
        clear length;
        pp=length(con);
        con=con';
        con=sort(con,1,'descend');
        con;
%
    progressbar;
    for ij=1:pp
        progressbar(ij/pp);
%        
         k=con(ij);
         mass(:,k)=[];
         mass(k,:)=[];
        stiff(:,k)=[];
        stiff(k,:)=[];        
%
    end
    progressbar(1);