OptFEM2D Toolbox for Matlab  V1.2b1
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 %
20 % OptFEM2DP1 [V1.2b1] - Copyright (C) 2013 CJS (LAGA)
21 %
22 % This file is part of OptFEM2DP1.
23 % OptFEM2DP1 is free software: you can redistribute it and/or modify
24 % it under the terms of the GNU General Public License as published by
25 % the Free Software Foundation, either version 3 of the License, or
26 % (at your option) any later version.
27 %
28 % OptFEM2DP1 is distributed in the hope that it will be useful,
29 % but WITHOUT ANY WARRANTY; without even the implied warranty of
30 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 % GNU General Public License for more details.
32 %
33 % You should have received a copy of the GNU General Public License
34 % along with this program. If not, see <http://www.gnu.org/licenses/>.
35  lbe=sqrt(sum((q(:,be(1,:)) - q(:,be(2,:))).^2,1));