| OptFEM2DP1 Toolbox V1.2b2 Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D

- Main Page
- Related Pages
- Files

- File List
- File Members

All Files Functions Pages
BuildIkFunc.m
Go to the documentation of this file.
1 function GetI=BuildIkFunc(Num,nq)
2 % function GetI=BuildIkFunc(Num,nq)
3 % Definition of the GetI function depending on the
4 % parameter Num of global numbering of degrees of freedom.
5 % Used by StiffElasAssemblingP1 functions.
6 %
7 % Parameters:
8 % Num: Choice of the numbering of degrees of freedom
9 % - 0 global alternate numbering with local alternate numbering (classical method),
10 % - 1 global block numbering with local alternate numbering,
11 % - 2 global alternate numbering with local block numbering,
12 % - 3 global block numbering with local block numbering.
13 % nq: total number of vertices, also denoted by `\nq`.
14 %
15 % See report
16
17 % Copyright:
18 % See \ref license
19 switch Num
20 case 0
21 GetI=@(me,k) [2*me(1,k)-1, 2*me(1,k), 2*me(2,k)-1, 2*me(2,k), 2*me(3,k)-1, 2*me(3,k)];
22 case 1
23 GetI=@(me,k) [me(1,k) me(1,k)+nq me(2,k) me(2,k)+nq me(3,k) me(3,k)+nq];
24 case 2
25 GetI=@(me,k) [2*me(:,k)-1;2*me(:,k)]';
26 case 3
27 GetI=@(me,k) [me(:,k); me(:,k)+nq]';
28 end