# implementing DG for convection dominated problem

Hi there,

I am trying to solve a typical convection-

du/dt + b*grad(u) = 0

where b is velocity vector. I would like to use explicit time scheme, so define dt as the time step, phi0 is u(n) and phi is u(n+1)

My ufl script is as follows:

s_element = FiniteElement(

v_element = VectorElement(

# Trial and test function: phi and v

phi = TrialFunction(

v = TestFunction(

# velocity vector and facet normal;

phi0 = Coefficient(

b = Coefficient(

n = FacetNormal(

dt = Constant(triangle)

# jump and average quantities

jump_v = jump(v,n)

jump_phi0 = jump(phi0,n)

avg_phi0 = avg(phi0)

# variational form

bn = abs(dot(b('+'), n('+')))

F = (phi*v*dx - phi0*v*dx) \

- dt*dot(b*phi0, grad(v))*dx \

+ dt*(dot(b('+'), jump_v)*avg_phi0 + 0.5*bn*

+ dt*dot(

a = lhs(F)

L = rhs(F)

// =======

It always gives out some ffc compiling error:

Compiler stage 1 finished in 0.038763 seconds.

Compiler stage 2: Computing intermediate representation

-------

Computing representation of 4 elements

Computing representation of 4 dofmaps

Computing representation of integrals

Computing tensor representation

Extracting monomial form representation from UFL form

Transforming monomial form to reference element

Precomputing integrals on reference element

Computing quadrature representation

Transforming cell integral

Computing quadrature representation

Transforming interior facet integral (0, 0)

Form argument must be restricted.

*** FFC: Form argument must be restricted.

*** FFC: To get more information about this error, rerun FFC with --verbose.

=======

Seems there are some problems on interior facet integral (the 3rd line of the F definition). I can't figure out what is going wrong. Can anybody give me some hints? Thanks a lot.

XZ

## Question information

- Language:
- English Edit question

- Status:
- Solved

- Assignee:
- No assignee Edit question

- Solved by:
- Xujun Zhao

- Solved:

- Last query:

- Last reply: