function [v_x,v_y,v_z] = Curl2D(u,v,w)

% compute 2D curl-operator in (x,y) plane

Globals2D;

u_r = D_r * u; u_s = D_s * u;
v_r = D_r * v; v_s = D_s * v;
v_x = []; v_y = [];
v_z = v_r .* r_x + v_s .* s_x - u_r .* r_y - u_s .* s_y;

if(~isempty(w))
    w_r = D_r * w; w_s = D_s * w;
    v_x = w_r .* r_y + w_s .* s_y;
    v_y = -(w_r .* r_x + w_s .* s_x);
end

end