Which are the correct arguments for NonLinearVariationalProblem?

Hi!

I am currently working on solving non linear mechanics pde with FEniCS, using NonLinearVariationalProblem fonction.

I found several examples (see Hyperelasticity — DOLFIN documentation; https://fenicsproject.org/pub/course/lectures/2012-11-rognes-kaust-sa/lecture_03_static_nonlinear_pdes.pdf; Nonlinear Problems — A FEniCS Tutorial 1.0 documentation) but they seem to propose different ways to formulate the NonLinearVariationalProblem:

du = TrialFunction(V)
v = TestFunction(V)
u = Function(V)

  • 1st case:
    F = derivative(total_potential_energy, u, v)
    J = derivative(F, u, du)
    pde = NonLinearVariationalProblem(F, u, bc, J)
    solver = NonLinearVariationalSolver(pde)
    solver.solve ()

  • 2nd case:
    dF = derivative (F , u)
    pde = NonLinearVariationalProblem(F, u, bc, dF)
    solver = NonLinearVariationalSolver(pde)
    solver.solve ()

Here are my questions:

  • In the 1st case, is “J” the same entity than the “dF” of the 2nd case?
  • I read that in non linear cases, one should only use “u” (i.e. a Function) to define the VariationalProblem, but not “du” (TrialFunction). However, in the 1st case, du is used. Why?
  • Last but not least: which are the correct arguments for the NonLinearVariationalProblem?

Many thanks,
Anne

At a glance these cases are equivalent.

Regarding the use of du = ufl.TrialFunction(V) see @dokken’s excellent tutorials for example.

Regarding “correct” arguments see, e.g., dolfin::NonlinearVariationalProblem.

Many thanks Nate. dokken’s tutorial is very clear and enabled me to better understand non linear problems and the reason why one has to use Function and not TrialFunction dealing with non linear variational problems.

So, if I understood well, a non linear problem can be solved with the Newton approximation method, which consists in representing the problem as successive linear problems. That method requires to use and recompute the jacobian (dF/duh) at each Newton iteration. And, so, to be able to store solution-values uh from each iteration previous step. And as a Function(V) is instanciable and TrialFunction(V) not, storing uh is then possible only using Function(V). Am I correct?

Thanks a lot again,
Anne