| OptFEM2DP1 Toolbox 1.2b4 Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D

- Main Page
- Related Pages
- Files

- File List
- File Members

Opt/BuildIgJgP1VF.m
Go to the documentation of this file.

    00001 function [Ig,Jg]=BuildIgJgP1VF(Num,me,nq)
    00002 % function [Ig,Jg]=BuildIgJgP1VF(Num,me,nq)
    00003 %   Definition of the arrays Ig and Jg, depending on the
    00004 %   parameter Num of global numbering of degrees of freedom.
    00005 %
    00006 % Parameters:
    00007 % Num: Choice of the numbering of degrees of freedom
    00008 %    - 0 local numbering (classical method)
    00009 %    - 1 global numbering
    00010 % nq: total number of vertices, also denoted by `\nq`.
    00011 % me: Connectivity array, `3\times\nme` array.<br/>
    00012 % `\me(\jl,k)` is the storage index of the
    00013 % `\jl`-th  vertex of the `k`-th triangle in the array `\q` of vertices coordinates, `\jl\in\{1,2,3\}` and
    00014 %      `k\in{\ENS{1}{\nme}}`.
    00015 %
    00016 % Return values:
    00017 % Ig : Array of indices, 2ndf-by-nmef  array
    00018 % Jg : Array of indices, 2ndf-by-nmef  array
    00019 % Copyright:
    00020 %   See \ref license
    00021 switch Num
    00022 case 0
    00023   GetI=@(me) [2*me(1,:)-1; 2*me(1,:); 2*me(2,:)-1; 2*me(2,:); 2*me(3,:)-1; 2*me(3,:)];
    00024 case 1
    00025   GetI=@(me) [me(1,:); me(1,:)+nq; me(2,:); me(2,:)+nq; me(3,:); me(3,:)+nq];
    00026 case 2
    00027   GetI=@(me) [2*me(1,:)-1; 2*me(2,:)-1; 2*me(3,:)-1; 2*me(1,:); 2*me(2,:); 2*me(3,:)];
    00028 case 3
    00029   GetI=@(me) [me(1,:); me(2,:); me(3,:); me(1,:)+nq; me(2,:)+nq; me(3,:)+nq];
    00030 end
    00031 ii=[1:6]'*ones(1,6);
    00032 ii=ii(:);
    00033 jj=ones(6,1)*[1:6];
    00034 jj=jj(:);
    00035
    00036 I=GetI(me);
    00037
    00038 Ig=I(ii,:);
    00039 Ig=Ig(:);
    00040 Jg=I(jj,:);
    00041 Jg=Jg(:);

All Files Functions