![]() |
OptFEM2DP1 Toolbox
V1.2
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D
|
00001 function lbe=EdgeLengthOpt(be,q) 00002 % function lbe=EdgeLength(be,q) 00003 % Computation of the lengths of edges in the mesh 00004 % - Optimized version 00005 % 00006 % Parameters: 00007 % be: Connectivity array for boundary edges, `2\times\nbe` array.<br/> 00008 % `\be(\il,l)` is the storage index of the 00009 % `\il`-th vertex of the `l`-th edge in the array `\q` of vertices coordinates, `\il\in\{1,2\}` and 00010 % `l\in{\ENS{1}{\nbe}}`. 00011 % q: Array of vertices coordinates, `2\times\nq` array. <br/> 00012 % `{\q}(\il,j)` is the 00013 % `\il`-th coordinate of the `j`-th vertex, `\il\in\{1,2\}` and 00014 % `j\in\ENS{1}{\nq}` 00015 % 00016 % 00017 % Return values: 00018 % lbe: Array of edges lengths, `1\times\nbe` array. `lbe(j)` is the length of the `j`-th edge. 00019 % Copyright: 00020 % See \ref license 00021 lbe=sqrt(sum((q(:,be(1,:)) - q(:,be(2,:))).^2,1));