OptFEM2DP1 Toolbox  V1.2b3
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D
 All Files Functions Pages
EdgeLength.m
Go to the documentation of this file.
1 function lbe=EdgeLength(be,q)
2 % function lbe=EdgeLength(be,q)
3 % Computation of the lengths of edges in the mesh - Basic version
4 %
5 % Parameters:
6 % be: Connectivity array for boundary edges, `2\times\nbe` array.<br/>
7 % `\be(\il,l)` is the storage index of the
8 % `\il`-th vertex of the `l`-th edge in the array `\q` of vertices coordinates, `\il\in\{1,2\}` and
9 % `l\in{\ENS{1}{\nbe}}`.
10 % q: Array of vertices coordinates, `2\times\nq` array. <br/>
11 % `{\q}(\il,j)` is the
12 % `\il`-th coordinate of the `j`-th vertex, `\il\in\{1,2\}` and
13 % `j\in\ENS{1}{\nq}`
14 %
15 % Return values:
16 % lbe: Array of edges lengths, `1\times\nbe` array. `lbe(j)` is the length of the `j`-th edge.
17 % Copyright:
18 % See \ref license
19 
20  nbe=size(be,2);
21  lbe=zeros(1,nbe);
22  for i=1:nbe
23  lbe(i)=norm(q(:,be(1,i)) - q(:,be(2,i)),2);
24  end