Download FFC User Manual

Transcript
FFC User Manual
Anders Logg
BDM1 = FiniteElement("Brezzi-Douglas-Marini", "triangle", 1)
DG0 = FiniteElement("Discontinuous Lagrange", "triangle", 0)
element = BDM1 * DG0
(tau, w) = TestFunctions(element)
(sigma, u) = TrialFunctions(element)
f = Function(DG0)
a = (dot(tau, sigma) - div(tau)*u + w*div(sigma))*dx
L = w*f*dx
This example is implemented in the file MixedPoisson.form in the collection
of demonstration forms included with the FFC source distribution.
6.9
Poisson’s equation with DG elements
We consider again Poisson’s equation, but now in an (interior penalty) discontinuous Galerkin formulation: Find u ∈ V = L2 such that
a(v, u) = L(v) ∀v ∈ V,
where
Z
∇v · ∇u dx
XZ
+
−h∇vi · JuKn − JvKn · h∇ui + (α/h)JvKn · JuKn dS
a(v, u) =
Ω
ZS
S
(6.22)
−∇v · JuKn − JvKn · ∇u + (γ/h)vu ds
Z∂Ω
Z
L(v) =
vf dx +
vg ds.
+
Ω
∂Ω
The corresponding finite element variational problem for discontinuous first
order elements may be implemented as follows:
58