# implementing DG for convection dominated problem

Hi there,

I am trying to solve a typical convection-dominated hyperbolic equation using upwind DG:
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("Discontinuous Lagrange", "triangle", 2)
v_element = VectorElement("Lagrange", "triangle", 2)

# Trial and test function: phi and v
phi = TrialFunction(s_element)
v = TestFunction(s_element)

# velocity vector and facet normal;
phi0 = Coefficient(s_element)
b = Coefficient(v_element)
n = FacetNormal("triangle")
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('+'), jump_v)*avg_phi0 + 0.5*bn*dot(jump_phi0, jump_v))*dS \
+ dt*dot(b,jump_v)*phi0('-')*ds

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
Transforming cell integral
Transforming interior facet integral (0, 0)
Form argument must be restricted.

*** FFC: Form argument must be restricted.

=====================================================
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
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Solved by:
Xujun Zhao
Solved:
Last query:
 Revision history for this message Marie Rognes (meg-simula) said on 2013-03-12: #1
 Revision history for this message Xujun Zhao (xzhao99) said on 2013-03-12: #2