Download FFC User Manual
Transcript
FFC User Manual
Anders Logg
U = BasisFunction(element)
a = v*U*dx
This example is implemented in the file Mass.form in the collection of demonstration forms included with the FFC source distribution.
5.2
Poisson’s equation
The bilinear and linear forms form for Poisson’s equation,
Z
a(v, U ) =
∇v · ∇U dx,
Ω
Z
L(v) =
v f dx,
(5.2)
(5.3)
Ω
can be implemented as follows:
element = FiniteElement("Lagrange", "triangle", 1)
v = BasisFunction(element)
U = BasisFunction(element)
f = Function(element)
a = dot(grad(v), grad(U))*dx
L = v*f*dx
Alternatively, index notation can be used to express the scalar product:
a = D(v, i)*D(U, i)*dx
This example is implemented in the file Poisson.form in the collection of
demonstration forms included with the FFC source distribution.
42