← Back to team overview

ufl team mailing list archive

Upwinding function

 

To get upwinding in a DG formulation of the advection-diffusion eqn with the FFC .form language, we used

vector = VectorElement("Lagrange", "triangle", 2)
scalar = FiniteElement("Discontinuous Lagrange", "triangle", 1)
constant = FiniteElement("Discontinuous Lagrange", "triangle", 0)

u  = TrialFunction(scalar)
b  = Function(vector)
of = Function(constant)

def upwind(u, b):
  return [b[i]('+')*(of('+')*u('+') + of('-')*u('-')) for i in range(2)]

to return the product b*u, with u taken from the 'upwind' side. How should the function 'upwind' look using UFL?

Garth


Follow ups