


ADDELEMMATRIX - adds a particular stiffness matrix to the global system matrix of the model
Usage:
Kgg=AddElemMatrix(Ke,Kgg)

0001 function Kgg=AddElemMatrix(Ke,Kgg) 0002 %ADDELEMMATRIX - adds a particular stiffness matrix to the global system matrix of the model 0003 % 0004 % Usage: 0005 % Kgg=AddElemMatrix(Ke,Kgg) 0006 0007 %Non optimized code 0008 if Ke.nrows~=0, 0009 for i=1:Ke.nrows, 0010 for j=1:Ke.nrows, 0011 Kgg(Ke.row_indices(i),Ke.row_indices(j))=Kgg(Ke.row_indices(i),Ke.row_indices(j))+Ke.terms(i,j); 0012 end 0013 end 0014 end 0015 0016 %Optimized code: 0017 %if Ke.nrows~=0, 0018 % Kgg(Ke.row_indices(1:Ke.nrows),Ke.row_indices(1:Ke.nrows))=Kgg(Ke.row_indices(1:Ke.nrows),Ke.row_indices(1:Ke.nrows))+Ke.terms(1:Ke.nrows,1:Ke.nrows); 0019 %end