I'm dealing with a non-linear finite element problem in 2D.
Let u0 be a stored, previous time-step of u = TrialFunction(V)
Let v be the test-functions.
I need to be able to produce:
cross(curl(u),u0)
Such that the following line produces a matrix that makes sense:
a = -inner(grad(u),grad(v))*dx + inner(cross(curl(u),u0),v)*dx + div(v)*p*dx + q*div(u)*dx
It would appear that I need to create a function that computes my non-linear part explicitly, however, I can't seem to package the values back into the correct form. I realize the following function is totally incorrect, but it represents the "spirit" of what I'm trying to accomplish:
def nonlinear_part(h,k):
out = Function(V)
curl_y_h0 = Dx(h,1)[0]
curl_x_h1 = Dx(h,0)[1]
out = ((-k[1]*(curl_x_h1 - curl_y_h0)),k[0]*(curl_x_h1 - curl_y_h0))
return out