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