# about the use of dS

Hello
I am trying to solve the Poisson equation in 2D using
the discontinuous galerkin methode (DG).
\delta (\kappa \delta T) = f
Here I want to use an auxiliary variable
q = \kappa \delta T

It is not working. I include the script I am using.
The CG method works and gives a nive solution. It is not
the case with the DG method.

Probably somebody familiar with this method could
explain me what I am doing wrong. I am learning this
kind of method and trying to make it work with simple
examples.

Thanks a lot!

======================================================

from dolfin import *

methode = "DG" # CG / DG

# Create mesh and define function space
mesh = UnitSquare(32, 32)
V_q = VectorFunctionSpace(mesh, methode, 2)
V_T = FunctionSpace (mesh, methode, 1)
W = V_q * V_T

# Define test and trial functions
(q, T) = TrialFunctions(W)
(w, v) = TestFunctions(W)

# Define mehs quantities: normal component, mesh size
n = FacetNormal(mesh)

# define right-hand side
f = Expression("500.0*exp(-(pow(x - 0.5, 2) + pow(x - 0.5, 2)) / 0.02)")

# Define parameters
kappa = 1.0

# Define variational problem
if methode == 'CG':
a = dot(q,w)*dx \
+ T*div(kappa*w)*dx \
+ div(q)*v*dx

elif methode == 'DG':
#modele = "IP"
C11 = 1.

a = dot(q,w)*dx + T*div(kappa*w)*dx \
- kappa*avg(T)*dot(n('-'),w('-'))*dS \
\
- dot( avg(grad(T)) - C11 * jump(T,n) ,n('-'))*v('-')*dS

L = -v*f*dx

# Compute solution
qT = Function(W)
solve(a == L, qT)

# Project solution to piecewise linears
(q , T) = qT.split()

# Save solution to file
file = File("poisson.pvd")
file << T

# Plot solution
plot(T); plot(q)
interactive()

## Question information

Language:
English Edit question
Status:
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
2013-05-26
2013-05-27
 Jan Blechta (blechta) said on 2013-05-27: #1

This forum is closed now. For support check http://fenicsproject.org/support/.

Regarding your problem you might be intersted in http://fenicsproject.org/documentation/dolfin/1.2.0/cpp/demo/pde/mixed-poisson/cpp/documentation.html