1 function glob = local2global(grid,einds,loc,params)
2 %
function glob = local2global(grid,einds,loc,params)
3 %
function performing a local to global coordinate change of
4 % vectors of coordinate pairs.
6 % If the first three vertices of a rectangle are
'v1,v2,v3', then the
7 % global coordinate of a single point is
8 % @code glob = v1 + loc(:,1).*(v2-v1) + loc(:,2).*(v3-v1);
@endcode
11 % loc: matrix of size `K \times 2` holding local barycentric coordinate pairs
12 %
for each cell index `i_k`, `k=1,...,K`.
13 % einds: vector of cell indices `i_k`, `k=1,...,K`.
16 % glob: global coordinate pairs
'[X, Y]' with vectors
'X' and
'Y'
20 % Bernard Haasdonk 2.2.2009
25 VI1 = grid.
VI(einds,4);
26 VI2 = grid.VI(einds,1);
27 VI3 = grid.VI(einds,2);
29 X = grid.X(VI1)
' + loc(1).* (grid.X(VI2)' - grid.X(VI1)');
30 Y = grid.Y(VI1)
' + loc(2).* (grid.Y(VI3)' - grid.Y(VI1)');
A triangular conforming grid in two dimensions.
VI
matrix of vertex indices: VI(i,j) is the global index of j-th vertex of element i ...