Hello,
I am using the fixed point method to find the minimum of the integral Pi = tr(F.T*F) *dx
. However, when I want to do the iteration, I am getting this error: TypeError: unsupported operand type(s) for *: 'Form' and 'float'
. I have attached my minimal code.
Thanks
from dolfin import *
from ufl import replace
mesh = UnitSquareMesh(4,4)
V = VectorFunctionSpace(mesh, "Lagrange", 1)
du = TrialFunction(V)
v = TestFunction(V)
u = Function(V)
F = Identity(len(u)) + grad(u)
u0, u1 = Function(V), Function(V)
f = Expression(("0", "0"), degree=1)
u0 = project(f, V)
Pi = tr(F.T*F) *dx
dPi = derivative(Pi, u, v)
dPi_val = replace(dPi,{u:u0})
deltax = 1.e-6
u1 = -dPi_val *deltax + u0