rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
llocal2local.m
1 function lcoord = llocal2local(grid,faceinds,llcoord)
2 %function lcoord = llocal2local(grid,faceinds,llcoord)
3 % function performing a 1D edge-local coordinate (lcoord) to
4 % 2D local coordinate transformation of given faces
5 %
6 % Parameters:
7 % faceinds: The face indices on which the transformation shall take
8 % place. '(1:3)'
9 % llcoord: single real number between 0 and 1 defining the edge-local vertex
10 % coordinate.
11 %
12 % Return values:
13 % lcoord: matrix of size '2 x |faceinds|' holding the local coordinates.
14 
15 % Bernard Haasdonk 31.8.2009
16 
17 % for triagrid:
18 %locs3 = 1-locs(1,:)-locs(2,:);
19 
20 % extend cyclically for simple index arithmetic
21 corner_lcoord = [0,0;1,0;0,1;0,0]';
22 lcoord = corner_lcoord(:,faceinds)*llcoord + ...
23  corner_lcoord(:,faceinds+1)*(1-llcoord);
24 
A triangular conforming grid in two dimensions.
Definition: triagrid.m:17