%-------------------------------------------------------%
% update the momentum field and pressure field with the %
% pressure correction vector dp                         %
%-------------------------------------------------------%

% pressure 

pnew=pold+dp;

% momentum field

mxnew=mxstar-lambda*([dp;0]-[0;dp(1:J-1);0]);

% velocity fields

uxnew=2*mxnew./([rhonew;rhoright]+[rholeft;rhonew]);
