← Back to team overview

ufl team mailing list archive

A basic non-linear problem

 

I am trying to learn how to set up a simple non-linear problem using a
UFL form. In order to solve the following (the non-linear Poisson demo
in DOLFIN),

- div[(1+u^2)*grad(u)] = f,

does something like the following look like the right approach?

element = FiniteElement("Lagrange", "triangle", 1)

v = TestFunction(element)
u = TrialFunction(element)
f = Function(element)
U = Function(element)

L = ((1 + U*U)*inner(grad(U), grad(v)) - f*v)*dx
a = derivative(L, U, u)

I have not yet fully understood how derivative() functions.

Harish


Follow ups