Dear all,
I am a new user of Fenics...
I am trying to implement the Arc-Length method inside of Fenics using python interface for nonlinear elasticity purpose.
I am finding some difficulties to assemble the updated tangent stiffness matrix to evaluate the displacement  vector from the Nonlinear elasticity problem;
Here one example how I am defining my nonlinear elasticity problem:
def neoHookian(Mat_Par, u):
     [mu, lmbda] = Mat_Par;
     C = RightCauchyGreen(u);
     Ic = tr(C);     # Invariants of deformation tensors
     J = Jacobian(u);
     # Stored strain energy density (compressible neo-Hookean model of Simo-Ciarlet)
     psi = (mu/2)*(Ic - 3) - mu*ln(J) + (lmbda/2)*(ln(J))**2
     return psi
# Elasticity parameters
E, nu = 3000.0, 0.4
mu, lmbda = Constant(E/(2*(1 + nu))), Constant(E*nu/((1 + nu)*(1 - 2*nu)))
du = TrialFunction(V)            # Incremental displacement
v  = TestFunction(V)             # Test function
u  = Function(V)                 # Displacement from previous iteration
phi = neoHookian([lmbda,mu],u);
Ui  = phi*dx;                                   #Internal Energy
Ues = - dot(g_B, u)*dx - dot(g_T, u)*ds(2);     #External Energy
Ut  = Ui + Ues;
dUt = derivative(Ut, u, v)
d2Ut = derivative(dUt, u, du)
And the I would like to get the assemble_system from the variable:
  d2Ut
to get matrix and vector
  A, b
to solve this Au = b
solve(A, u, b)
Has anyone some example to share?
Regards,
Ricardo