| OptFEM2D Toolbox for Matlab V1.2b1 Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D

- Main Page
- Related Pages
- Files

- File List
- File Members

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