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