CreateKMatrix

PURPOSE ^

CREATEKMATRIX - create the stiffmess matrix for singelem

SYNOPSIS ^

function Ke=CreateKMatrix(singelem,grids,materials,inputs,analysis_type)

DESCRIPTION ^

CREATEKMATRIX - create the stiffmess matrix for singelem

   this stiffness matrix works for Hutter's model

   Usage:
      Ke=CreateKMatrix(singelem,grids,materials,inputs,analysis_type)

   See also CREATEPVECTOR

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function Ke=CreateKMatrix(singelem,grids,materials,inputs,analysis_type)
0002 %CREATEKMATRIX - create the stiffmess matrix for singelem
0003 %
0004 %   this stiffness matrix works for Hutter's model
0005 %
0006 %   Usage:
0007 %      Ke=CreateKMatrix(singelem,grids,materials,inputs,analysis_type)
0008 %
0009 %   See also CREATEPVECTOR
0010 
0011 
0012     if strcmpi(analysis_type,'diagnostic_hutter'),
0013 
0014         Ke=CreateKMatrixHutter(singelem,grids,materials,inputs);
0015 
0016     else
0017         error('CreateKMatrix/beam error message: analysis type not supported yet')
0018     end
0019 end %end function
0020 
0021 function Ke=CreateKMatrixHutter(singelem,grids,materials,inputs)
0022 
0023     %some variables
0024     numgrids=1;
0025     DOFPERGRID=2;
0026     numdof=numgrids*DOFPERGRID; %number of dof for element singelem.
0027 
0028     %Create elementary stiffness matrix
0029     Ke=elemmatrix(numdof);
0030 
0031     %Build linear indices for elementary stiffness matrix.
0032     for i=1:numgrids,
0033         doflist=grids(singelem.g(i)).grid.doflist; %list of dofs in the g-set
0034         for j=1:DOFPERGRID,
0035             dof=doflist(j);
0036             Ke.row_indices((i-1)*DOFPERGRID+j)=dof;
0037         end
0038         
0039         dof=doflist(1);
0040     end
0041 
0042     Ke.terms=eye(2);
0043 
0044 end %end function

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003