Line | |
---|
1 | function 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
|
---|
19 | end %end function
|
---|
20 |
|
---|
21 | function 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 |
|
---|
44 | end %end function
|
---|
Note:
See
TracBrowser
for help on using the repository browser.