def METHOD_NAME(mesh, DGDPC1, W):
    velocity = as_vector([-1.0, 0.0])
    u0 = project(velocity, W)
    xs = SpatialCoordinate(mesh)
    inflowexpr = xs[1] + 0.5
    inflow = Function(DGDPC1)
    inflow.interpolate(inflowexpr)
    n = FacetNormal(mesh)
    un = 0.5*(dot(u0, n) + abs(dot(u0, n)))
    D = TrialFunction(DGDPC1)
    phi = TestFunction(DGDPC1)
    a1 = -inner(D, dot(u0, grad(phi)))*dx
    a2 = inner((un('+')*D('+') - un('-')*D('-')), jump(phi))*dS_v
    a3 = un*inner(D, phi)*ds_v(1)  # outflow at left-hand wall
    a = a1 + a2 + a3
    L = -inner(inflow*dot(u0, n), phi)*ds_v(2)  # inflow at right-hand wall
    out = Function(DGDPC1)
    solve(a == L, out)
    assert max(abs(out.dat.data - inflow.dat.data)) < 2e-14