function LIFT = Lift2D()

% compute surface to volume lift term for DG formulation

Globals2D;

Emat = zeros(N_p,N_faces * N_fp);

r_face = r(Fmask(:,1)); % we have to use r-coordinate, because for face_1, s = -1 along the edge
V_1D = VandermondeMatrix1D(N,r_face);
M_edge1 = inv(V_1D * V_1D');
Emat(Fmask(:,1),1:N_fp) = M_edge1;

r_face = r(Fmask(:,2)); % both coordinates possible to use
V_1D = VandermondeMatrix1D(N,r_face);
M_edge2 = inv(V_1D * V_1D');
Emat(Fmask(:,2),(N_fp + 1):(2 * N_fp)) = M_edge2;

s_face = s(Fmask(:,3)); % we have to use s-coordinate, because for face_3, r = -1 along the edge
V_1D = VandermondeMatrix1D(N,s_face);
M_edge3 = inv(V_1D * V_1D');
Emat(Fmask(:,3),(2 * N_fp + 1):(3 * N_fp)) = M_edge3;

LIFT = invM * Emat;

end