1 function loc = global2local(grid, elementid, glob)
2 %
function loc = global2local(grid, elementid, glob)
3 %
function getting a
triagrid, an element-ID and a vector of points and
4 % giving a vector of transformed points. The triangle given by elementid is
5 % used for the creation of an affine map to the standard tringle, then this
6 % transformation is used for all the points in glob
10 % elementid: scalar nr of the triangle in triagrid, which defines the affine map
11 % glob: n-by-2-vector of points to be transformed
14 % loc: n-by-2-vector of the transformed points
16 % Oliver Zeeb, 02.02.11
18 vertex_id = grid.VI(elementid,:);
19 tria_pts_x = grid.
X(vertex_id);
20 tria_pts_y = grid.Y(vertex_id);
22 [C,G] = aff_trafo_glob2loc(tria_pts_x, tria_pts_y);
24 loc = (repmat(C,1,size(glob,1)) + G*glob')';