function LIFT = Lift3D()

% compute surface to volume lift term for DG formulation

Globals3D;

Emat = zeros(N_p,N_faces * N_fp);

for face = 1:N_faces
    if (face == 1)
        r_face = r(Fmask(:,face));
        s_face = s(Fmask(:,face));
    end
    if (face == 2)
        r_face = r(Fmask(:,face));
        s_face = t(Fmask(:,face));
    end
    if (face == 3)
        r_face = s(Fmask(:,face));
        s_face = t(Fmask(:,face));
    end
    if (face == 4)
        r_face = s(Fmask(:,face));
        s_face = t(Fmask(:,face));
    end
    V_2D = VandermondeMatrix2D(N,r_face,s_face);
    M_edge = inv(V_2D * V_2D');
    Emat(Fmask(:,face),((face - 1) * N_fp + 1):(face * N_fp)) = M_edge;
end

LIFT = invM * Emat;

end