Download FFC User Manual

Transcript
FFC User Manual
Anders Logg
sig = VectorElement("Discontinuous Lagrange", "triangle", 0)
v
u
u0
C
sig0
f
=
=
=
=
=
=
TestFunction(element)
TrialFunction(element)
Function(element)
Function(DG)
Function(sig)
Function(element)
a = v.dx(i)*C*u.dx(i)*dx + v.dx(i)*2*u0*u*u0.dx(i)*dx
L = v*f*dx - dot(grad(v), sig0)*dx
# FE1Tangent.form
element = FiniteElement("Lagrange", "triangle", 1)
DG = FiniteElement("Discontinuous Lagrange", "triangle", 0)
v = TestFunction(DG)
u = TrialFunction(DG)
u0= Function(element)
a = v*u*dx
L = v*(1.0 + u0*u0)*dx
# FE1Gradient.form
element = FiniteElement("Lagrange", "triangle", 1)
DG = VectorElement("Discontinuous Lagrange", "triangle", 0)
v = TestFunction(DG)
u = TrialFunction(DG)
u0= Function(element)
a = dot(v,u)*dx
L = dot(v,grad(u0))*dx
The 3 forms can be implemented using the QuadratureElement in a similar
fashion in which only the element declaration is different:
61