1 function loc = global2local(grid, elementid, glob)
2 %
function loc = global2local(grid, elementid, glob)
4 %
function getting a
triagrid, an element-ID and a vector of points and
5 % giving a vector of transformed points. The triangle given by elementid is
6 % used
for the creation of an affine map to the standard tringle, then
this
7 % transformation is used
for all the points in glob
11 % elementid: scalar nr of the triangle in triagrid, which defines the affine map
12 % glob: n-by-2-vector of points to be transformed
15 % loc: n-by-2-vector of the transformed points
17 % Oliver Zeeb, 02.02.11
19 vertex_id = grid.
VI(elementid,:);
20 tria_pts_x = grid.
X(vertex_id);
21 tria_pts_y = grid.
Y(vertex_id);
23 [C,G] = aff_trafo_glob2loc(tria_pts_x, tria_pts_y);
25 loc = (repmat(C,1,size(glob,1)) + G*glob
')';
X
vector of vertex x-coordinates
Y
vector of vertex y-coordinates
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 ...