#include "inertia_upw.icc"
navier_stokes_upw_dg::navier_stokes_upw_dg (
 Float Re1, const geo& omega, string approx)
 : navier_stokes_dg (Re1, omega, approx) {}

navier_stokes_upw_dg::value_type
navier_stokes_upw_dg::residue (const value_type& xh) const {
  trial u (Xh); test v (Xh);
  form a = a0 + Re*(  inertia     (xh[0], u, v, qopt) 
                    + inertia_upw (xh[0], u, v, qopt));
  value_type mrh(2);
  mrh[0] = a*xh[0] + b.trans_mult(xh[1]) - lh;
  mrh[1] = b*xh[0] -            c*xh[1]  - kh;
  return mrh;
}
void navier_stokes_upw_dg::update_derivative (const value_type& xh) const {
  trial du (Xh); test v (Xh);
  a1 = a0 + Re*(      inertia         (xh[0], du,    v, qopt) 
                 + inertia_upw        (xh[0], du,    v, qopt)
                 +    inertia         (du,    xh[0], v, qopt)  
               + d_inertia_upw (xh[0], du,    xh[0], v, qopt));
  stokes1 = solver_abtb (a1.uu(), b.uu(), c.uu(), mp.uu());
}
