OptFEM2D Toolbox for Matlab  V1.2b1
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D
 All Files Functions Pages
GetMaxLengthEdges.m
Go to the documentation of this file.
1 function h=GetMaxLengthEdges(q,me)
2 % function h=GetMaxLengthEdges(q,me)
3 % Computation of the maximal value of edge lengths
4 %
5 % Parameters:
6 % q: Array of vertices coordinates, `2\times\nq` array (double). <br/>
7 % `{\q}(\il,j)` is the
8 % `\il`-th coordinate of the `j`-th vertex, `\il\in\{1,2\}` and
9 % `j\in\ENS{1}{\nq}`
10 % me: Connectivity array, `3\times\nme` array ('int32'). <br/>
11 % `\me(\jl,k)` is the storage index of the
12 % `\jl`-th vertex of the `k`-th triangle in the array `\q` of vertices coordinates, `\jl\in\{1,2,3\}` and
13 % `k\in{\ENS{1}{\nme}}`.
14 %
15 % Return values:
16 % h: maximal length of an edge in the mesh
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 U=q(:,me(1,:))-q(:,me(2,:));
34 V=q(:,me(2,:))-q(:,me(3,:));
35 W=q(:,me(3,:))-q(:,me(1,:));
36 
37 h=sqrt(max([sum(U.^2,1),sum(W.^2,1),sum(W.^2,1)]));
38