CreateKMatrix

PURPOSE ^

CREATEKMATRIX - create the stiffmess matrix for beamelem

SYNOPSIS ^

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

DESCRIPTION ^

CREATEKMATRIX - create the stiffmess matrix for beamelem

   this stiffness matrix works for Hutter's model

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

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