source: issm/trunk/src/m/classes/@singelem/CreateKMatrix.m@ 1

Last change on this file since 1 was 1, checked in by Eric.Larour, 16 years ago

Initial import

File size: 1.0 KB
Line 
1function Ke=CreateKMatrix(singelem,grids,materials,inputs,analysis_type)
2%CREATEKMATRIX - create the stiffmess matrix for singelem
3%
4% this stiffness matrix works for Hutter's model
5%
6% Usage:
7% Ke=CreateKMatrix(singelem,grids,materials,inputs,analysis_type)
8%
9% See also CREATEPVECTOR
10
11
12 if strcmpi(analysis_type,'diagnostic_hutter'),
13
14 Ke=CreateKMatrixHutter(singelem,grids,materials,inputs);
15
16 else
17 error('CreateKMatrix/beam error message: analysis type not supported yet')
18 end
19end %end function
20
21function Ke=CreateKMatrixHutter(singelem,grids,materials,inputs)
22
23 %some variables
24 numgrids=1;
25 DOFPERGRID=2;
26 numdof=numgrids*DOFPERGRID; %number of dof for element singelem.
27
28 %Create elementary stiffness matrix
29 Ke=elemmatrix(numdof);
30
31 %Build linear indices for elementary stiffness matrix.
32 for i=1:numgrids,
33 doflist=grids(singelem.g(i)).grid.doflist; %list of dofs in the g-set
34 for j=1:DOFPERGRID,
35 dof=doflist(j);
36 Ke.row_indices((i-1)*DOFPERGRID+j)=dof;
37 end
38
39 dof=doflist(1);
40 end
41
42 Ke.terms=eye(2);
43
44end %end function
Note: See TracBrowser for help on using the repository browser.