Upwinding in Gridap

Hi all,

I want to solve an advection-diffusion problem with DG and upwinding.
Specifically, I need to define the form

f1(u,v) =  ∫( upwinded(u, b, n_Λ) * v )dΛ

where upwinded(u, b, n_Λ) = u.plus if dot(b, n_\Lambda.plus) > 0 else u.minus if dot(b, n_\Lambda.plus) < 0 else mean(u)
So the two parts to the question are

  1. how does one create a conditional function that can be used with the Gridap interface?
  2. Specifically for upwinding, how can we implement the conditions if dot(b, n_\Lambda) as it is a CellField object?

Thanks in advance!