← Back to team overview

ufl team mailing list archive

Re: [Question #227431]: UFL Exception : Found argument in Power(...)

 

Question #227431 on UFL changed:
https://answers.launchpad.net/ufl/+question/227431

Jan Blechta posted a new comment:
You need to subclass NonlinearProblem to use NewtonSolver (check Cahn-
Hilliard demo) or define NonlinearVariationalProblem and
NonlinearVariationSolver would use Newton or SNES solver automatically:

gh = Function(VV) # not TrialFunction!
g, h = gh[0], gh[1]
F = (-h.dx(0)*vh - n*n*h*g*vh + n*n*beta*(1 - h*h)*vg)*dx 
J = derivative(F, gh)
problem = NonlinearVariationalProblem(F, gh, bcs, J=J)
solver = NonlinearVariationalSolver(problem)
solver.solve()

You can't assemble your form a! It is not valid bilinear form because it depends in quadratic way on trial function h. You can't express such a form by application of some matrix to basis functions:
a(v_i, v_j) = inner(v_i, A*v_j)

-- 
You received this question notification because you are a member of UFL
Team, which is an answer contact for UFL.