# implementing DG for convection dominated problem

Asked by Xujun Zhao

Hi there,

I am trying to solve a typical convection-dominated hyperbolic equation using upwind DG:
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("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*phi0, grad(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
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
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Solved by:
Xujun Zhao
Solved:
Last query:
Last reply:
 Revision history for this message Marie Rognes (meg-simula) said on 2013-03-12: #1

For interior facet integrals, all arguments must be restricted (via '+' or '-'). The error tells you that there is (at least) one argument that is not restricted. In particular, dt is not.

 Revision history for this message Xujun Zhao (xzhao99) said on 2013-03-12: #2

Thank you, Marie. That solves my problem!

XZ

To post a message you must log in.